blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
7
390
content_id
stringlengths
40
40
detected_licenses
listlengths
0
35
license_type
stringclasses
2 values
repo_name
stringlengths
6
132
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringclasses
539 values
visit_date
timestamp[us]date
2016-08-02 21:09:20
2023-09-06 10:10:07
revision_date
timestamp[us]date
1990-01-30 01:55:47
2023-09-05 21:45:37
committer_date
timestamp[us]date
2003-07-12 18:48:29
2023-09-05 21:45:37
github_id
int64
7.28k
684M
star_events_count
int64
0
77.7k
fork_events_count
int64
0
48k
gha_license_id
stringclasses
13 values
gha_event_created_at
timestamp[us]date
2012-06-11 04:05:37
2023-09-14 21:59:18
gha_created_at
timestamp[us]date
2008-05-22 07:58:19
2023-08-28 02:39:21
gha_language
stringclasses
62 values
src_encoding
stringclasses
26 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
128
12.8k
extension
stringclasses
11 values
content
stringlengths
128
8.19k
authors
listlengths
1
1
author_id
stringlengths
1
79
af028c3aca46a898ab7ec061d897edbaf11c5c1b
df290d57e06afa36cf9b33494b21ad3dcd62de8f
/pivo-dominio/src/main/java/pe/com/tintegro/dto/request/InsertaSipTrunkRequest.java
81d3578326c51901566fe3b985fe9841630b7233
[]
no_license
vgaray/sic-tintegro
ac766f28f0c8769fe8efb63498bc2f4e5ecf1500
ddb62bdaafe1d6d136c32a758e51eca92dcf365b
refs/heads/master
2022-12-21T15:14:06.168702
2019-09-30T02:09:35
2019-09-30T02:09:35
211,740,401
0
0
null
2022-12-16T07:46:49
2019-09-29T23:40:44
Java
UTF-8
Java
false
false
3,018
java
package pe.com.tintegro.dto.request; public class InsertaSipTrunkRequest extends RequestBase { private String nomSipTrunk; private String outboundCid; private String nomSaliente; private String tipoSaliente; private String hostSaliente; private String usernameSaliente; private String secretSaliente; private String dtmf; private String contextSaliente; private String registrar; private String nomEntrante; private String tipoEntrante; private String secretEntrante; private String contextEntrante; private String idsCodec; private String valoresPermit; public String getNomSipTrunk() { return nomSipTrunk; } public void setNomSipTrunk(String nomSipTrunk) { this.nomSipTrunk = nomSipTrunk; } public String getOutboundCid() { return outboundCid; } public void setOutboundCid(String outboundCid) { this.outboundCid = outboundCid; } public String getNomSaliente() { return nomSaliente; } public void setNomSaliente(String nomSaliente) { this.nomSaliente = nomSaliente; } public String getTipoSaliente() { return tipoSaliente; } public void setTipoSaliente(String tipoSaliente) { this.tipoSaliente = tipoSaliente; } public String getHostSaliente() { return hostSaliente; } public void setHostSaliente(String hostSaliente) { this.hostSaliente = hostSaliente; } public String getUsernameSaliente() { return usernameSaliente; } public void setUsernameSaliente(String usernameSaliente) { this.usernameSaliente = usernameSaliente; } public String getSecretSaliente() { return secretSaliente; } public void setSecretSaliente(String secretSaliente) { this.secretSaliente = secretSaliente; } public String getDtmf() { return dtmf; } public void setDtmf(String dtmf) { this.dtmf = dtmf; } public String getContextSaliente() { return contextSaliente; } public void setContextSaliente(String contextSaliente) { this.contextSaliente = contextSaliente; } public String getRegistrar() { return registrar; } public void setRegistrar(String registrar) { this.registrar = registrar; } public String getNomEntrante() { return nomEntrante; } public void setNomEntrante(String nomEntrante) { this.nomEntrante = nomEntrante; } public String getTipoEntrante() { return tipoEntrante; } public void setTipoEntrante(String tipoEntrante) { this.tipoEntrante = tipoEntrante; } public String getSecretEntrante() { return secretEntrante; } public void setSecretEntrante(String secretEntrante) { this.secretEntrante = secretEntrante; } public String getContextEntrante() { return contextEntrante; } public void setContextEntrante(String contextEntrante) { this.contextEntrante = contextEntrante; } public String getIdsCodec() { return idsCodec; } public void setIdsCodec(String idsCodec) { this.idsCodec = idsCodec; } public String getValoresPermit() { return valoresPermit; } public void setValoresPermit(String valoresPermit) { this.valoresPermit = valoresPermit; } }
[ "victorgaray1296.vg@gmail.com" ]
victorgaray1296.vg@gmail.com
399570f99f904a07abbed33ad4dd0faec8ff7653
8dcaebb27a81a3f8505b30339df7a9b502938d9f
/dubbo-filter-demo/provider2/src/main/java/com/github/thestyleofme/dubbo/filter/api/impl/Hello2ServiceImpl.java
a7911d75b2d80960f15f963dfa851ddd9aedfe01
[]
no_license
thestyleofme/dubbo-explore
7e3873a92515d7c0393072471973f78bfa24699c
98b327b3b67b5b093e4242685130f6fda981b19f
refs/heads/main
2023-01-05T06:31:03.369685
2020-11-08T19:08:25
2020-11-08T19:08:25
308,107,208
2
0
null
null
null
null
UTF-8
Java
false
false
741
java
package com.github.thestyleofme.dubbo.filter.api.impl; import com.github.thestyleofme.dubbo.filter.api.Hello2Service; import org.apache.dubbo.config.annotation.DubboService; import org.apache.dubbo.rpc.RpcContext; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * <p> * description * </p> * * @author isaac 2020/11/08 22:33 * @since 1.0.0 */ @DubboService public class Hello2ServiceImpl implements Hello2Service { private final Logger logger = LoggerFactory.getLogger(getClass()); @Override public String sayHello(String name) { String requestIp = RpcContext.getContext().getAttachment("requestIp"); logger.info("hello2 requestIp: {}", requestIp); return "hello2 " + name; } }
[ "codingdebugallday@163.com" ]
codingdebugallday@163.com
966f9ffbd3484abde3a58fe713aa5794264f1857
2f842d88272f23e7de1f201cce46b7991ebed356
/sys-admin/src/main/java/com/coldchain/common/utils/html/EscapeUtil.java
cf05942ddaa968bd3c59e3a0e64c6ae2d271a314
[]
no_license
luolxb/coldChain
9ddfa2716760c9776035b0de01d0982f27af23c2
e82cb7bdac3d0eb53bf696329c050e07eb621e8e
refs/heads/master
2023-01-07T10:13:50.314346
2020-11-04T07:53:46
2020-11-04T07:53:46
309,877,016
1
1
null
null
null
null
UTF-8
Java
false
false
3,931
java
package com.coldchain.common.utils.html; import com.coldchain.common.utils.StringUtils; /** * 转义和反转义工具类 * * @author nts */ public class EscapeUtil { public static final String RE_HTML_MARK = "(<[^<]*?>)|(<[\\s]*?/[^<]*?>)|(<[^<]*?/[\\s]*?>)"; private static final char[][] TEXT = new char[64][]; static { for (int i = 0; i < 64; i++) { TEXT[i] = new char[] { (char) i }; } // special HTML characters TEXT['\''] = "&#039;".toCharArray(); // 单引号 TEXT['"'] = "&#34;".toCharArray(); // 单引号 TEXT['&'] = "&#38;".toCharArray(); // &符 TEXT['<'] = "&#60;".toCharArray(); // 小于号 TEXT['>'] = "&#62;".toCharArray(); // 大于号 } /** * 转义文本中的HTML字符为安全的字符 * * @param text 被转义的文本 * @return 转义后的文本 */ public static String escape(String text) { return encode(text); } /** * 还原被转义的HTML特殊字符 * * @param content 包含转义符的HTML内容 * @return 转换后的字符串 */ public static String unescape(String content) { return decode(content); } /** * 清除所有HTML标签,但是不删除标签内的内容 * * @param content 文本 * @return 清除标签后的文本 */ public static String clean(String content) { return new HTMLFilter().filter(content); } /** * Escape编码 * * @param text 被编码的文本 * @return 编码后的字符 */ private static String encode(String text) { int len; if ((text == null) || ((len = text.length()) == 0)) { return StringUtils.EMPTY; } StringBuilder buffer = new StringBuilder(len + (len >> 2)); char c; for (int i = 0; i < len; i++) { c = text.charAt(i); if (c < 64) { buffer.append(TEXT[c]); } else { buffer.append(c); } } return buffer.toString(); } /** * Escape解码 * * @param content 被转义的内容 * @return 解码后的字符串 */ public static String decode(String content) { if (StringUtils.isEmpty(content)) { return content; } StringBuilder tmp = new StringBuilder(content.length()); int lastPos = 0, pos = 0; char ch; while (lastPos < content.length()) { pos = content.indexOf("%", lastPos); if (pos == lastPos) { if (content.charAt(pos + 1) == 'u') { ch = (char) Integer.parseInt(content.substring(pos + 2, pos + 6), 16); tmp.append(ch); lastPos = pos + 6; } else { ch = (char) Integer.parseInt(content.substring(pos + 1, pos + 3), 16); tmp.append(ch); lastPos = pos + 3; } } else { if (pos == -1) { tmp.append(content.substring(lastPos)); lastPos = content.length(); } else { tmp.append(content.substring(lastPos, pos)); lastPos = pos; } } } return tmp.toString(); } public static void main(String[] args) { String html = "<script>alert(1);</script>"; System.out.println(EscapeUtil.clean(html)); System.out.println(EscapeUtil.escape(html)); System.out.println(EscapeUtil.unescape(html)); } }
[ "18687269789@163.com" ]
18687269789@163.com
fd2d3168c9c94e0095e31cff398e68350698e5e4
5e3235edf3de262f4d10b9e9e1fcc3bd13d6b8b1
/Code Snippet Repository/Hibernate/Hibernate8135.java
b0f099d69e937c091fd999eb10ccda2b8ce43540
[]
no_license
saber13812002/DeepCRM
3336a244d4852a364800af3181e03e868cf6f9f5
be3e5e50e34a042d5ba7259ff5ff75c08ab32bb9
refs/heads/master
2023-03-16T00:08:06.473699
2018-04-18T05:29:50
2018-04-18T05:29:50
null
0
0
null
null
null
null
UTF-8
Java
false
false
575
java
@Test @TestForIssue( jiraKey = "" ) public void testClassAsParameter() { Session s = openSession(); s.beginTransaction(); s.createQuery( "from Human h where h.name = :class" ).setParameter( "class", new Name() ).list(); s.createQuery( "from Human where name = :class" ).setParameter( "class", new Name() ).list(); s.createQuery( "from Human h where :class = h.name" ).setParameter( "class", new Name() ).list(); s.createQuery( "from Human h where :class <> h.name" ).setParameter( "class", new Name() ).list(); s.getTransaction().commit(); s.close(); }
[ "Qing.Mi@my.cityu.edu.hk" ]
Qing.Mi@my.cityu.edu.hk
d21baa16d9f09900910120c361a47e03813a6e47
350db570521d3fc43f07df645addb9d6e648c17e
/0736_Parse_Lisp_Expression/solution.java
5939b6ea52660b86decca2a409f815f90c95fb12
[]
no_license
benjaminhuanghuang/ben-leetcode
2efcc9185459a1dd881c6e2ded96c42c5715560a
a2cd0dc5e098080df87c4fb57d16877d21ca47a3
refs/heads/master
2022-12-10T02:30:06.744566
2022-11-27T04:06:52
2022-11-27T04:06:52
236,252,145
1
1
null
null
null
null
UTF-8
Java
false
false
2,371
java
package cn.huang.leetcode; /* 736. Parse Lisp Expression */ import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedList; /* */ public class LC_0736_ParseLispExpression { public int evaluate(String expression) { HashMap<String, Integer> bl = new HashMap<>(); int res = help(expression, bl); return res; } private Integer help(String ex, HashMap<String, Integer> bl) { if (ex.startsWith("(")) { String tmp = ex.substring(1, ex.length() - 1); String[] els = deal(tmp); if (els[0].equals("let")) { for (int i = 1; i < els.length - 1; i += 2) { bl.put(els[i], help(els[i + 1], new HashMap<>(bl))); } return help(els[els.length - 1], new HashMap<>(bl)); } else if (els[0].equals("add")) { return help(els[1], new HashMap<>(bl)) + help(els[2], new HashMap<>(bl)); } else { return help(els[1], new HashMap<>(bl)) * help(els[2], new HashMap<>(bl)); } } else { if (Character.isDigit(ex.charAt(0)) || ex.charAt(0) == '-') { return Integer.parseInt(ex); } else { return bl.get(ex); } } } private String[] deal(String tmp) { ArrayList<String> ret = new ArrayList<>(); String[] els = tmp.split(" "); for (int i = 0; i < els.length; ) { if (!els[i].startsWith("(")) { ret.add(els[i++]); } else { StringBuilder el = new StringBuilder(els[i]); LinkedList<String> stack = new LinkedList<>(); stack.addFirst(els[i++]); while (!stack.isEmpty() && i < els.length) { if (els[i].startsWith("(")) { stack.addFirst(els[i]); } int k = els[i].length() - 1; while (k >= 0) { if (els[i].charAt(k--) != ')') break; stack.removeFirst(); } el.append(" ").append(els[i++]); } ret.add(el.toString()); } } return ret.toArray(new String[ret.size()]); } }
[ "bhuang@rms.com" ]
bhuang@rms.com
e9a847a8982433c3d96b221e55e556aa10ede876
742bb3d4b2cf77501d271431b65403cc92cedf1d
/src/main/java/br/com/luciano/npj/model/Assistido.java
0d1d3b93285c3653b880a6fb7a54c8852852ccd9
[ "Apache-2.0" ]
permissive
AntonioLimaSilva/Projeto-com-Spring-Framework
7f593a13c939161ce91a35e6ce83168a970e5f1b
965b634084f855c629ed0ef5dc8d9361c7512d19
refs/heads/master
2020-03-26T20:41:32.446230
2018-09-02T14:23:34
2018-09-02T14:23:34
145,339,899
0
0
null
null
null
null
UTF-8
Java
false
false
2,023
java
package br.com.luciano.npj.model; import java.io.Serializable; import java.time.LocalDateTime; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.ForeignKey; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.OneToOne; import javax.persistence.Table; import javax.persistence.Transient; import org.springframework.format.annotation.DateTimeFormat; @Entity @Table(name = "NPJ_REAL_assistido") public class Assistido implements Serializable { private static final long serialVersionUID = 1L; private Integer id; private Pessoa pessoa; private LocalDateTime dataCriacao; @Id @GeneratedValue(strategy = GenerationType.IDENTITY) public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } @OneToOne(fetch = FetchType.LAZY) @JoinColumn(name = "id_pessoa", foreignKey = @ForeignKey(name = "fk_assistido_pessoa"), nullable = false) public Pessoa getPessoa() { return pessoa; } public void setPessoa(Pessoa pessoa) { this.pessoa = pessoa; } @DateTimeFormat(pattern = "dd/MM/yyyy") @Column(name = "data_criacao", nullable = false) public LocalDateTime getDataCriacao() { return dataCriacao; } public void setDataCriacao(LocalDateTime dataCriacao) { this.dataCriacao = dataCriacao; } @Transient public boolean isNovo() { return this.id == null; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((id == null) ? 0 : id.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Assistido other = (Assistido) obj; if (id == null) { if (other.id != null) return false; } else if (!id.equals(other.id)) return false; return true; } }
[ "luclimasilva@hotmail.com" ]
luclimasilva@hotmail.com
2326f7a28a16b87169babac0c3191527f3e685f9
807345f8fa00e7b1011c09c5a87b26211855ae89
/src/main/java/edu/ctb/upm/midas/service/jpa/HasSemanticTypeService.java
3a1c855d15695ea008b18483394448071768dbce
[ "MIT" ]
permissive
disnet-project/dsvp-rest
96053b96ab6a61dabb9802297f7264d21529b029
e36bc96f5ee3d7a1829a0f9ad917b784ee636adf
refs/heads/master
2020-08-10T20:44:10.936949
2019-12-24T14:32:22
2019-12-24T14:32:22
214,417,215
0
0
null
2019-10-11T11:19:30
2019-10-11T11:19:30
null
UTF-8
Java
false
false
1,359
java
package edu.ctb.upm.midas.service.jpa; import edu.ctb.upm.midas.model.jpa.HasSemanticType; import edu.ctb.upm.midas.model.jpa.HasSemanticTypePK; import java.util.List; /** * Created by gerardo on 19/06/2017. * * @author Gerardo Lagunes G. ${EMAIL} * @version ${<VERSION>} * @project edu.upm.midas * @className HasSymptomService * @see */ public interface HasSemanticTypeService { HasSemanticType findById(HasSemanticTypePK hasSemanticTypePK); HasSemanticType findByIdQuery(HasSemanticTypePK hasSemanticTypePK); HasSemanticType findByIdNative(HasSemanticTypePK hasSemanticTypePK); // HasSemanticType findByIdNativeResultClass(HasSemanticTypePK hasSemanticTypePK); List<HasSemanticType> findAllQuery(); void save(HasSemanticType hasSemanticType); // int insertNative(String textId, String cui, boolean validated, String matchedWords, String positionalInfo); boolean deleteById(HasSemanticTypePK hasSemanticTypePK); void delete(HasSemanticType hasSemanticType); HasSemanticType update(HasSemanticType hasSemanticType); int updateByIdQuery(HasSemanticType hasSemanticType); // int updateValidatedNative(String version, String sourceId, String cui, boolean validated); // int updateMatchedWordsAndPositionalInfoNative(String textId, String cui, String matchedWords, String positionalInfo); }
[ "gerardolagar@ctb.upm.es" ]
gerardolagar@ctb.upm.es
03caa3a223b8d5dcefb5f327bd4f6393647b3ca4
e7ee311e20b40c87bf6d23a53a1d7b11fd29d2c3
/src/chosun/ciis/as/aset/dm/AS_ASET_1101_MDM.java
6979318def223ff58e92007852e1eeeb9e9caa32
[]
no_license
nosmoon/misdevteam
4e3695ef7bbdcd231bb84d7d8d7df54a23ff0a60
1829d5bd489eb6dd307ca244f0e183a31a1de773
refs/heads/master
2020-04-15T15:57:05.480056
2019-01-10T01:12:01
2019-01-10T01:12:01
164,812,547
1
0
null
null
null
null
UHC
Java
false
false
4,399
java
/*************************************************************************************************** * 파일명 : .java * 기능 : 독자우대-구독신청 * 작성일자 : 2007-05-22 * 작성자 : 김대섭 ***************************************************************************************************/ /*************************************************************************************************** * 수정내역 : * 수정자 : * 수정일자 : * 백업 : ***************************************************************************************************/ package chosun.ciis.as.aset.dm; import java.sql.*; import oracle.jdbc.driver.*; import somo.framework.db.*; import somo.framework.util.*; import chosun.ciis.as.aset.ds.*; import chosun.ciis.as.aset.rec.*; /** * */ public class AS_ASET_1101_MDM extends somo.framework.db.BaseDM implements java.io.Serializable{ public String cmpy_cd; public String incmg_pers; public AS_ASET_1101_MDM(){} public AS_ASET_1101_MDM(String cmpy_cd, String incmg_pers){ this.cmpy_cd = cmpy_cd; this.incmg_pers = incmg_pers; } public void setCmpy_cd(String cmpy_cd){ this.cmpy_cd = cmpy_cd; } public void setIncmg_pers(String incmg_pers){ this.incmg_pers = incmg_pers; } public String getCmpy_cd(){ return this.cmpy_cd; } public String getIncmg_pers(){ return this.incmg_pers; } public String getSQL(){ return "{ call MISAST.SP_AS_ASET_1101_M(? ,? ,? ,? ,? ,? ,? ,? ,?) }"; } public void setParams(CallableStatement cstmt, BaseDM bdm) throws SQLException{ AS_ASET_1101_MDM dm = (AS_ASET_1101_MDM)bdm; cstmt.registerOutParameter(1, Types.VARCHAR); cstmt.registerOutParameter(2, Types.VARCHAR); cstmt.setString(3, dm.cmpy_cd); cstmt.setString(4, dm.incmg_pers); cstmt.registerOutParameter(5, OracleTypes.CURSOR); cstmt.registerOutParameter(6, OracleTypes.CURSOR); cstmt.registerOutParameter(7, Types.VARCHAR); cstmt.registerOutParameter(8, Types.VARCHAR); cstmt.registerOutParameter(9, Types.VARCHAR); } public BaseDataSet createDataSetObject(){ return new chosun.ciis.as.aset.ds.AS_ASET_1101_MDataSet(); } public void print(){ System.out.println("SQL = " + this.getSQL()); System.out.println("cmpy_cd = [" + getCmpy_cd() + "]"); System.out.println("incmg_pers = [" + getIncmg_pers() + "]"); } } /*---------------------------------------------------------------------------------------------------- Web Tier에서 req.getParameter() 처리 및 결과확인 검사시 사용하십시오. String cmpy_cd = req.getParameter("cmpy_cd"); if( cmpy_cd == null){ System.out.println(this.toString+" : cmpy_cd is null" ); }else{ System.out.println(this.toString+" : cmpy_cd is "+cmpy_cd ); } String incmg_pers = req.getParameter("incmg_pers"); if( incmg_pers == null){ System.out.println(this.toString+" : incmg_pers is null" ); }else{ System.out.println(this.toString+" : incmg_pers is "+incmg_pers ); } ----------------------------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------------------------- Web Tier에서 req.getParameter() 처리시 사용하십시오. String cmpy_cd = Util.checkString(req.getParameter("cmpy_cd")); String incmg_pers = Util.checkString(req.getParameter("incmg_pers")); ----------------------------------------------------------------------------------------------------*//*---------------------------------------------------------------------------------------------------- Web Tier에서 한글처리와 동시에 req.getParameter() 처리시 사용하십시오. String cmpy_cd = Util.Uni2Ksc(Util.checkString(req.getParameter("cmpy_cd"))); String incmg_pers = Util.Uni2Ksc(Util.checkString(req.getParameter("incmg_pers"))); ----------------------------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------------------------- Web Tier에서 DM 파일의 변수를 설정시 사용하십시오. dm.setCmpy_cd(cmpy_cd); dm.setIncmg_pers(incmg_pers); ----------------------------------------------------------------------------------------------------*/ /* 작성시간 : Mon Mar 02 11:26:39 KST 2015 */
[ "DLCOM000@172.16.30.11" ]
DLCOM000@172.16.30.11
03fd5e594d7c4c4fd1a792ad8cb6c04b5d9e5623
4aed712e4d9761d3252aa13c7d69a1b8df45f43b
/src/cz/burios/uniql/persistence/jpa/jpql/parser/BooleanExpressionBNF.java
4eae4c4d038e05051006b4947425033630e77e9a
[]
no_license
buriosca/cz.burios.uniql-jpa
86c682f2d19c824e21102ac71c150e7de1a25e18
e9a651f836018456b99048f02191f2ebe824e511
refs/heads/master
2022-06-25T01:22:43.605788
2020-07-19T05:13:25
2020-07-19T05:13:25
247,073,006
0
0
null
2022-06-21T03:53:36
2020-03-13T13:05:10
Java
UTF-8
Java
false
false
1,496
java
/******************************************************************************* * Copyright (c) 2006, 2014 Oracle and/or its affiliates. All rights reserved. * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 * which accompanies this distribution. * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html * and the Eclipse Distribution License is available at * http://www.eclipse.org/org/documents/edl-v10.php. * * Contributors: * Oracle - initial API and implementation * ******************************************************************************/ package cz.burios.uniql.persistence.jpa.jpql.parser; /** * The query BNF for a boolean expression. * * <div><b>BNF:</b> <code>boolean_expression ::= boolean_primary | (subquery)</code><p></div> * * @version 2.4 * @since 2.3 * @author Pascal Filion */ @SuppressWarnings("nls") public final class BooleanExpressionBNF extends JPQLQueryBNF { /** * The unique identifier of this BNF rule. */ public static final String ID = "boolean_expression"; /** * Creates a new <code>BooleanExpressionBNF</code>. */ public BooleanExpressionBNF() { super(ID); } /** * {@inheritDoc} */ @Override protected void initialize() { super.initialize(); registerChild(BooleanPrimaryBNF.ID); registerChild(SubqueryBNF.ID); } }
[ "Buriosca.cz@DESKTOP-PKNI7NI" ]
Buriosca.cz@DESKTOP-PKNI7NI
78ae25a11d6d53e23177c062c9b48285b760ac46
9bd64860b1c9c1d7016fcd50e5aeda39bfd10cb6
/MazeDemos/src/main/java/de/amr/demos/grid/maze/swing/BoruvkaMSTApp.java
81057ef644b1f5ca72a6260734ecca4e5f3a3032
[ "MIT" ]
permissive
armin-reichert/mazes-demos
ca4255e3d6736ab54faebacd7fa1657a3ca4f1ad
a4e21ff8875c939e4c093d19771b4b4e55682cc5
refs/heads/master
2023-01-10T11:40:46.642734
2022-12-24T14:49:40
2022-12-24T14:49:40
175,597,537
1
0
null
2022-08-16T09:25:53
2019-03-14T10:15:40
Java
UTF-8
Java
false
false
258
java
package de.amr.demos.grid.maze.swing; import static de.amr.demos.grid.maze.swing.MazeDemoApp.launch; import de.amr.maze.alg.mst.BoruvkaMST; public class BoruvkaMSTApp { public static void main(String[] args) { launch(BoruvkaMST.class); } }
[ "armin.reichert@web.de" ]
armin.reichert@web.de
0cda3f32b8c57ca3776e9300a8a4144002359227
43e305357d2b91fcdd22fb8161ca6e8205c41b9c
/src/main/java/uvsoftgroup/restfulapipostgresql/repository/UserRoleRepository.java
782b98e1d316a47ce33550256ca3e90474f9822e
[]
no_license
haytastan/springpostgresqlrestfulws
d3c89cea894efcbc2c36611b2bd516d079618235
3643c8444b6bff53276eca2d0187c04ed6fa967f
refs/heads/master
2020-08-18T16:02:34.823700
2018-05-24T16:14:42
2018-05-24T16:14:42
null
0
0
null
null
null
null
UTF-8
Java
false
false
443
java
/** * */ package uvsoftgroup.restfulapipostgresql.repository; import org.springframework.data.repository.PagingAndSortingRepository; import org.springframework.data.rest.core.annotation.RepositoryRestResource; import uvsoftgroup.restfulapipostgresql.model.UserRole; @RepositoryRestResource(collectionResourceRel = "userRole", path = "userRoles") public interface UserRoleRepository extends PagingAndSortingRepository<UserRole, Long> { }
[ "riaydhislam@gmail.com" ]
riaydhislam@gmail.com
1b3dda8a7d71cdee9cb9851e2ce8f66ec55c6664
26c653d0063fa7a39bb83b22615f9ad25a9b3254
/src/main/java/de/edgelord/saltyengine/components/rendering/OvalRender.java
aec8bba6de9513bf90d866ece7242d4438069b96
[ "MIT" ]
permissive
CyberianNeptune/salty-engine
2d0a9dfa6cd5225f41d864e5a2562ef69ac259fb
916f8d8c085d57d8a92768c7642f112bc70aa109
refs/heads/master
2020-04-08T09:17:25.657707
2018-11-26T14:11:46
2018-11-26T14:11:46
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,263
java
/* * This software was published under the MIT License. * The full LICENSE file can be found here: https://github.com/edgelord314/salty-enigne/tree/master/LICENSE * * Copyright (c) since 2018 by the Salty Engine developers, * Maintained by Malte Dostal * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * */ package de.edgelord.saltyengine.components.rendering; import de.edgelord.saltyengine.core.stereotypes.ComponentParent; /** * This component is used for simplifying the process of rendering an oval. * <p> * The only thing that is LEFT for the user to call is * <code>GameObject.addComponent(new OvalRender(this, "some_id_name"));</code> */ public class OvalRender extends PrimitivesRenderComponent { public OvalRender(final ComponentParent parent, final String name) { super(parent, name); } @Override public void updateImageData() { setPrimitiveDraw(saltyGraphics -> { if (isFill()) { saltyGraphics.drawOval(0, 0, getParent().getWidth(), getParent().getHeight()); } else { saltyGraphics.outlineOval(getLineWidth() / 2f, getLineWidth() / 2f, getParent().getWidth(), getParent().getHeight()); } }); } }
[ "malte.dostal@gmail.com" ]
malte.dostal@gmail.com
07f62a67ecbad3988ba0e7b9a53b564449ac2869
4c4ae435db4175f209440b3b4f7d46fa98676b07
/open-metadata-implementation/repository-services/repository-services-apis/src/main/java/org/odpi/openmetadata/repositoryservices/connectors/stores/archivestore/OpenMetadataArchiveStoreConnector.java
44bfb86897b4087667b1ef0f272b0436c69f389b
[ "CC-BY-4.0", "Apache-2.0" ]
permissive
danielaotelea/egeria
20536336efd2f6ab22d188673a02e4a4dc2490c1
1c50ffda7404820203b4e4422e2c8a7829030f43
refs/heads/master
2023-01-25T01:40:00.002563
2020-10-21T11:33:29
2020-10-21T11:33:29
206,025,967
1
0
Apache-2.0
2023-01-23T06:12:10
2019-09-03T08:19:58
Java
UTF-8
Java
false
false
1,111
java
/* SPDX-License-Identifier: Apache-2.0 */ /* Copyright Contributors to the ODPi Egeria project. */ package org.odpi.openmetadata.repositoryservices.connectors.stores.archivestore; import org.odpi.openmetadata.frameworks.auditlog.AuditLog; import org.odpi.openmetadata.frameworks.auditlog.AuditLoggingComponent; import org.odpi.openmetadata.frameworks.connectors.ConnectorBase; /** * OpenMetadataArchiveStoreConnector is the base class for connectors that support the OpenMetadataArchiveStore */ public abstract class OpenMetadataArchiveStoreConnector extends ConnectorBase implements OpenMetadataArchiveStore, AuditLoggingComponent { protected AuditLog auditLog = null; /** * Receive an audit log object that can be used to record audit log messages. The caller has initialized it * with the correct component description and log destinations. * * @param auditLog audit log object */ public void setAuditLog(AuditLog auditLog) { this.auditLog = auditLog; } }
[ "mandy_chessell@uk.ibm.com" ]
mandy_chessell@uk.ibm.com
92852a74bbc3577303e2fd79801485d5da25f737
9ffdeedbb966e25ae8f46045a4cd5fd4c4fdd71a
/fupin_2_0/src/main/java/com/roch/fupin/entity/ResultFuPinZhuanXiangZiJing_ResultList.java
ec33a0cc5d44da05d294e63564cbd62e42281e31
[]
no_license
gugj/FuPin_2_0_TongLiao
ef6bc04356924411ed937b1f357eface1f06a5ab
6bad2ea4550fb1d4349bd2a7ad34adfa40eb3eae
refs/heads/master
2021-01-22T21:13:10.083617
2017-08-18T06:25:32
2017-08-18T06:25:32
100,679,481
1
0
null
null
null
null
UTF-8
Java
false
false
318
java
package com.roch.fupin.entity; import java.util.List; /** * 扶贫专项资金统计ResultList * @author ZhaoDongShao * 2016年8月12日 */ public class ResultFuPinZhuanXiangZiJing_ResultList extends BaseResult{ private static final long serialVersionUID = 1L; public List<FuPinZhuanXiangZiJing> jsondata; }
[ "qqdongshao123@126.com" ]
qqdongshao123@126.com
ca0c60a4bae64bb8543652aaa0b57910509ec2b1
ff05965a1216a8b5f17285f438558e6ed06e0db4
/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/BigIntegerType.java
1ce9f60899927fc85159cb44eb62d1a6149626d8
[ "Apache-2.0" ]
permissive
liucong/jms4cxf2
5ba89e857e9c6a4c542dffe0a13b3f704a19be77
56f6d8211dba6704348ee7e7551aa1a1f2c4d889
refs/heads/master
2023-01-09T18:08:51.730922
2009-09-16T03:16:48
2009-09-16T03:16:48
194,633
1
4
null
2023-01-02T21:54:29
2009-05-07T03:43:06
Java
UTF-8
Java
false
false
1,677
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.cxf.aegis.type.basic; import java.math.BigInteger; import org.apache.cxf.aegis.Context; import org.apache.cxf.aegis.type.AegisType; import org.apache.cxf.aegis.xml.MessageReader; import org.apache.cxf.aegis.xml.MessageWriter; /** * <code>AegisType</code> for a <code>BigInteger</code> * * @author <a href="mailto:peter.royal@pobox.com">peter royal</a> */ public class BigIntegerType extends AegisType { public BigIntegerType() { super(); } @Override public Object readObject(final MessageReader reader, final Context context) { final String value = reader.getValue(); return null == value ? null : new BigInteger(value.trim()); } @Override public void writeObject(final Object object, final MessageWriter writer, final Context context) { writer.writeValue(object.toString()); } }
[ "liucong07@gmail.com" ]
liucong07@gmail.com
38bd1aea0ee2d90050c1e9c28e6f27fc1a37f26e
be73270af6be0a811bca4f1710dc6a038e4a8fd2
/crash-reproduction-moho/results/XWIKI-12798-116-10-NSGA_II-LineCoverage:ExceptionType:StackTraceSimilarity/com/xpn/xwiki/internal/template/DefaultTemplateManager_ESTest.java
5a5d3fe722c8cade11d2850902ee00a478c30df0
[]
no_license
STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application
cf118b23ecb87a8bf59643e42f7556b521d1f754
3bb39683f9c343b8ec94890a00b8f260d158dfe3
refs/heads/master
2022-07-29T14:44:00.774547
2020-08-10T15:14:49
2020-08-10T15:14:49
285,804,495
0
0
null
null
null
null
UTF-8
Java
false
false
582
java
/* * This file was automatically generated by EvoSuite * Mon Apr 06 18:55:15 UTC 2020 */ package com.xpn.xwiki.internal.template; import org.junit.Test; import static org.junit.Assert.*; import org.evosuite.runtime.EvoRunner; import org.evosuite.runtime.EvoRunnerParameters; import org.junit.runner.RunWith; @RunWith(EvoRunner.class) @EvoRunnerParameters(useVFS = true, useJEE = true) public class DefaultTemplateManager_ESTest extends DefaultTemplateManager_ESTest_scaffolding { @Test public void notGeneratedAnyTest() { // EvoSuite did not generate any tests } }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
897dff18b24409ab2a896eba6212570e29f4595b
fe2247685ec1a2d37015132232e8b0eecc1e6308
/src/main/java/warmer/star/blog/security/WebSuccessHandler.java
b8f82b3ba75db68566b53d7c0041fd20dc022598
[]
no_license
MiracleTanC/warmerblog
24a957767c2f4394a9e2e7df1732f4790a690915
df8888e35f053f7d8d8ac88878ff16efe99a3716
refs/heads/master
2023-05-11T10:30:54.427053
2022-04-06T00:50:12
2022-04-06T00:50:12
144,241,594
57
27
null
2023-04-29T02:05:11
2018-08-10T05:39:02
Java
UTF-8
Java
false
false
2,270
java
package warmer.star.blog.security; import com.alibaba.fastjson.JSON; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.security.core.Authentication; import org.springframework.security.web.DefaultRedirectStrategy; import org.springframework.security.web.RedirectStrategy; import org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler; import org.springframework.security.web.savedrequest.HttpSessionRequestCache; import org.springframework.security.web.savedrequest.RequestCache; import org.springframework.security.web.savedrequest.SavedRequest; import org.springframework.stereotype.Component; import warmer.star.blog.util.StringUtil; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; /** * Created by xinshengshu on 2018/9/25. */ @Component public class WebSuccessHandler extends SavedRequestAwareAuthenticationSuccessHandler { protected final Log logger = LogFactory.getLog(this.getClass()); @Override public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response,Authentication authentication) throws IOException, ServletException { RedirectStrategy redirectStrategy = new DefaultRedirectStrategy(); String[] returnurl = request.getParameterValues("return"); System.out.println("returnurl:"+JSON.toJSON(returnurl)); if (returnurl != null && returnurl.length > 0) { redirectStrategy.sendRedirect(request, response, returnurl[0]); } else { RequestCache cache = new HttpSessionRequestCache(); SavedRequest savedRequest = cache.getRequest(request, response); String url=""; if(savedRequest!=null){ url = savedRequest.getRedirectUrl(); } if(StringUtil.isNotBlank(url)){ url = request.getHeader("Referer"); } if(StringUtil.isBlank(url)){ url="/home"; } redirectStrategy.sendRedirect(request, response, url); } // TODO: 2019/6/12 消息队列邮件通知登录信息 } }
[ "1130196938@qq.com" ]
1130196938@qq.com
bdebd598ce4acf930caa0415a9949d3cd8c2b807
3dbda028a27190c4e9614c1cfffa751458d398c8
/Spring/SpringPro2/src/main/java/cn/zhen77/aop/proxy01/UserServiceImpl.java
3094d24855df524797e753f47a3381f33b2da607
[]
no_license
Zhen7-7/FrameWork
264c372cd31ed6a98170520a9f1d47ad102dd8a1
87c07e9fc97b9fec70419ac5862eebb4941f5c50
refs/heads/master
2023-05-07T06:33:05.177730
2021-05-25T10:36:16
2021-05-25T10:36:16
331,942,347
1
0
null
null
null
null
UTF-8
Java
false
false
580
java
package cn.zhen77.aop.proxy01; /** * @author : zhen77 * @date: 2021/1/30 - 01 - 30 - 17:12 * @Description: cn.zhen77.cn.zhen77.aop.proxy01 * @version: 1.0 */ public class UserServiceImpl implements UserService { @Override public void add() throws Exception { // check();//在添加之前进行权限检查 System.out.println("添加User成功"); // log();//在添加之后进行日志记录 } @Override public void delet() throws Exception { // check(); System.out.println("删除User"); // log(); } }
[ "Zhen18103690519@gmail.com" ]
Zhen18103690519@gmail.com
34939ca1767499793f74f02688d336e12ee8431d
f5dc228c5100440e9afb631e60412c2ca97a3604
/utilities/src/com/myapp/util/log/unixcolors/UnixStringColorizer.java
f3a2ca3b6894eea26cf4b335dfcec0b3b07ea6c0
[]
no_license
Letractively/chunksofcode
f68545d41c61edc6288ad4e43ff98cdb517d11fd
9a730a6ac42286ce09a1ed889a00ab11548256cf
refs/heads/master
2021-01-10T16:54:45.350552
2012-12-10T19:49:01
2012-12-10T19:49:01
46,038,975
1
0
null
null
null
null
UTF-8
Java
false
false
2,829
java
package com.myapp.util.log.unixcolors; import java.awt.Color; import java.util.Collections; import java.util.HashMap; import java.util.Map; /** * * command to remove control characters from output data: * * cat output-file.out | sed 's/[[:cntrl:]]\[[0-9]*[;m]*[0-9]*[m\[K]* //g' | less * */ // cat file.out | sed 's/[[:cntrl:]]\[[0-9]*[;m]*[0-9]*[m\[K]*//g' | less public class UnixStringColorizer { public static final Map<Color, String> COLOR_CODES; static { Map<Color, String> m = new HashMap<Color, String>(); m.put(Color.black, "01;30m"); m.put(Color.red, "01;31m"); m.put(Color.green, "01;32m"); m.put(Color.yellow, "01;33m"); m.put(Color.blue, "01;34m"); m.put(Color.magenta, "01;35m"); m.put(Color.cyan, "01;36m"); m.put(Color.white, "01;37m"); COLOR_CODES = Collections.unmodifiableMap(m); } public static String paintRed(String s) { return colorizeString(s, Color.red); } public static String paintGreen(String s) { return colorizeString(s, Color.green); } public static String paintBlue(String s) { return colorizeString(s, Color.blue); } public static String paintYellow(String s) { return colorizeString(s, Color.yellow); } public static String paintMagenta(String s) { return colorizeString(s, Color.magenta); } public static String paintBlack(String s) { return colorizeString(s, Color.black); } public static String paintWhite(String s) { return colorizeString(s, Color.white); } public static String paintCyan(String s) { return colorizeString(s, Color.cyan); } private static String colorizeString(String str, Color clr) { String code = null; if (str == null || clr == null || (code = COLOR_CODES.get(clr)) == null) { assert false : clr + ", " + str + ", "+ code; // fail during developing return str; } return ("\033[" + code + "\033[K" + str + "\033[m\033[K"); } public static void main(String[] args) throws Throwable { System.out.println(colorizeString("black", Color.black)); System.out.println(colorizeString("red", Color.red)); System.out.println(colorizeString("green", Color.green)); System.out.println(colorizeString("yellow", Color.yellow)); System.out.println(colorizeString("blue", Color.blue)); System.out.println(colorizeString("magenta", Color.magenta)); System.out.println(colorizeString("cyan", Color.cyan)); System.out.println(colorizeString("white", Color.white)); } }
[ "andre.ragg@92fd951c-2788-16aa-bc7f-2090130f54c4" ]
andre.ragg@92fd951c-2788-16aa-bc7f-2090130f54c4
b40a5cae95a9da9ab084044ca9d609f27fb12da1
999b0fb27c312528b53d16a99905069ef74cdc16
/src/com/helospark/kubeeditor/validator/BooleanValidator.java
720bef3610a116889d26eae298870c847948dc7e
[]
no_license
helospark/kube-editor
db29c11fa3dfb2c9065c72cc774a7083ea61e17a
3156db767649d137921ab576db7caf25a24ee453
refs/heads/master
2020-06-13T05:40:00.528364
2019-07-06T15:06:04
2019-07-06T15:06:04
194,557,015
1
1
null
2019-08-21T21:47:32
2019-06-30T20:13:47
Java
UTF-8
Java
false
false
589
java
package com.helospark.kubeeditor.validator; import java.util.List; import java.util.Optional; import org.yaml.snakeyaml.nodes.ScalarNode; public class BooleanValidator implements FieldValueValidator { @Override public Optional<String> getErrorsForValues(String type, ScalarNode scalarNode, List<String> path) { if (type.equals("boolean")) { if (!(scalarNode.getValue().equals("true") || scalarNode.getValue().equals("false"))) { return Optional.of("Boolean value expected"); } } return Optional.empty(); } }
[ "helospark@gmail.com" ]
helospark@gmail.com
c2c77091765553feec388178940a5e4b294f8633
a49524a77f9f64dfa5729c334624068c24776035
/base/src/main/java/vfd/VFDConfig.java
fd458effc1325fd6d21354820e61c4ccc6245855
[ "LicenseRef-scancode-free-unknown", "MIT" ]
permissive
nintha/vproxy
d517e880f97a7852664554033493617548ae9774
5ff73aefe4637fcf28754c10b4f53096f97095cd
refs/heads/dev
2023-06-18T22:22:01.280546
2021-02-15T16:20:35
2021-02-16T06:22:40
322,193,763
0
0
MIT
2021-02-09T11:14:48
2020-12-17T05:44:51
Java
UTF-8
Java
false
false
1,391
java
package vfd; import vproxybase.util.Utils; public class VFDConfig { private VFDConfig() { } // -Dvfd=provided // see FDProvider public static final String vfdImpl; // -Dfstack="--conf /etc/f-stack.conf" public static final String fstack; public static final boolean useFStack; // this field is generated public static String vfdlibname; // -Dvfdtrace=1 public static final boolean vfdtrace; // -Daesetsize=131072 // the setsize for each libae aeEventLoop public static final int aesetsize; static { fstack = Utils.getSystemProperty("fstack", ""); useFStack = !fstack.isBlank(); vfdImpl = useFStack ? "posix" : Utils.getSystemProperty("vfd", "provided"); if (!vfdImpl.equals("provided")) { if (vfdImpl.equals("posix")) { if (useFStack) { vfdlibname = "vfdfstack"; } else { vfdlibname = "vfdposix"; } } else if (vfdImpl.equals("windows")) { vfdlibname = "vfdwindows"; } } String vfdtraceConf = Utils.getSystemProperty("vfd_trace", "0"); vfdtrace = !vfdtraceConf.equals("0"); String aesetsizeStr = Utils.getSystemProperty("ae_setsize", "" + (128 * 1024)); aesetsize = Integer.parseInt(aesetsizeStr); } }
[ "wkgcass@hotmail.com" ]
wkgcass@hotmail.com
d81e5bd281df7aaac9f7477898187f22e61abdd9
8f0d508be866a9a5c515c1bbbc5bf85693ef3ffd
/bedrock/src/main/java/soupply/bedrock/protocol/play/SimpleEvent.java
4b84c2cdf144695fe488c268c20c19a00ad70734
[ "MIT" ]
permissive
hanbule/java
83e7e1e2725b48370b0151a2ac1ec222b5e99264
40fecf30625bdbdc71cce4c6e3222022c0387c6e
refs/heads/master
2021-09-21T22:43:25.890116
2018-09-02T09:28:23
2018-09-02T09:28:23
null
0
0
null
null
null
null
UTF-8
Java
false
false
590
java
package soupply.bedrock.protocol.play; import java.util.*; import soupply.util.*; public class SimpleEvent extends soupply.bedrock.Packet { public static final int ID = 64; @Override public int getId() { return ID; } @Override public void encodeBody(Buffer _buffer) { } @Override public void decodeBody(Buffer _buffer) throws DecodeException { } public static SimpleEvent fromBuffer(byte[] buffer) { SimpleEvent packet = new SimpleEvent(); packet.safeDecode(buffer); return packet; } }
[ "selutils@mail.com" ]
selutils@mail.com
33bbd9b90e2d378735ddcc9ee0ee6cc1124e5c7d
bc6672f3023e86090fc7e25d8041d48822ea8244
/src/main/java/com/fun/gateway/utils/text/CharsetKit.java
ffa31cb6022875a30d4f524b51e7473841c95cf7
[]
no_license
mrdjun/fun-gateway
99739b613bf138ae3d58bd2bc929ca6b94ef1d5a
040505e310fbd11a4329f326b52f693cb19e1632
refs/heads/main
2023-01-20T21:19:01.601054
2020-11-24T09:21:31
2020-11-24T09:21:31
315,577,190
6
3
null
null
null
null
UTF-8
Java
false
false
2,401
java
package com.fun.gateway.utils.text; import com.fun.gateway.utils.StringUtils; import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; /** * 字符集工具类 * * @author DJun */ public class CharsetKit { /** * ISO-8859-1 */ public static final String ISO_8859_1 = "ISO-8859-1"; /** * UTF-8 */ public static final String UTF_8 = "UTF-8"; /** * GBK */ public static final String GBK = "GBK"; /** * ISO-8859-1 */ public static final Charset CHARSET_ISO_8859_1 = Charset.forName(ISO_8859_1); /** * UTF-8 */ public static final Charset CHARSET_UTF_8 = Charset.forName(UTF_8); /** * GBK */ public static final Charset CHARSET_GBK = Charset.forName(GBK); /** * 转换为Charset对象 * * @param charset 字符集,为空则返回默认字符集 * @return Charset */ public static Charset charset(String charset) { return StringUtils.isEmpty(charset) ? Charset.defaultCharset() : Charset.forName(charset); } /** * 转换字符串的字符集编码 * * @param source 字符串 * @param srcCharset 源字符集,默认ISO-8859-1 * @param destCharset 目标字符集,默认UTF-8 * @return 转换后的字符集 */ public static String convert(String source, String srcCharset, String destCharset) { return convert(source, Charset.forName(srcCharset), Charset.forName(destCharset)); } /** * 转换字符串的字符集编码 * * @param source 字符串 * @param srcCharset 源字符集,默认ISO-8859-1 * @param destCharset 目标字符集,默认UTF-8 * @return 转换后的字符集 */ public static String convert(String source, Charset srcCharset, Charset destCharset) { if (null == srcCharset) { srcCharset = StandardCharsets.ISO_8859_1; } if (null == destCharset) { srcCharset = StandardCharsets.UTF_8; } if (StringUtils.isEmpty(source) || srcCharset.equals(destCharset)) { return source; } return new String(source.getBytes(srcCharset), destCharset); } /** * @return 系统字符集编码 */ public static String systemCharset() { return Charset.defaultCharset().name(); } }
[ "mr.djun@qq.com" ]
mr.djun@qq.com
ad7a3a5ac5a7bdd3a04cddd5c5a0ac6ee593f8fa
2f46c0c299c9cccd5fdac5ba2812b302f0ab17e8
/core/modules/boot/src/main/java/org/onetwo/boot/core/jwt/JwtMvcInterceptor.java
e48776d380274bfbcec6495d153df237c3476569
[ "Apache-2.0" ]
permissive
masan/onetwo
38e296df44baf0bc9650728d3be9444990a03be0
a5358a27a5800d8a8d84f37922577391483edb2c
refs/heads/master
2020-03-16T00:21:56.526114
2018-04-16T09:23:36
2018-04-16T09:23:36
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,053
java
package org.onetwo.boot.core.jwt; import java.util.Optional; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.onetwo.boot.core.web.mvc.interceptor.MvcInterceptorAdapter; import org.onetwo.common.exception.ServiceException; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.method.HandlerMethod; /** * @author wayshall * <br/> */ public class JwtMvcInterceptor extends MvcInterceptorAdapter { private String authHeaderName = JwtUtils.DEFAULT_HEADER_KEY; @Autowired private JwtTokenService jwtTokenService; @Override public boolean preHandle(HttpServletRequest request, HttpServletResponse response, HandlerMethod handler) { Optional<JwtUserDetail> userOpt = JwtUtils.getOrSetJwtUserDetail(request, jwtTokenService, authHeaderName); if(!userOpt.isPresent()){ throw new ServiceException(JwtErrors.CM_NOT_LOGIN); } return true; } public void setAuthHeaderName(String authHeaderName) { this.authHeaderName = authHeaderName; } }
[ "weishao.zeng@gmail.com" ]
weishao.zeng@gmail.com
ccc43ee6407b82b924a07f133683c0cf6fb1984a
c5b931b9cbfa3dbbfe519ff46da8a00bf6710494
/src/main/java/com/github/alexthe666/iceandfire/inventory/SyncedFieldContainer.java
04d4d792d303fee580e7cb7828383f535b93e13c
[]
no_license
ETStareak/Ice_and_Fire
4df690c161036188f25a39711759fa03f9543958
31dcce21f06763fee7e33683a631f0a133f67130
refs/heads/1.8.4-1.12.2
2023-03-17T01:05:31.176702
2022-02-21T17:34:49
2022-02-21T17:34:49
260,837,962
1
0
null
2020-05-15T16:25:56
2020-05-03T05:54:48
Java
UTF-8
Java
false
false
2,442
java
package com.github.alexthe666.iceandfire.inventory; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.Container; import net.minecraft.inventory.IContainerListener; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; public abstract class SyncedFieldContainer extends Container { private final int[] fields; private final IInventory inventory; public SyncedFieldContainer(IInventory inventory) { this.inventory = inventory; this.fields = new int[inventory.getFieldCount()]; } @Override public void detectAndSendChanges() { super.detectAndSendChanges(); for (IContainerListener listener : this.listeners) { for (int fieldIndex = 0; fieldIndex < this.fields.length; fieldIndex++) { int field = this.inventory.getField(fieldIndex); if (field != this.fields[fieldIndex]) { listener.sendWindowProperty(this, fieldIndex, field); } } } for (int fieldIndex = 0; fieldIndex < this.fields.length; fieldIndex++) { this.fields[fieldIndex] = this.inventory.getField(fieldIndex); } } @Override @SideOnly(Side.CLIENT) public void updateProgressBar(int id, int data) { this.inventory.setField(id, data); } @Override public ItemStack transferStackInSlot(EntityPlayer player, int slotIndex) { ItemStack transferred = ItemStack.EMPTY; Slot slot = this.inventorySlots.get(slotIndex); int otherSlots = this.inventorySlots.size() - 36; if (slot != null && slot.getHasStack()) { ItemStack current = slot.getStack(); transferred = current.copy(); if (slotIndex < otherSlots) { if (!this.mergeItemStack(current, otherSlots, this.inventorySlots.size(), true)) { return ItemStack.EMPTY; } } else if (!this.mergeItemStack(current, 0, otherSlots, false)) { return ItemStack.EMPTY; } if (current.getCount() == 0) { slot.putStack(ItemStack.EMPTY); } else { slot.onSlotChanged(); } } return transferred; } }
[ "alex.rowlands@cox.net" ]
alex.rowlands@cox.net
64e4b0e25d2d07fd1e2cf4fad1af6b571b2c16c4
4e8fbbe30f17a92e8101f2c43d77a4dd0c951f8f
/web入门/2.javaweb基础入门/5.web实现登录注册功能/源码/reg_login/src/hn/bean/User.java
3f9167c0a8fe8c5a141383bbc9107d953af2dc56
[]
no_license
ARainyNight/TheRoadOfBaldness
d75b9c8934807ebdd26125bf72d7b6d78c6177f6
225c70090fbe6281551f9879f3ab13f56eea5138
refs/heads/master
2021-07-05T12:55:11.171062
2019-04-16T04:18:11
2019-04-16T04:18:11
148,400,416
2
0
null
null
null
null
UTF-8
Java
false
false
1,435
java
package hn.bean; public class User { private String username ; private String password; private String nickname; private String sex; private String hobby ; private String path ; public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public String getNickname() { return nickname; } public void setNickname(String nickname) { this.nickname = nickname; } public String getSex() { return sex; } public void setSex(String sex) { this.sex = sex; } public String getHobby() { return hobby; } public void setHobby(String hobby) { this.hobby = hobby; } public String getPath() { return path; } public void setPath(String path) { this.path = path; } @Override public String toString() { return "User{" + "username='" + username + '\'' + ", password='" + password + '\'' + ", nickname='" + nickname + '\'' + ", sex='" + sex + '\'' + ", hobby='" + hobby + '\'' + ", path='" + path + '\'' + '}'; } }
[ "18234168426@163.com" ]
18234168426@163.com
62f9f9d78b7b0b1e99cd1e55cc957af6b500e7b6
43eb759f66530923dfe1c6e191ec4f350c097bd9
/projects/opengrok/opengrok-indexer/src/test/java/org/opengrok/indexer/analysis/lua/LuaXrefTest.java
df0495249c7aecbfe674e00f615132765a958ca2
[ "MIT", "LicenseRef-scancode-proprietary-license", "CDDL-1.0", "LicenseRef-scancode-warranty-disclaimer", "EPL-1.0", "LicenseRef-scancode-unknown-license-reference", "BSD-3-Clause", "ISC", "LicenseRef-scancode-other-permissive", "BSD-2-Clause", "Apache-2.0", "GPL-1.0-or-later", "ICU", "AdaCore-doc", "Ruby", "LicenseRef-scancode-public-domain" ]
permissive
hayasam/lightweight-effectiveness
fe4bd04f8816c6554e35c8c9fc8489c11fc8ce0b
f6ef4c98b8f572a86e42252686995b771e655f80
refs/heads/master
2023-08-17T01:51:46.351933
2020-09-03T07:38:35
2020-09-03T07:38:35
298,672,257
0
0
MIT
2023-09-08T15:33:03
2020-09-25T20:23:43
null
UTF-8
Java
false
false
4,816
java
/* * CDDL HEADER START * * The contents of this file are subject to the terms of the * Common Development and Distribution License (the "License"). * You may not use this file except in compliance with the License. * * See LICENSE.txt included in this distribution for the specific * language governing permissions and limitations under the License. * * When distributing Covered Code, include this CDDL HEADER in each * file and include the License file at LICENSE.txt. * If applicable, add the following below this CDDL HEADER, with the * fields enclosed by brackets "[]" replaced with your own identifying * information: Portions Copyright [yyyy] [name of copyright owner] * * CDDL HEADER END */ /* * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved. * Portions Copyright (c) 2017, Chris Fraire <cfraire@me.com>. */ package org.opengrok.indexer.analysis.lua; import java.io.BufferedReader; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.PrintStream; import java.io.StringWriter; import java.io.Writer; import org.opengrok.indexer.analysis.CtagsReader; import org.opengrok.indexer.analysis.Definitions; import org.opengrok.indexer.analysis.FileAnalyzer; import org.opengrok.indexer.analysis.WriteXrefArgs; import org.junit.Test; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import org.opengrok.indexer.analysis.Xrefer; import static org.opengrok.indexer.util.CustomAssertions.assertLinesEqual; import static org.opengrok.indexer.util.StreamUtils.copyStream; /** * Tests the {@link LuaXref} class. */ public class LuaXrefTest { @Test public void sampleTest() throws IOException { writeAndCompare("analysis/lua/sample.lua", "analysis/lua/sample_xref.html", getTagsDefinitions(), 108); } @Test public void shouldCloseTruncatedStringSpan() throws IOException { writeAndCompare("analysis/lua/truncated.lua", "analysis/lua/truncated_xref.html", null, 1); } private void writeAndCompare(String sourceResource, String resultResource, Definitions defs, int expLOC) throws IOException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); InputStream res = getClass().getClassLoader().getResourceAsStream( sourceResource); assertNotNull(sourceResource + " should get-as-stream", res); int actLOC = writeLuaXref(new PrintStream(baos), res, defs); res.close(); InputStream exp = getClass().getClassLoader().getResourceAsStream( resultResource); assertNotNull(resultResource + " should get-as-stream", exp); byte[] expbytes = copyStream(exp); exp.close(); baos.close(); String ostr = new String(baos.toByteArray(), "UTF-8"); String gotten[] = ostr.split("\n"); String estr = new String(expbytes, "UTF-8"); String expected[] = estr.split("\n"); assertLinesEqual("lua xref", expected, gotten); assertEquals("lua LOC", expLOC, actLOC); } private int writeLuaXref(PrintStream oss, InputStream iss, Definitions defs) throws IOException { oss.print(getHtmlBegin()); Writer sw = new StringWriter(); LuaAnalyzerFactory fac = new LuaAnalyzerFactory(); FileAnalyzer analyzer = fac.getAnalyzer(); analyzer.setScopesEnabled(true); analyzer.setFoldingEnabled(true); WriteXrefArgs wargs = new WriteXrefArgs( new InputStreamReader(iss, "UTF-8"), sw); wargs.setDefs(defs); Xrefer xref = analyzer.writeXref(wargs); oss.print(sw.toString()); oss.print(getHtmlEnd()); return xref.getLOC(); } private Definitions getTagsDefinitions() throws IOException { InputStream res = getClass().getClassLoader().getResourceAsStream( "analysis/lua/sampletags"); assertNotNull("though sampletags luaould stream,", res); BufferedReader in = new BufferedReader(new InputStreamReader( res, "UTF-8")); CtagsReader rdr = new CtagsReader(); String line; while ((line = in.readLine()) != null) { rdr.readLine(line); } return rdr.getDefinitions(); } private static String getHtmlBegin() { return "<!DOCTYPE html>\n" + "<html lang=\"en\">\n" + "<head>\n" + "<meta charset=\"UTF-8\">\n" + "<title>sampleFile - OpenGrok cross reference" + " for /sampleFile</title></head><body>\n"; } private static String getHtmlEnd() { return "</body>\n" + "</html>\n"; } }
[ "granogiovanni90@gmail.com" ]
granogiovanni90@gmail.com
febee05d8429d4a71c617a0edc8d44be6809bfe7
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/2/2_0491adbc1ea49d0f34a5edc83f1c0325760b8257/ForumReplies/2_0491adbc1ea49d0f34a5edc83f1c0325760b8257_ForumReplies_s.java
b33a0d57ee7a51f06178d287fcc30dce50aeeed3
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
6,288
java
package cz.kinst.jakub.coursemanager; import java.util.ArrayList; import java.util.List; import org.apache.http.NameValuePair; import org.apache.http.message.BasicNameValuePair; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import android.app.AlertDialog; import android.app.Dialog; import android.content.Context; import android.content.DialogInterface; import android.os.AsyncTask; import android.os.Bundle; import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; import android.widget.ArrayAdapter; import android.widget.EditText; import android.widget.ListView; import android.widget.TextView; public class ForumReplies extends CMActivity { /** * UID for serialization */ private static final long serialVersionUID = 3605505635167753669L; private static final int DIALOG_REPLY = 0; private int tid; public int MENU_REPLY; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); this.tid = getIntent().getExtras().getInt("tid"); setContentView(R.layout.forum_replies); reload(); } @Override protected Dialog onCreateDialog(int id) { Dialog dialog; switch (id) { case DIALOG_REPLY: LayoutInflater factory = LayoutInflater.from(this); final View v = factory.inflate(R.layout.dialog_new_reply, null); final EditText inputContent = (EditText) v .findViewById(R.id.content); AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setMessage(R.string.reply) .setView(v) .setCancelable(false) .setPositiveButton(R.string.post, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int id) { addReply(inputContent.getText().toString()); inputContent.setText(""); } }) .setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); dialog = builder.create(); break; default: dialog = null; } return dialog; } protected void addReply(String content) { final ArrayList<NameValuePair> postArgs = new ArrayList<NameValuePair>(); postArgs.add(new BasicNameValuePair("content", content)); final ArrayList<NameValuePair> getArgs = new ArrayList<NameValuePair>(); getArgs.add(new BasicNameValuePair("tid", String.valueOf(tid))); // post topic in safe thread new AsyncTask<Void, Void, Void>() { @Override protected void onPreExecute() { setProgressBarIndeterminateVisibility(true); }; @Override protected Void doInBackground(Void... params) { courseManagerCon.sendForm("forum", "show-topic", "addReply", getArgs, postArgs); return null; } @Override protected void onPostExecute(Void result) { setProgressBarIndeterminateVisibility(false); courseManagerCon.toastFlashes(); reload(); }; }.execute(); } @Override protected JSONObject reloadWork() throws JSONException { JSONObject forum = new JSONObject(); ArrayList<NameValuePair> args = new ArrayList<NameValuePair>(); args.add(new BasicNameValuePair("tid", String.valueOf(this.tid))); args.add(new BasicNameValuePair("pages-page", String.valueOf(this.page))); forum = courseManagerCon.getAction("forum", "show-topic", args, new ArrayList<NameValuePair>()); return forum; } @Override public boolean onCreateOptionsMenu(Menu menu) { boolean result = super.onCreateOptionsMenu(menu); MenuItem newComment = menu.add(R.string.new_topic); this.MENU_REPLY = newComment.getItemId(); newComment.setIcon(android.R.drawable.ic_menu_edit); if (Integer.valueOf(android.os.Build.VERSION.SDK) >= 11) { newComment.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS); } return result; } @Override public boolean onMenuItemSelected(int featureId, MenuItem item) { if (item.getItemId() == MENU_REPLY) { showDialog(DIALOG_REPLY); return true; } else { return super.onMenuItemSelected(featureId, item); } } @Override public void gotData(JSONObject data) throws JSONException { setPaginator(data); ArrayList<JSONObject> replies = new ArrayList<JSONObject>(); JSONArray resourcesJSON = data.getJSONArray("replies"); for (int i = 0; i < resourcesJSON.length(); i++) { replies.add(resourcesJSON.getJSONObject(i)); } JSONObject topic = data.getJSONObject("topic"); JSONObject author = topic.getJSONObject("author"); ((TextView) (findViewById(R.id.topicAuthor))).setText(author .getString("firstname") + " " + author.getString("lastname")); ((TextView) (findViewById(R.id.topicDate))).setText(topic .getString("created")); ((TextView) (findViewById(R.id.topicContent))).setText(topic .getString("content")); ((ListView) (findViewById(R.id.replies))) .setAdapter(new RepliesAdapter(this, android.R.layout.simple_list_item_1, replies)); } public class RepliesAdapter extends ArrayAdapter<JSONObject> { public RepliesAdapter(Context context, int textViewResourceId, List<JSONObject> objects) { super(context, textViewResourceId, objects); } @Override public View getView(int position, View convertView, ViewGroup parent) { View v = convertView; if (v == null) { LayoutInflater vi = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE); v = vi.inflate(R.layout.forum_reply_row, null); } final JSONObject reply = getItem(position); try { JSONObject author = reply.getJSONObject("author"); ((TextView) (v.findViewById(R.id.content))).setText(reply .getString("content")); ((TextView) (v.findViewById(R.id.added))).setText(reply .getString("created")); ((TextView) (v.findViewById(R.id.author))).setText(author .getString("firstname") + " " + author.getString("lastname")); } catch (JSONException e) { e.printStackTrace(); } return v; } } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
79703a1343578faf2b69d9eab0b1b694525e38b2
9297538fd435fd24a252ad25c5358386216f3839
/src/main/java/com/github/alexthe666/rats/server/world/structure/RatlantisRuinsStructure.java
77bbef2012895b0bee0776ce1831231dc52e9aaf
[]
no_license
Rusettsten/Rats
41c18e6d0bf182b2ed3d1a2d8fd65efb7f55d329
bbf2fc103d7dc8e250dd53c6972f56ca9aec0426
refs/heads/1.16.1
2023-01-27T13:06:16.809147
2020-09-22T18:03:44
2020-09-22T18:03:44
319,161,554
0
0
null
2020-12-07T00:24:41
2020-12-07T00:24:40
null
UTF-8
Java
false
false
2,042
java
package com.github.alexthe666.rats.server.world.structure; import com.github.alexthe666.rats.RatsMod; import com.mojang.serialization.Codec; import net.minecraft.util.Rotation; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.MutableBoundingBox; import net.minecraft.world.biome.Biome; import net.minecraft.world.gen.ChunkGenerator; import net.minecraft.world.gen.GenerationStage; import net.minecraft.world.gen.feature.IFeatureConfig; import net.minecraft.world.gen.feature.NoFeatureConfig; import net.minecraft.world.gen.feature.structure.Structure; import net.minecraft.world.gen.feature.structure.StructureStart; import net.minecraft.world.gen.feature.template.TemplateManager; public class RatlantisRuinsStructure extends Structure<NoFeatureConfig> { public RatlantisRuinsStructure(Codec<NoFeatureConfig> p_i231997_1_) { super(p_i231997_1_); this.setRegistryName("rats:ratlantis_ruins_structure"); } public GenerationStage.Decoration func_236396_f_() { return GenerationStage.Decoration.SURFACE_STRUCTURES; } public Structure.IStartFactory getStartFactory() { return RatlantisRuinsStructure.Start::new; } public static class Start extends StructureStart { public Start(Structure<?> p_i225817_1_, int p_i225817_2_, int p_i225817_3_, MutableBoundingBox p_i225817_4_, int p_i225817_5_, long p_i225817_6_) { super(p_i225817_1_, p_i225817_2_, p_i225817_3_, p_i225817_4_, p_i225817_5_, p_i225817_6_); } public void func_230364_a_(ChunkGenerator p_230364_1_, TemplateManager templateManagerIn, int chunkX, int chunkZ, Biome p_230364_5_, IFeatureConfig p_230364_6_) { Rotation rotation = Rotation.values()[this.rand.nextInt(Rotation.values().length)]; BlockPos blockpos = new BlockPos(chunkX * 16, 64, chunkZ * 16); RatlantisRuinsPiece.func_204760_a(templateManagerIn, blockpos, rotation, this.components, this.rand); this.recalculateStructureSize(); } } }
[ "alex.rowlands@cox.net" ]
alex.rowlands@cox.net
ec1e4643f81b606464984256b5df25ebb99c4b80
f551156ea724c509395e20884df570461381653a
/src/main/java/com/jfly/common/exception/BDExceptionHandler.java
18400fbc12a12d290bf4dc0477456df46d5ff049
[]
no_license
surick/jfly
b212999aada9a6eac2954919b1b0597364eaa199
a3d23a57c111f1a94bf4e71c36979ab1b35b0fdf
refs/heads/master
2021-01-25T13:35:43.132098
2019-03-31T14:19:06
2019-03-31T14:19:06
123,590,423
2
0
null
null
null
null
UTF-8
Java
false
false
3,133
java
package com.jfly.common.exception; import com.jfly.common.config.Constant; import com.jfly.common.domain.LogDO; import com.jfly.common.service.LogService; import com.jfly.common.utils.ExceptionUtils; import com.jfly.common.utils.HttpServletUtils; import com.jfly.common.utils.R; import com.jfly.common.utils.ShiroUtils; import com.jfly.system.domain.UserDO; import org.apache.shiro.authz.AuthorizationException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.dao.DuplicateKeyException; import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestControllerAdvice; import org.springframework.web.servlet.ModelAndView; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.util.Date; /** * 异常处理器 */ @RestControllerAdvice public class BDExceptionHandler { private Logger logger = LoggerFactory.getLogger(getClass()); @Autowired LogService logService; // // /** // * 自定义异常 // */ // @ExceptionHandler(BDException.class) // public R handleBDException(BDException e) { // logger.error(e.getMessage(), e); // R r = new R(); // r.put("code", e.getCode()); // r.put("msg", e.getMessage()); // return r; // } // // @ExceptionHandler(DuplicateKeyException.class) // public R handleDuplicateKeyException(DuplicateKeyException e) { // logger.error(e.getMessage(), e); // return R.error("数据库中已存在该记录"); // } // // @ExceptionHandler(org.springframework.web.servlet.NoHandlerFoundException.class) // public R noHandlerFoundException(org.springframework.web.servlet.NoHandlerFoundException e) { // logger.error(e.getMessage(), e); // return R.error(404, "没找找到页面"); // } @ExceptionHandler(AuthorizationException.class) public Object handleAuthorizationException(AuthorizationException e, HttpServletRequest request) { logger.error(e.getMessage(), e); if (HttpServletUtils.jsAjax(request)) { return R.error(403, "未授权"); } return new ModelAndView("error/403"); } @ExceptionHandler({Exception.class}) public Object handleException(Exception e, HttpServletRequest request) { LogDO logDO = new LogDO(); logDO.setGmtCreate(new Date()); logDO.setOperation(Constant.LOG_ERROR); logDO.setMethod(request.getRequestURL().toString()); logDO.setParams(e.toString()); UserDO current = ShiroUtils.getUser(); if(null!=current){ logDO.setUserId(current.getUserId()); logDO.setUsername(current.getUsername()); } logService.save(logDO); logger.error(e.getMessage(), e); if (HttpServletUtils.jsAjax(request)) { return R.error(500, "服务器错误,请联系管理员"); } return new ModelAndView("error/500"); } }
[ "jk103@qq.com" ]
jk103@qq.com
082e332624d3b5e492583de6c24817d628e1fb6d
5b2c309c903625b14991568c442eb3a889762c71
/classes/com/tencent/bugly/proguard/l.java
57fbbcb107105bbd5fb44149404ed7e0e9e48e9b
[]
no_license
iidioter/xueqiu
c71eb4bcc53480770b9abe20c180da693b2d7946
a7d8d7dfbaf9e603f72890cf861ed494099f5a80
refs/heads/master
2020-12-14T23:55:07.246659
2016-10-08T08:56:27
2016-10-08T08:56:27
null
0
0
null
null
null
null
UTF-8
Java
false
false
355
java
package com.tencent.bugly.proguard; public final class l { public long a; public String b; public long c; public int d; public String e; public String f; public long g; } /* Location: E:\apk\xueqiu2\classes-dex2jar.jar!\com\tencent\bugly\proguard\l.class * Java compiler version: 6 (50.0) * JD-Core Version: 0.7.1 */
[ "1776098770@qq.com" ]
1776098770@qq.com
ee2c2070e424a812c0ac5a6f960d83a07e3ea4f8
7511571c0075b3ade5cebce9e67d6c0d3bf71924
/src/main/java/com/github/t1/rest/fallback/InputStreamMessageBodyReader.java
a658c2133ed8f8398d7ef4a23d4ac1c52d459635
[]
no_license
t1/rest-client
1234cffd0aedd8419c7464644d560607fb4b2776
73aaa118b9c78a04fa1edfe572ca0a1b4a388dd1
refs/heads/master
2021-01-17T15:02:59.913512
2019-02-27T06:36:50
2019-02-27T06:36:50
34,102,470
0
0
null
2019-06-19T04:29:50
2015-04-17T07:21:49
Java
UTF-8
Java
false
false
1,220
java
package com.github.t1.rest.fallback; import static com.github.t1.rest.fallback.InputStreamMessageBodyReader.*; import static javax.ws.rs.core.MediaType.*; import java.io.InputStream; import java.lang.annotation.Annotation; import java.lang.reflect.Type; import javax.enterprise.inject.Alternative; import javax.ws.rs.Consumes; import javax.ws.rs.core.*; import javax.ws.rs.ext.MessageBodyReader; @Alternative @Consumes({ APPLICATION_OCTET_STREAM, APPLICATION_JAVA_ARCHIVE, WILDCARD }) public class InputStreamMessageBodyReader implements MessageBodyReader<InputStream> { public static final String APPLICATION_JAVA_ARCHIVE = "application/java-archive"; public static final MediaType APPLICATION_JAVA_ARCHIVE_TYPE = MediaType.valueOf(APPLICATION_JAVA_ARCHIVE); @Override public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) { return InputStream.class.isAssignableFrom(type); } @Override public InputStream readFrom(Class<InputStream> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, String> httpHeaders, InputStream entityStream) { return entityStream; } }
[ "snackbox@sinntr.eu" ]
snackbox@sinntr.eu
1990a60c17550eef6f70bd50eaf75e760c7369b6
6039432df47c3de269cf6645b38e6392f421abf6
/spring-by-example/modules/sbe-rest/sbe-rest-core/src/main/java/org/springbyexample/mvc/bind/annotation/RestResource.java
a74d6c2273fb597c0f411bbce85b0f8806e24902
[ "Apache-2.0" ]
permissive
selvarajas/desingpattern
a61afdca3498f494be1b3943403b92ee1a3cb35e
ad71bba4faeb92cbdc7162f2d251009a4d114e08
refs/heads/master
2021-01-19T04:20:32.905520
2016-06-21T11:00:36
2016-06-21T11:00:36
60,693,311
1
0
null
null
null
null
UTF-8
Java
false
false
1,717
java
/* * Copyright 2007-2013 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.springbyexample.mvc.bind.annotation; import java.lang.annotation.Documented; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Annotate a REST resource with this to have interface's elibile methods exported. * * @author David Winterfeldt */ @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) @Documented public @interface RestResource { /** * Whether or not the resource is exported. * Defaults to <code>true</code>. */ boolean export() default true; /** * Whether or not the resource is exported as a client. * Defaults to <code>true</code>. */ boolean exportClient() default true; /** * Service class to delegate requests. */ Class<?> service(); /** * Optional value for path prefix, primarily intended for inherited methods. */ String path(); /** * Optional value to define a response for HTTP posts. */ Class<?> responseClass(); }
[ "selvaraja.savarimuthu@gmail.com" ]
selvaraja.savarimuthu@gmail.com
9ab0f3949db1efc396e300e905fb463f870cdfc4
7be42d710336dbc88b4d85c9f6e5677ce753f458
/src/main/java/com/orientechnologies/ldbc/snb/benchmark/loader/loaders/AbstractPartitionedLoader.java
f57af7ff2b06f08812cffd25b422927cd7fc3634
[]
no_license
laa/orientdb_ldbc_snb_implementation
20d9a944742a4d42561c0fd3f1c6c2d06b04a8da
1c94303bf5d9d0f3738a384e0c82fadfc5daea29
refs/heads/master
2020-03-18T14:06:51.608422
2019-12-04T13:23:14
2019-12-04T13:23:14
134,830,264
0
1
null
2019-12-04T13:23:15
2018-05-25T08:51:25
Java
UTF-8
Java
false
false
4,375
java
package com.orientechnologies.ldbc.snb.benchmark.loader.loaders; import com.orientechnologies.ldbc.snb.benchmark.loader.dto.AbstractDTO; import com.orientechnologies.ldbc.snb.benchmark.loader.utils.DateUtils; import com.orientechnologies.orient.core.db.ODatabasePool; import org.apache.commons.csv.CSVFormat; import org.apache.commons.csv.CSVParser; import org.apache.commons.csv.CSVRecord; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.nio.file.Files; import java.nio.file.Path; import java.util.ArrayList; import java.util.List; import java.util.Timer; import java.util.concurrent.ArrayBlockingQueue; import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; import java.util.concurrent.Future; import java.util.concurrent.atomic.AtomicLong; public abstract class AbstractPartitionedLoader<D extends AbstractDTO> extends AbstractLoader<D> { AbstractPartitionedLoader(Path dataDir, String filePattern, int loadNumber, int totalAmountOfLoads) { super(dataDir, filePattern, loadNumber, totalAmountOfLoads); } @Override public long[] loadData(ODatabasePool pool, ExecutorService executor) throws IOException, ExecutionException, InterruptedException { final int numThreads = 8; @SuppressWarnings("unchecked") final ArrayBlockingQueue<D>[] dataQueues = new ArrayBlockingQueue[numThreads]; final List<Future<Void>> futures = new ArrayList<>(); final String loaderName = this.getClass().getSimpleName(); System.out.printf("%tc : %d out of %d : Start loading of data from '%s' files from directory %s using %s.\n", System.currentTimeMillis(), loadNumber, totalAmountOfLoads, filePattern, dataDir, loaderName); final AtomicLong operationsCounter = new AtomicLong(); for (int i = 0; i < numThreads; i++) { final ArrayBlockingQueue<D> dataQueue = new ArrayBlockingQueue<>(1024); futures.add(executor.submit(createNewTask(dataQueue, pool, operationsCounter))); dataQueues[i] = dataQueue; } final Timer statusTimer = startStatusTimer(operationsCounter, loaderName); final long start = System.nanoTime(); Files.list(dataDir).filter((path) -> path.getFileName().toString().matches(filePattern)). forEach(path -> { try { try (InputStream is = Files.newInputStream(path)) { try (InputStreamReader isr = new InputStreamReader(is)) { try (BufferedReader br = new BufferedReader(isr, 100 * 1024 * 1024)) { br.readLine(); //skip header try (CSVParser csvParser = new CSVParser(br, CSVFormat.DEFAULT.withDelimiter('|'))) { for (CSVRecord csvRecord : csvParser) { final D dataRecord = parseCSVRecord(csvRecord); final int queueIndex = (int) (dataRecord.id & 7); final ArrayBlockingQueue<D> dataQueue = dataQueues[queueIndex]; dataQueue.put(dataRecord); } } } } } final D stopRecord = createStopRecord(); for (ArrayBlockingQueue<D> dataQueue : dataQueues) { dataQueue.put(stopRecord); } } catch (IOException | InterruptedException e) { throw new IllegalStateException(e); } }); for (Future<Void> future : futures) { future.get(); } final long end = System.nanoTime(); stopStatusTimer(statusTimer); final long timePassed = end - start; final long operations = operationsCounter.get(); final int[] passedTime = DateUtils.convertIntervalInHoursMinSec(timePassed); final long timePerOperation = timePassed / operations; final long throughput = DateUtils.NANOS_IN_SECONDS / timePerOperation; final long operationTimeMks = timePerOperation / 1_000; System.out.printf("%tc : %s : %d out of %d : Loading is completed in %d h. %d m. %d s. Avg operation time %d us." + " Throughput %d op/s. Total operations %d.\n", System.currentTimeMillis(), loaderName, loadNumber, totalAmountOfLoads, passedTime[0], passedTime[1], passedTime[2], operationTimeMks, throughput, operations); return new long[] { throughput, operations }; } }
[ "lomakin.andrey@gmail.com" ]
lomakin.andrey@gmail.com
ccf6784e15e0b4aa9ca442870abe02dc4fd619cc
92b8d8f6274941543cf41c19bc40d0a41be44fe6
/gnu/kawa/models/Display.java
a078fa0b9b34de957cf438aad4e35482d63fe6ca
[ "MIT" ]
permissive
spurious/kawa-mirror
02a869242ae6a4379a3298f10a7a8e610cf78529
6abc1995da0a01f724b823a64c846088059cd82a
refs/heads/master
2020-04-04T06:23:40.471010
2017-01-16T16:54:58
2017-01-16T16:54:58
51,633,398
6
0
null
null
null
null
UTF-8
Java
false
false
2,806
java
package gnu.kawa.models; import java.awt.Dimension; import java.awt.geom.Dimension2D; import gnu.mapping.ThreadLocation; /** An abstract "display device". * In the AWT/Swing world, this may bundle a GraphicsConfiguration * and a Toolkit. * In the web servlet world, this may correspond to a browser on * on the other end of an http connection. */ public abstract class Display { public static ThreadLocation myDisplay = new ThreadLocation("my-display"); public static Display getInstance () { Object d = myDisplay.get(null); if (d instanceof Display) return (Display) d; String name = d == null ? "swing" : d.toString(); Class[] noClasses = new Class[0]; for (;;) { int comma = name.indexOf(','); String rest = null; if (comma >= 0) { rest = name.substring(comma+1); name = name.substring(0, comma); } if (name.equals("swing")) name = "gnu.kawa.swingviews.SwingDisplay"; else if (name.equals("swt")) name = "gnu.kawa.swtviews.SwtDisplay"; else if (name.equals("echo2")) name = "gnu.kawa.echo2.Echo2Display"; try { Class clas = Class.forName(name); java.lang.reflect.Method method = clas.getDeclaredMethod("getInstance", noClasses); return (Display) method.invoke(null, new Object[0]); } catch (ClassNotFoundException ex) { if (rest == null) throw new RuntimeException("no display toolkit: "+d); name = rest; } catch (Exception ex) { throw gnu.mapping.WrappedException.wrapIfNeeded(ex); } } } public abstract Window makeWindow (); public abstract void addButton (Button model, Object where); public abstract void addLabel (Label model, Object where); public abstract void addImage (DrawImage model, Object where); public void addText (Text model, Object where) { throw new Error("makeView called on Text"); } public void addSpacer (Spacer model, Object where) { throw new Error("makeView called on Spacer"); } public abstract void addBox (Box model, Object where); public abstract void addView (Object view, Object where); public static Dimension asDimension (Dimension2D dim) { if (dim instanceof Dimension || dim == null) return (Dimension) dim; else return new Dimension((int) (dim.getWidth() + 0.5), (int) (dim.getHeight() + 0.5)); } public Model coerceToModel (Object component) { if (component instanceof gnu.lists.FString || component instanceof String) return new Label(component.toString()); return (Model) component; } }
[ "bothner@5e0a886f-7f45-49c5-bc19-40643649e37f" ]
bothner@5e0a886f-7f45-49c5-bc19-40643649e37f
ee619bb516e5e1f7cc2fc0ce3fdf7feeab56f941
323c723bdbdc9bdf5053dd27a11b1976603609f5
/nssicc/nssicc_dao/src/main/java/biz/belcorp/ssicc/dao/spusicc/cuentacorriente/MantenimientoCCCDigitacionExternaPagosBancariosDAO.java
7097e0b28a040ed5e1a86b5d29c490ad235e817f
[]
no_license
cbazalar/PROYECTOS_PROPIOS
adb0d579639fb72ec7871334163d3fef00123a1c
3ba232d1f775afd07b13c8246d0a8ac892e93167
refs/heads/master
2021-01-11T03:38:06.084970
2016-10-24T01:33:00
2016-10-24T01:33:00
71,429,267
0
0
null
null
null
null
UTF-8
Java
false
false
607
java
/** * */ package biz.belcorp.ssicc.dao.spusicc.cuentacorriente; import java.util.Map; import biz.belcorp.ssicc.dao.framework.DAO; import biz.belcorp.ssicc.dao.spusicc.cuentacorriente.model.PagoBancarioExterno; /** * @author pejflorencio * */ public interface MantenimientoCCCDigitacionExternaPagosBancariosDAO extends DAO { /** * * @param criteria * Inserta el Pago Bancario Externo */ public void insertarPagoBancarioExterno(PagoBancarioExterno estructura); /** * * @param criteria * Registra el Lote Bancario */ public void generarLoteBancarioExterno(Map criteria); }
[ "cbazalarlarosa@gmail.com" ]
cbazalarlarosa@gmail.com
45e98aef8959ea68fdbd25d60f32c7b0fb060b7f
53d677a55e4ece8883526738f1c9d00fa6560ff7
/com/bumptech/glide/c/a/a/c.java
ab569568f196e8e4b980f04ce41a054710f8b78e
[]
no_license
0jinxing/wechat-apk-source
544c2d79bfc10261eb36389c1edfdf553d8f312a
f75eefd87e9b9ecf2f76fc6d48dbba8e24afcf3d
refs/heads/master
2020-06-07T20:06:03.580028
2019-06-21T09:17:26
2019-06-21T09:17:26
193,069,132
9
4
null
null
null
null
UTF-8
Java
false
false
2,572
java
package com.bumptech.glide.c.a.a; import android.content.Context; import android.net.Uri; import android.util.Log; import com.bumptech.glide.c.a; import com.bumptech.glide.c.a.d.a; import com.bumptech.glide.c.b.a.b; import com.bumptech.glide.h; import com.tencent.matrix.trace.core.AppMethodBeat; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; public final class c implements com.bumptech.glide.c.a.d<InputStream> { private final Uri azA; private final e azB; private InputStream azC; private c(Uri paramUri, e parame) { this.azA = paramUri; this.azB = parame; } public static c a(Context paramContext, Uri paramUri, d paramd) { AppMethodBeat.i(91738); b localb = com.bumptech.glide.c.ae(paramContext).awk; paramContext = new c(paramUri, new e(com.bumptech.glide.c.ae(paramContext).awj.lF(), paramd, localb, paramContext.getContentResolver())); AppMethodBeat.o(91738); return paramContext; } public final void a(com.bumptech.glide.g paramg, d.a<? super InputStream> parama) { AppMethodBeat.i(91739); try { paramg = this.azB.j(this.azA); if (paramg != null) { i = this.azB.i(this.azA); if (i != -1) { com.bumptech.glide.c.a.g localg = new com/bumptech/glide/c/a/g; localg.<init>(paramg, i); paramg = localg; this.azC = paramg; parama.S(this.azC); AppMethodBeat.o(91739); return; } } } catch (FileNotFoundException paramg) { while (true) { Log.isLoggable("MediaStoreThumbFetcher", 3); parama.b(paramg); AppMethodBeat.o(91739); continue; continue; int i = -1; } } } public final void cancel() { } public final void cleanup() { AppMethodBeat.i(91740); if (this.azC != null); while (true) { try { this.azC.close(); AppMethodBeat.o(91740); return; } catch (IOException localIOException) { } AppMethodBeat.o(91740); } } public final Class<InputStream> mg() { return InputStream.class; } public final a mh() { return a.ayD; } } /* Location: C:\Users\Lin\Downloads\dex-tools-2.1-SNAPSHOT\dex-tools-2.1-SNAPSHOT\classes2-dex2jar.jar * Qualified Name: com.bumptech.glide.c.a.a.c * JD-Core Version: 0.6.2 */
[ "172601673@qq.com" ]
172601673@qq.com
d2dd7c7a4efe3e0b75c6afdfa0f506bbc90cb907
180e78725121de49801e34de358c32cf7148b0a2
/dataset/protocol1/mapstruct/learning/1200/ObjectFactory.java
8df9311c840fb2b2c9a8825448b19feeee4a5b99
[]
no_license
ASSERT-KTH/synthetic-checkstyle-error-dataset
40e8d1e0a7ebe7f7711def96a390891a6922f7bd
40c057e1669584bfc6fecf789b5b2854660222f3
refs/heads/master
2023-03-18T12:50:55.410343
2019-01-25T09:54:39
2019-01-25T09:54:39
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,512
java
/* * Copyright MapStruct Authors. * * Licensed under the Apache License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0 */ package org.mapstruct; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * This annotation marks a method as a <em>factory method</em> to create beans. * <p> * By default beans are created during the mapping process with the default constructor. If a factory method with a * return type that is assignable to the required object type is present, then the factory method is used instead. * <p> * Factory methods can be defined without parameters, with an {@code @}{@link TargetType} parameter, a * {@code @}{@link Context} parameter, or with the mapping source parameter. If any of those parameters are defined, * then the mapping method that is supposed to use the factory method needs to be declared with an assignable result * type, assignable context parameter, and/or assignable source types. * <p> * <strong>Note:</strong> the usage of this annotation is <em>optional</em> when used in the {@link Mapper#uses()} * if no source parameters are part of the signature, i.e. it is declared without parameters or only with * {@code @}{@link TargetType} and/or {@code @}{@link Context}. It is however <em>mandatory</em> when used inside * an {@code @}{@link Context} annotated class. * <p> * <strong>Example:</strong> Using a factory method for entities to check whether the entity already exists in the * EntityManager and then returns the managed instance: * * <pre> * <code> * &#64;ApplicationScoped // CDI component model * public class ReferenceMapper { * * &#64;PersistenceContext * private EntityManager em; * * &#64;ObjectFactory * public &lt;T extends AbstractEntity&gt; T resolve(AbstractDto sourceDto, &#64;TargetType Class&lt;T&gt; type) { * T entity = em.find( type, sourceDto.getId() ); * return entity != null ? entity : type.newInstance(); * } * } * </code> * </pre> * <p> * If there are two factory methods, both serving the same type, one with no parameters and one taking sources as input, * then the one with the source parameters is favored. If there are multiple such factories, an ambiguity error is * shown. * * @author Remo Meier * @since 1.2 */ @Retention(RetentionPolicy. CLASS) @Target(ElementType.METHOD) public @interface ObjectFactory { }
[ "bloriot97@gmail.com" ]
bloriot97@gmail.com
2cf9487055a50c3c3e4aa38add51208b3279e9bc
1e004aa3d7bdfb83469e19aeb48fdeffe457f7b4
/src/LC031.java
b26aa200528b20164b05b6c79bafd3f21204bb7a
[]
no_license
Saseke/LeetCode
388ea8ecd20a4f82fb6a6f5a0d79aa6c90782f9b
36a1d875df367909dd10e831974a7ef849ff19b6
refs/heads/master
2020-03-21T18:38:30.864366
2019-07-10T11:43:52
2019-07-10T11:43:52
138,904,268
0
0
null
null
null
null
UTF-8
Java
false
false
876
java
public class LC031 { public static void main(String[] args) { int[] i = new int[]{1, 3, 2}; nextPermutation(i); } public static void nextPermutation(int[] nums) { int i = nums.length - 2; while (i >= 0 && nums[i + 1] <= nums[i]) { i--; } if (i >= 0) { int j = nums.length - 1; while (j >= 0 && nums[j] <= nums[i]) { j--; } swap(nums, i, j); } reverse(nums, i + 1); } public static void reverse(int[] nums, int start) { int i = start, j = nums.length - 1; while (i < j) { swap(nums, i, j); i++; j--; } } public static void swap(int[] nums, int i, int j) { int temp = nums[i]; nums[i] = nums[j]; nums[j] = temp; } }
[ "717964921@qq.com" ]
717964921@qq.com
4ac84cfcb4f11040e2ac7c7064021e6421a49614
43ea91f3ca050380e4c163129e92b771d7bf144a
/services/iotda/src/main/java/com/huaweicloud/sdk/iotda/v5/model/ListRoutingRulesResponse.java
688bc56572d2e46baba706dd7af8fd3962e4276a
[ "Apache-2.0" ]
permissive
wxgsdwl/huaweicloud-sdk-java-v3
660602ca08f32dc897d3770995b496a82a1cc72d
ee001d706568fdc7b852792d2e9aefeb9d13fb1e
refs/heads/master
2023-02-27T14:20:54.774327
2021-02-07T11:48:35
2021-02-07T11:48:35
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,909
java
package com.huaweicloud.sdk.iotda.v5.model; import com.huaweicloud.sdk.core.SdkResponse; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import com.huaweicloud.sdk.iotda.v5.model.RoutingRule; import java.util.ArrayList; import java.util.List; import java.util.function.Consumer; import java.util.Objects; /** * Response Object */ public class ListRoutingRulesResponse extends SdkResponse { @JsonInclude(JsonInclude.Include.NON_NULL) @JsonProperty(value="rules") private List<RoutingRule> rules = null; @JsonInclude(JsonInclude.Include.NON_NULL) @JsonProperty(value="count") private Integer count; @JsonInclude(JsonInclude.Include.NON_NULL) @JsonProperty(value="marker") private String marker; public ListRoutingRulesResponse withRules(List<RoutingRule> rules) { this.rules = rules; return this; } public ListRoutingRulesResponse addRulesItem(RoutingRule rulesItem) { if (this.rules == null) { this.rules = new ArrayList<>(); } this.rules.add(rulesItem); return this; } public ListRoutingRulesResponse withRules(Consumer<List<RoutingRule>> rulesSetter) { if(this.rules == null ){ this.rules = new ArrayList<>(); } rulesSetter.accept(this.rules); return this; } /** * 规则条件信息列表。 * @return rules */ public List<RoutingRule> getRules() { return rules; } public void setRules(List<RoutingRule> rules) { this.rules = rules; } public ListRoutingRulesResponse withCount(Integer count) { this.count = count; return this; } /** * 满足查询条件的记录总数。 * @return count */ public Integer getCount() { return count; } public void setCount(Integer count) { this.count = count; } public ListRoutingRulesResponse withMarker(String marker) { this.marker = marker; return this; } /** * 本次分页查询结果中最后一条记录的ID,可在下一次分页查询时使用。 * @return marker */ public String getMarker() { return marker; } public void setMarker(String marker) { this.marker = marker; } @Override public boolean equals(java.lang.Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } ListRoutingRulesResponse listRoutingRulesResponse = (ListRoutingRulesResponse) o; return Objects.equals(this.rules, listRoutingRulesResponse.rules) && Objects.equals(this.count, listRoutingRulesResponse.count) && Objects.equals(this.marker, listRoutingRulesResponse.marker); } @Override public int hashCode() { return Objects.hash(rules, count, marker); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ListRoutingRulesResponse {\n"); sb.append(" rules: ").append(toIndentedString(rules)).append("\n"); sb.append(" count: ").append(toIndentedString(count)).append("\n"); sb.append(" marker: ").append(toIndentedString(marker)).append("\n"); sb.append("}"); return sb.toString(); } /** * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } }
[ "hwcloudsdk@huawei.com" ]
hwcloudsdk@huawei.com
564b071c2b3c7d6d9a3fbfc843c68adeab3cc294
308b3f320c5bc53091725dfa40460505ab7b5555
/DisplayLists/src/main/java/org/softwareFm/displayLists/NameAndValueDialog.java
966e807b19793c56f216dfb238d043b1e9220eaa
[]
no_license
phil-rice/Arc4Eclipse
75134c3032a9d9173fef551c326686a7ca28bb8a
95948538ceac12f9793546b1ed85cd0bca8a34d0
refs/heads/master
2020-04-19T15:52:38.952070
2011-09-09T10:57:41
2011-09-09T10:57:41
2,031,297
0
0
null
null
null
null
UTF-8
Java
false
false
3,870
java
package org.softwareFm.displayLists; import org.eclipse.swt.SWT; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Dialog; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Shell; import org.softwareFm.swtBasics.Swts; import org.softwareFm.swtBasics.text.ConfigForTitleAnd; import org.softwareFm.swtBasics.text.TitleAndTextField; import org.softwareFm.utilities.functions.IFunction1; public class NameAndValueDialog extends Dialog { protected NameAndValue result; private final ConfigForTitleAnd config; private final String nameTitle; private final String valueTitle; public NameAndValueDialog(Shell parent, int style, ConfigForTitleAnd config, String nameTitle, String valueTitle) { super(parent, style); this.config = config; this.nameTitle = nameTitle; this.valueTitle = valueTitle; } public NameAndValue open(NameAndValue initial) { // Create the dialog window Shell shell = new Shell(getParent(), getStyle()); shell.setText(getText()); createContents(shell, initial); shell.pack(); shell.open(); Display display = getParent().getDisplay(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) { display.sleep(); } } // Return the entered value, or null return result; } private void createContents(final Shell shell, NameAndValue initial) { final TitleAndTextField txtName = new TitleAndTextField(config, shell, nameTitle, false); txtName.setEditable(true); final TitleAndTextField txtUrl = new TitleAndTextField(config, shell, valueTitle, false); txtUrl.setEditable(true); txtName.setText(initial.name); txtUrl.setText(initial.url); Composite buttonComposite = new Composite(shell, SWT.NULL); buttonComposite.setLayout(new GridLayout(2, false)); // Create the cancel button and addKey a handler // so that pressing it will set input to null Button cancel = new Button(buttonComposite, SWT.PUSH); cancel.setText("Cancel"); cancel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); cancel.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent event) { result = null; shell.close(); } }); Button ok = new Button(buttonComposite, SWT.PUSH); ok.setText("OK"); ok.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); ok.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent event) { result = new NameAndValue(txtName.getText(), txtUrl.getText()); shell.close(); } }); // Set the OK button as the default, so // user can type input and press Enter // to dismiss shell.setDefaultButton(ok); Swts.addGrabHorizontalAndFillGridDataToAllChildren(shell); } public static void main(String[] args) { Swts.display(NameAndValueDialog.class.getSimpleName(), new IFunction1<Composite, Composite>() { @Override public Composite apply(final Composite from) throws Exception { Composite composite = new Composite(from, SWT.NULL); composite.setLayout(new GridLayout()); Button button = new Button(composite, SWT.PUSH); button.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { NameAndValueDialog nameAndValueDialog = new NameAndValueDialog(from.getShell(), SWT.NULL, ConfigForTitleAnd.createForBasics(from.getDisplay()), "Name", "Value"); NameAndValue open = nameAndValueDialog.open(new NameAndValue("name", "url")); System.out.println("Result: " + open); } }); Swts.addGrabHorizontalAndFillGridDataToAllChildren(composite); return composite; } }); } }
[ "phil.rice@iee.org" ]
phil.rice@iee.org
37566732bcab4797d6ddf83605f73c341516517a
8d5ed637e90d24c806c5ea091cb2b877aa2a5103
/src/main/java/yyl/leetcode/p04/P0493_ReversePairs.java
2a5525fcc2d2f85a76a94e1bff6c1a395195cf2e
[ "Apache-2.0" ]
permissive
Relucent/yyl_leetcode
7cc087ca22f01fdec4189c6336fb9581c73ac3e3
ce5e713b8ab07d08502ce048a3c493cde84f6e5a
refs/heads/master
2023-03-09T12:49:28.699718
2023-03-02T07:00:46
2023-03-02T07:00:46
101,182,096
3
0
null
null
null
null
UTF-8
Java
false
false
3,639
java
package yyl.leetcode.p04; import yyl.leetcode.util.Assert; /** * <h3>翻转对</h3><br> * 给定一个数组 nums ,如果 i < j 且 nums[i] > 2*nums[j] 我们就将 (i, j) 称作一个重要翻转对。<br> * 你需要返回给定数组中的重要翻转对的数量。<br> * * <pre> * 示例 1: * 输入: [1,3,2,3,1] * 输出: 2 * * 示例 2: * 输入: [2,4,3,5,1] * 输出: 3 * </pre> * * 注意:<br> * 给定数组的长度不会超过50000。<br> * 输入数组中的所有数字都在32位整数的表示范围内。<br> */ public class P0493_ReversePairs { public static void main(String[] args) { Solution solution = new Solution(); Assert.assertEquals(2, solution.reversePairs(new int[] { 1, 3, 2, 3, 1 })); Assert.assertEquals(3, solution.reversePairs(new int[] { 2, 4, 3, 5, 1 })); } // 归并法 // 在归并排序的过程中: // 假设对于数组 nums[l..r] 而言,已经分别求出了子数组 nums[l..m] 与 nums[m+1..r] 的翻转对数目,并已将两个子数组分别排好序; // 则 nums[l..r] 中的翻转对数目,就等于两个子数组的翻转对数目之和,加上左右端点分别位于两个子数组的翻转对数目。 // 时间复杂度:O(Nlog⁡N),其中 N 为数组的长度。 // 空间复杂度:O(N),其中 N 为数组的长度。 static class Solution { public int reversePairs(int[] nums) { if (nums.length == 0) { return 0; } return reversePairsRecursive(nums, 0, nums.length - 1); } private int reversePairsRecursive(int[] nums, int left, int right) { if (left == right) { return 0; } int mid = (left + right) / 2; int n1 = reversePairsRecursive(nums, left, mid); int n2 = reversePairsRecursive(nums, mid + 1, right); int result = n1 + n2; // 首先统计下标对的数量(关键部分),两边数组都是递增的 for (int i = left, j = mid + 1; i <= mid;) { while (j <= right && (long) nums[i] > 2 * (long) nums[j]) { j++; } result += j - mid - 1; i++; } // 随后合并两个排序数组 merge(nums, left, right, mid); return result; } private void merge(int[] nums, int left, int right, int mid) { int[] sorted = new int[right - left + 1]; int i = left; int j = mid + 1; int k = 0; while (i <= mid && j <= right) { if (nums[i] < nums[j]) { sorted[k++] = nums[i++]; } else { sorted[k++] = nums[j++]; } } while (i <= mid) { sorted[k++] = nums[i++]; } while (j <= right) { sorted[k++] = nums[j++]; } System.arraycopy(sorted, 0, nums, left, right - left + 1); } } // 暴力法,遍历所有组合 // 时间复杂度:O(n^2) // 空间复杂度:O(1) static class Solution1 { public int reversePairs(int[] nums) { int answer = 0; for (int i = 0; i < nums.length; i++) { for (int j = i + 1; j < nums.length; j++) { if ((long) nums[i] > (long) nums[j] * 2) { answer++; } } } return answer; } } }
[ "relucent@163.com" ]
relucent@163.com
30fb7a1d265468566ca8efdb488ae221099bb469
380552d6601ae475b76cc1fb12295b138ba07c44
/EvsBatch48Lec18/src/designandprinciples/Singleton.java
ce53d24f4783bd7b4b45b18590ca55ee468b77a0
[]
no_license
aqib1/EvsBatch49
c248eda8cf05b1305e5fa68d13fd4d1db02cad18
6d14929b3692ea994483626d41f5f4a434921587
refs/heads/master
2023-01-20T12:23:20.556869
2020-11-29T11:20:35
2020-11-29T11:20:35
275,565,395
0
0
null
null
null
null
UTF-8
Java
false
false
245
java
package designandprinciples; public class Singleton { private static Singleton singleton; private Singleton() { } public static Singleton getSingleton() { if (singleton == null) singleton = new Singleton(); return singleton; } }
[ "aqibbutt3078@gmail.com" ]
aqibbutt3078@gmail.com
5d9e02328dd57b34020ef499c32a33b0d01767a2
48a0e5e050c172cd225928a710e3be63398ad6ab
/java-project2-server/src16_1/main/java/com/eomcs/mybatis/DaoInvocationHandler.java
42a47986f43fa99d473b3df13832bb4fc9003f03
[]
no_license
jeonminhee/bitcamp-java-2018-12
ce38011132a00580ee7b9a398ce9e47f21b1af8b
a1b5f8befc1c531baf6c238c94a44206b48f8d94
refs/heads/master
2020-04-14T04:57:57.565700
2019-05-19T06:32:27
2019-05-19T06:32:27
163,650,679
0
0
null
null
null
null
UTF-8
Java
false
false
2,494
java
package com.eomcs.mybatis; import java.lang.reflect.InvocationHandler; import java.lang.reflect.Method; import java.util.List; import org.apache.ibatis.session.SqlSession; import org.apache.ibatis.session.SqlSessionFactory; // DAO 인터페이스의 규칙에 따라 메서드가 호출될 때 실제 작업을 수행할 객체이다. public class DaoInvocationHandler implements InvocationHandler { // SQL을 실행할 때 사용할 SqlSessionFactory를 준비한다. SqlSessionFactory sqlSessionFactory; public DaoInvocationHandler(SqlSessionFactory sqlSessionFactory) { this.sqlSessionFactory = sqlSessionFactory; } @Override public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { // DAO 인터페이스의 메서드를 호출할 때 마다 이 메서드가 호출될 것이다. // 이 메서드에서 할 일은 매퍼 파일에서 적절한 SQL을 찾아 실행하는 것이다. // 1) 실행할 SQL 아이디를 준비하기 // SQL 아이디 => 인터페이스명.메서드명 // => 파라미터로 받은 프록시 객체로부터 인터페이스 이름을 알아낸다. String sqlId = String.format("%s.%s", proxy.getClass().getInterfaces()[0].getName(), method.getName()); // 2) 메서드의 리턴 타입을 알아낸다. Class<?> returnType = method.getReturnType(); // 3) SQL 문을 실행할 SqlSession 객체를 준비한다. try (SqlSession sqlSession = sqlSessionFactory.openSession()) { System.out.println(sqlId + "의 SQL을 실행한다."); // 4) 리턴 타입에 따라 적절한 SqlSession의 메서드를 호출한다. if (returnType == List.class) { if (args == null) // 파라미터가 없는 DAO의 메서드를 호출한다면, return sqlSession.selectList(sqlId); else return sqlSession.selectList(sqlId, args[0]); } else if (returnType == int.class) { if (args == null) // 파라미터가 없는 DAO의 메서드를 호출한다면, return sqlSession.update(sqlId); // update()는 insert/update/delete 모두 실행. else return sqlSession.update(sqlId, args[0]); } else { if (args == null) // 파라미터가 없는 DAO의 메서드를 호출한다면, return sqlSession.selectOne(sqlId); else return sqlSession.selectOne(sqlId, args[0]); } } } }
[ "yycel1357@naver.com" ]
yycel1357@naver.com
1bdfe6eec25f7f957faa300b65343ffde7e9818a
eb7b450eef54c7c7c43001b03a1a0a6ac27fbbd6
/SM/AS/Components2.0/src/org/components/util/Sessions.java
eb9c0e3d9c8ecd6debca6c19a080231d3aa5e665
[]
no_license
mjawath/jposible
e2feb7de7bfa80dc538639ae5ca13480f8dcc2db
b6fb1cde08dc531dd3aff1113520d106dd1a732c
refs/heads/master
2021-01-10T18:55:41.024529
2018-05-14T01:25:05
2018-05-14T01:25:05
32,131,366
0
0
null
null
null
null
UTF-8
Java
false
false
1,886
java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package org.components.util; import java.util.Collection; import java.util.HashMap; import java.util.Set; import org.biz.util.ReflectionUtility; import org.components.windows.UIController; /** * * @author mjawath */ public class Sessions { private static HashMap<String, UIController> controllerMap = new HashMap<>(); public static void addController(String key, UIController controller) { controllerMap.put(key, controller); } public static UIController getController(String key) { return controllerMap.get(key); } public static UIController getControllerOrCreateNew(String key) { UIController cont = controllerMap.get(key); if(cont==null){ cont = (UIController)ReflectionUtility.getDynamicInstance(key); cont.initUI(); } return cont; } static HashMap<String, Object> hashMap; public static Sessions sessions = new Sessions(); public static void create() { getSession(); } private Sessions() { hashMap = new HashMap<String, Object>(); } public static Sessions getSession(){ if (sessions==null) { sessions = new Sessions(); } if (hashMap==null) { hashMap = new HashMap<String, Object>(); } return sessions; } public static void addToSession(String key,Object val){ hashMap.put(key, val); } public static void remove(String key){ hashMap.remove(key); } public static Collection values(){ return hashMap.values(); } public static Set<String> keys(){ return hashMap.keySet(); } public static Object getObj(String key){ return hashMap.get(key); } }
[ "mjawath@gmail.com" ]
mjawath@gmail.com
29ef363623939fca942855700b8e0923ff67a4b6
ef8e3f488d33250d8ee9daea11cfcf90ee177c24
/src/fr/toenga/packets/actions/executors/ProcessActionDestroyExecutor.java
e549f6e249b3592caf9e4897e00b9d7ec1f13775
[]
no_license
Toenga/Toenga
4c50d388f486460890d093be6f397783090daab8
75520cb446bb16895be03646d4d079aebffbd4e2
refs/heads/master
2021-01-20T12:16:11.727019
2018-05-11T23:44:39
2018-05-11T23:44:39
101,707,742
0
0
null
2017-10-21T13:01:53
2017-08-29T02:06:18
null
UTF-8
Java
false
false
446
java
package fr.toenga.packets.actions.executors; import fr.toenga.packets.actions.ProcessActionExecutor; import fr.toenga.process.ToengaProcess; public class ProcessActionDestroyExecutor extends ProcessActionExecutor { @Override public void execute(ToengaProcess toengaProcess) { try { toengaProcess.stop(); Thread.sleep(5000); toengaProcess.start(); } catch (Exception exception) { exception.printStackTrace(); } } }
[ "xmalware2@gmail.com" ]
xmalware2@gmail.com
f08d96d58c9448b937c4a24d7844234a74dd1795
5b8337c39cea735e3817ee6f6e6e4a0115c7487c
/sources/com/mobiroller/adapters/NotificationAdapter.java
196636a5fcef4ff7808058b7be1655c21d93978a
[]
no_license
karthik990/G_Farm_Application
0a096d334b33800e7d8b4b4c850c45b8b005ccb1
53d1cc82199f23517af599f5329aa4289067f4aa
refs/heads/master
2022-12-05T06:48:10.513509
2020-08-10T14:46:48
2020-08-10T14:46:48
286,496,946
1
0
null
null
null
null
UTF-8
Java
false
false
6,538
java
package com.mobiroller.adapters; import android.content.Context; import android.graphics.Color; import android.text.format.DateFormat; import android.util.SparseBooleanArray; import android.view.LayoutInflater; import android.view.View; import android.view.View.OnClickListener; import android.view.ViewGroup; import android.widget.ImageButton; import android.widget.ImageView; import android.widget.RelativeLayout; import android.widget.TextView; import androidx.core.content.ContextCompat; import androidx.core.view.ViewCompat; import androidx.recyclerview.widget.RecyclerView.Adapter; import androidx.recyclerview.widget.RecyclerView.ViewHolder; import com.mobiroller.mobi942763453128.R; import com.mobiroller.models.NotificationModel; import java.util.ArrayList; import java.util.Calendar; import java.util.List; public class NotificationAdapter extends Adapter<NotificationViewHolder> { private Context context; private List<NotificationModel> notificationModels; private SparseBooleanArray selectedItems = new SparseBooleanArray(); class NotificationViewHolder extends ViewHolder { TextView date; ImageButton deleteButton; RelativeLayout foreground; ImageView isRead; TextView message; RelativeLayout notificationCirle; NotificationViewHolder(View view) { super(view); this.deleteButton = (ImageButton) view.findViewById(R.id.backgroundView); this.foreground = (RelativeLayout) view.findViewById(R.id.foregroundView); this.notificationCirle = (RelativeLayout) view.findViewById(R.id.notification_cirle); this.message = (TextView) view.findViewById(R.id.notification_message); this.date = (TextView) view.findViewById(R.id.notification_date); this.isRead = (ImageView) view.findViewById(R.id.notification_is_read); } } public NotificationAdapter(List<NotificationModel> list, Context context2) { this.notificationModels = list; this.context = context2; } public NotificationViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) { return new NotificationViewHolder(LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.notification_list_item, viewGroup, false)); } public void onBindViewHolder(NotificationViewHolder notificationViewHolder, int i) { NotificationModel notificationModel = (NotificationModel) this.notificationModels.get(i); notificationViewHolder.message.setText(notificationModel.getMessage()); notificationViewHolder.date.setText(getFormattedDate(notificationModel.getDate())); if (notificationModel.isRead()) { notificationViewHolder.date.setCompoundDrawablesWithIntrinsicBounds(R.drawable.forma_1, 0, 0, 0); notificationViewHolder.message.setTextColor(Color.parseColor("#838486")); notificationViewHolder.message.setTypeface(null, 0); } else { notificationViewHolder.date.setCompoundDrawablesWithIntrinsicBounds(R.drawable.forma_1_yellow, 0, 0, 0); notificationViewHolder.message.setTextColor(ViewCompat.MEASURED_STATE_MASK); notificationViewHolder.message.setTypeface(null, 1); } if (this.selectedItems.get(i, false)) { notificationViewHolder.foreground.setBackgroundColor(Color.parseColor("#FFEEB8")); notificationViewHolder.notificationCirle.setBackground(ContextCompat.getDrawable(this.context, R.drawable.notification_cirle_selected)); notificationViewHolder.isRead.setVisibility(0); } else { notificationViewHolder.foreground.setBackgroundColor(-1); notificationViewHolder.notificationCirle.setBackground(ContextCompat.getDrawable(this.context, R.drawable.notification_cirle_unselected)); notificationViewHolder.isRead.setVisibility(8); } notificationViewHolder.notificationCirle.setOnClickListener(new OnClickListener() { public void onClick(View view) { } }); } public int getItemCount() { return this.notificationModels.size(); } public void toggleSelection(int i) { if (this.selectedItems.get(i, false)) { this.selectedItems.delete(i); } else { this.selectedItems.put(i, true); } notifyDataSetChanged(); } public void clearSelections() { this.selectedItems.clear(); notifyDataSetChanged(); } public NotificationModel getItem(int i) { return (NotificationModel) this.notificationModels.get(i); } public void setRead(int i) { ((NotificationModel) this.notificationModels.get(i)).setRead(); notifyItemChanged(i); } public void removeData(int i) { this.notificationModels.remove(i); notifyItemRemoved(i); notifyItemRangeChanged(i, getItemCount()); } public int getSelectedItemCount() { return this.selectedItems.size(); } public List<Integer> getSelectedItems() { ArrayList arrayList = new ArrayList(this.selectedItems.size()); for (int i = 0; i < this.selectedItems.size(); i++) { arrayList.add(Integer.valueOf(this.selectedItems.keyAt(i))); } return arrayList; } public List<NotificationModel> getAllData() { return this.notificationModels; } private String getFormattedDate(long j) { Calendar instance = Calendar.getInstance(); instance.setTimeInMillis(j); Calendar instance2 = Calendar.getInstance(); String str = "HH:mm"; String str2 = " "; if (instance2.get(5) == instance.get(5)) { StringBuilder sb = new StringBuilder(); sb.append(this.context.getString(R.string.date_today)); sb.append(str2); sb.append(DateFormat.format(str, instance)); return sb.toString(); } else if (instance2.get(5) - instance.get(5) == 1) { StringBuilder sb2 = new StringBuilder(); sb2.append(this.context.getString(R.string.date_yesterday)); sb2.append(str2); sb2.append(DateFormat.format(str, instance)); return sb2.toString(); } else if (instance2.get(1) == instance.get(1)) { return DateFormat.format("EEEE, MMMM d, h:mm", instance).toString(); } else { return DateFormat.format("MMMM dd yyyy, h:mm", instance).toString(); } } }
[ "knag88@gmail.com" ]
knag88@gmail.com
e9cf1a8be82bb5f7c5ca06233dd00debfdd4b9b8
a95ece711810aaacfecf03ccdcafbdbc78942588
/Report/BeanSimpleExample/src/main/java/server/config/ApplicationContextConfigWithAnnotation.java
671cf1734bbfa3ef5832c05f14359db20855263b
[]
no_license
Nail-Salimov/11-802_Nail_Salimov
51043a477e105c31adbdea22da35d3f205606bb4
7088bcbf99f45042bddb57f2ac817ceb68d90e64
refs/heads/master
2022-11-24T21:05:49.561832
2020-03-17T16:11:52
2020-03-17T16:11:52
223,963,450
0
0
null
2022-11-16T12:15:26
2019-11-25T14:07:50
Java
UTF-8
Java
false
false
1,426
java
package server.config; import com.zaxxer.hikari.HikariConfig; import com.zaxxer.hikari.HikariDataSource; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.PropertySource; import org.springframework.core.env.Environment; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.stereotype.Component; import javax.sql.DataSource; @Configuration @ComponentScan(basePackages = "server") @PropertySource({"classpath:application.properties" }) public class ApplicationContextConfigWithAnnotation { @Autowired private Environment environment; @Bean public JdbcTemplate jdbcTemplate() { return new JdbcTemplate(hikariDataSource()); } @Bean public HikariConfig hikariConfig() { HikariConfig config = new HikariConfig(); config.setJdbcUrl(environment.getProperty("db.url")); config.setUsername(environment.getProperty("db.user")); config.setPassword(environment.getProperty("db.password")); config.setDriverClassName(environment.getProperty("db.driver")); return config; } @Bean public DataSource hikariDataSource() { return new HikariDataSource(hikariConfig()); } }
[ "nail0205@mail.ru" ]
nail0205@mail.ru
6c3367ca3f1b89e3fbf6527ccd2e9bb4c0110ddc
179a6b2e2048f77384498d46f9df1722d0e92e53
/kubernetes-model-generator/openshift-model-operator/src/generated/java/io/fabric8/openshift/api/model/operator/v1/StorageSpec.java
276c185db138f825ab4c375d150acb31d1665d0e
[ "Apache-2.0" ]
permissive
Fabian-K/kubernetes-client
b2ab73bd381152331f910e1b27a54c75de88fa53
ba04a46bf369f3b56f041d3bd87774e484374137
refs/heads/master
2023-03-20T03:25:51.485633
2022-11-04T15:08:55
2022-11-07T11:04:58
214,407,117
0
0
Apache-2.0
2023-03-10T12:13:32
2019-10-11T10:21:30
Java
UTF-8
Java
false
false
5,294
java
package io.fabric8.openshift.api.model.operator.v1; import java.util.HashMap; import java.util.Map; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import io.fabric8.kubernetes.api.model.Container; import io.fabric8.kubernetes.api.model.IntOrString; import io.fabric8.kubernetes.api.model.KubernetesResource; import io.fabric8.kubernetes.api.model.LabelSelector; import io.fabric8.kubernetes.api.model.LocalObjectReference; import io.fabric8.kubernetes.api.model.ObjectMeta; import io.fabric8.kubernetes.api.model.ObjectReference; import io.fabric8.kubernetes.api.model.PersistentVolumeClaim; import io.fabric8.kubernetes.api.model.PodTemplateSpec; import io.fabric8.kubernetes.api.model.ResourceRequirements; import io.sundr.builder.annotations.Buildable; import io.sundr.builder.annotations.BuildableReference; import lombok.EqualsAndHashCode; import lombok.Setter; import lombok.ToString; import lombok.experimental.Accessors; @JsonDeserialize(using = com.fasterxml.jackson.databind.JsonDeserializer.None.class) @JsonInclude(JsonInclude.Include.NON_NULL) @JsonPropertyOrder({ "apiVersion", "kind", "metadata", "logLevel", "managementState", "observedConfig", "operatorLogLevel", "unsupportedConfigOverrides" }) @ToString @EqualsAndHashCode @Setter @Accessors(prefix = { "_", "" }) @Buildable(editableEnabled = false, validationEnabled = false, generateBuilderPackage = false, lazyCollectionInitEnabled = false, builderPackage = "io.fabric8.kubernetes.api.builder", refs = { @BuildableReference(ObjectMeta.class), @BuildableReference(LabelSelector.class), @BuildableReference(Container.class), @BuildableReference(PodTemplateSpec.class), @BuildableReference(ResourceRequirements.class), @BuildableReference(IntOrString.class), @BuildableReference(ObjectReference.class), @BuildableReference(LocalObjectReference.class), @BuildableReference(PersistentVolumeClaim.class) }) public class StorageSpec implements KubernetesResource { @JsonProperty("logLevel") private String logLevel; @JsonProperty("managementState") private String managementState; @JsonProperty("observedConfig") private KubernetesResource observedConfig; @JsonProperty("operatorLogLevel") private String operatorLogLevel; @JsonProperty("unsupportedConfigOverrides") private KubernetesResource unsupportedConfigOverrides; @JsonIgnore private Map<String, Object> additionalProperties = new HashMap<String, Object>(); /** * No args constructor for use in serialization * */ public StorageSpec() { } /** * * @param logLevel * @param unsupportedConfigOverrides * @param operatorLogLevel * @param observedConfig * @param managementState */ public StorageSpec(String logLevel, String managementState, KubernetesResource observedConfig, String operatorLogLevel, KubernetesResource unsupportedConfigOverrides) { super(); this.logLevel = logLevel; this.managementState = managementState; this.observedConfig = observedConfig; this.operatorLogLevel = operatorLogLevel; this.unsupportedConfigOverrides = unsupportedConfigOverrides; } @JsonProperty("logLevel") public String getLogLevel() { return logLevel; } @JsonProperty("logLevel") public void setLogLevel(String logLevel) { this.logLevel = logLevel; } @JsonProperty("managementState") public String getManagementState() { return managementState; } @JsonProperty("managementState") public void setManagementState(String managementState) { this.managementState = managementState; } @JsonProperty("observedConfig") public KubernetesResource getObservedConfig() { return observedConfig; } @JsonProperty("observedConfig") public void setObservedConfig(KubernetesResource observedConfig) { this.observedConfig = observedConfig; } @JsonProperty("operatorLogLevel") public String getOperatorLogLevel() { return operatorLogLevel; } @JsonProperty("operatorLogLevel") public void setOperatorLogLevel(String operatorLogLevel) { this.operatorLogLevel = operatorLogLevel; } @JsonProperty("unsupportedConfigOverrides") public KubernetesResource getUnsupportedConfigOverrides() { return unsupportedConfigOverrides; } @JsonProperty("unsupportedConfigOverrides") public void setUnsupportedConfigOverrides(KubernetesResource unsupportedConfigOverrides) { this.unsupportedConfigOverrides = unsupportedConfigOverrides; } @JsonAnyGetter public Map<String, Object> getAdditionalProperties() { return this.additionalProperties; } @JsonAnySetter public void setAdditionalProperty(String name, Object value) { this.additionalProperties.put(name, value); } }
[ "marc@marcnuri.com" ]
marc@marcnuri.com
4992b9531c56fe4cc6b83c91e61152a792d22fb9
ab9387a1505654d8ae714d2fd138a9eeb824f4de
/src/magic/test/TestAbilities.java
887dfd07224b59272cc8575b95d8dd5ced14305f
[]
no_license
hixio-mh/Magarena
d33b98aeff766c1828e998fada9a76b1c943baaf
97be52ee82bc7526caa079ca33e42ea521a490bc
refs/heads/master
2022-12-21T00:33:09.565690
2020-09-26T14:31:49
2020-09-26T14:31:49
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,236
java
package magic.test; import magic.model.MagicDuel; import magic.model.MagicGame; import magic.model.MagicPlayer; import magic.model.MagicPlayerDefinition; import magic.model.MagicPlayerProfile; import magic.model.phase.MagicMainPhase; class TestAbilities extends TestGameBuilder { public MagicGame getGame() { final MagicDuel duel=new MagicDuel(); duel.setDifficulty(6); final MagicPlayerProfile profile=new MagicPlayerProfile("bgruw"); final MagicPlayerDefinition player1=new MagicPlayerDefinition("Player",false,profile,15); final MagicPlayerDefinition player2=new MagicPlayerDefinition("Computer",true,profile,14); duel.setPlayers(new MagicPlayerDefinition[]{player1,player2}); duel.setStartPlayer(0); final MagicGame game=duel.nextGame(true); game.setPhase(MagicMainPhase.getFirstInstance()); final MagicPlayer player=game.getPlayer(0); final MagicPlayer opponent=game.getPlayer(1); MagicPlayer P = player; P.setLife(20); addToLibrary(P, "Plains", 10); createPermanent(game,P,"Rupture Spire",false,20); createPermanent(game,P,"Accorder Paladin",false,100); createPermanent(game,P,"Lightning Greaves",false,1); createPermanent(game,P,"Sword of Body and Mind",false,1); createPermanent(game,P,"Darksteel Axe",false,1); createPermanent(game,P,"Akroma's Memorial",false,1); createPermanent(game,P,"Imperious Perfect",false,1); createPermanent(game,P,"Imperious Perfect",false,1); addToHand(P,"Naturalize",5); addToHand(P,"Demystify",3); addToHand(P,"Doom Blade",5); addToHand(P,"Boar Umbra",1); addToHand(P,"Brink of Disaster",1); addToHand(P,"Pacifism",1); addToHand(P,"Lightning Bolt",1); P = opponent; P.setLife(20); addToLibrary(P, "Plains", 10); createPermanent(game,P,"Rupture Spire",false,8); createPermanent(game,P,"Sword of Body and Mind",false,1); createPermanent(game,P,"Bladed Pinions",false,1); createPermanent(game,P,"Acidic Slime",false,3); addToHand(P,"Unquestioned Authority",1); return game; } }
[ "iargosyi@gmail.com" ]
iargosyi@gmail.com
affbacc3f69e6e4cf85d0c76d3dc59e3fbc94a24
dc1dbb7e5a4b95bf44170d2f51fd08b3814f2ac9
/data_defect4j/preprossed_method_corpus/Lang/53/org/apache/commons/lang/time/FastDateFormat_getPattern_920.java
7685600a53fbfb89aee99cd80dd5a22b0834d4bd
[]
no_license
hvdthong/NetML
dca6cf4d34c5799b400d718e0a6cd2e0b167297d
9bb103da21327912e5a29cbf9be9ff4d058731a5
refs/heads/master
2021-06-30T15:03:52.618255
2020-10-07T01:58:48
2020-10-07T01:58:48
150,383,588
1
1
null
2018-09-26T07:08:45
2018-09-26T07:08:44
null
UTF-8
Java
false
false
2,699
java
org apach common lang time fast date format fastdateformat fast thread safe version link java text simpl date format simpledateformat direct replac code simpl date format simpledateformat code format situat multi thread server environ code simpl date format simpledateformat code thread safe jdk version sun close bug rfe format support pattern compat simpl date format simpledateformat time zone java introduc pattern letter code 'z' code repres time zone rfc822 format code code code code pattern letter jdk version addit pattern code zz' 'zz' code made repres iso8601 full format time zone code code code code introduc minor incompat java gain function author tea trove teatrov project author brian neill o'neil author sean schofield author gari gregori author stephen colebourn author nikolai metchev version fast date format fastdateformat format pattern formatt pattern link java text simpl date format simpledateformat compat string pattern getpattern pattern mpattern
[ "hvdthong@gmail.com" ]
hvdthong@gmail.com
50bc04266f4488ccc8dfd4d8a6d11de2aa89f87b
358519a107711929511ee49905a8cdaffe6b216d
/src/main/java/com/ruoyi/framework/shiro/realm/UserRealm.java
9a637fe88865d7c8a1ebb73e70d9a0dc5cff9579
[ "MIT" ]
permissive
Acer611/manager-admin
af48d23c680f43b447fb4051e2e6f6598ca601d1
6962b99264f78aa41dc772baedecbf41cddab125
refs/heads/master
2022-09-28T02:16:14.785007
2019-11-12T03:50:42
2019-11-12T03:50:42
199,360,243
0
0
MIT
2022-09-01T23:10:42
2019-07-29T01:59:35
HTML
UTF-8
Java
false
false
4,805
java
package com.ruoyi.framework.shiro.realm; import java.util.HashSet; import java.util.Set; import org.apache.shiro.SecurityUtils; import org.apache.shiro.authc.AuthenticationException; import org.apache.shiro.authc.AuthenticationInfo; import org.apache.shiro.authc.AuthenticationToken; import org.apache.shiro.authc.ExcessiveAttemptsException; import org.apache.shiro.authc.IncorrectCredentialsException; import org.apache.shiro.authc.LockedAccountException; import org.apache.shiro.authc.SimpleAuthenticationInfo; import org.apache.shiro.authc.UnknownAccountException; import org.apache.shiro.authc.UsernamePasswordToken; import org.apache.shiro.authz.AuthorizationInfo; import org.apache.shiro.authz.SimpleAuthorizationInfo; import org.apache.shiro.realm.AuthorizingRealm; import org.apache.shiro.subject.PrincipalCollection; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import com.ruoyi.common.exception.user.CaptchaException; import com.ruoyi.common.exception.user.RoleBlockedException; import com.ruoyi.common.exception.user.UserBlockedException; import com.ruoyi.common.exception.user.UserNotExistsException; import com.ruoyi.common.exception.user.UserPasswordNotMatchException; import com.ruoyi.common.exception.user.UserPasswordRetryLimitExceedException; import com.ruoyi.common.utils.security.ShiroUtils; import com.ruoyi.framework.shiro.service.LoginService; import com.ruoyi.project.service.system.menu.IMenuService; import com.ruoyi.project.service.system.role.IRoleService; import com.ruoyi.project.domain.system.user.User; /** * 自定义Realm 处理登录 权限 * * @author ruoyi */ public class UserRealm extends AuthorizingRealm { private static final Logger log = LoggerFactory.getLogger(UserRealm.class); @Autowired private IMenuService menuService; @Autowired private IRoleService roleService; @Autowired private LoginService loginService; /** * 授权 */ @Override protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection arg0) { User user = ShiroUtils.getSysUser(); // 角色列表 Set<String> roles = new HashSet<String>(); // 功能列表 Set<String> menus = new HashSet<String>(); SimpleAuthorizationInfo info = new SimpleAuthorizationInfo(); // 管理员拥有所有权限 if (user.isAdmin()) { info.addRole("admin"); info.addStringPermission("*:*:*"); } else { roles = roleService.selectRoleKeys(user.getUserId()); menus = menuService.selectPermsByUserId(user.getUserId()); // 角色加入AuthorizationInfo认证对象 info.setRoles(roles); // 权限加入AuthorizationInfo认证对象 info.setStringPermissions(menus); } return info; } /** * 登录认证 */ @Override protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken token) throws AuthenticationException { UsernamePasswordToken upToken = (UsernamePasswordToken) token; String username = upToken.getUsername(); String password = ""; if (upToken.getPassword() != null) { password = new String(upToken.getPassword()); } User user = null; try { user = loginService.login(username, password); } catch (CaptchaException e) { throw new AuthenticationException(e.getMessage(), e); } catch (UserNotExistsException e) { throw new UnknownAccountException(e.getMessage(), e); } catch (UserPasswordNotMatchException e) { throw new IncorrectCredentialsException(e.getMessage(), e); } catch (UserPasswordRetryLimitExceedException e) { throw new ExcessiveAttemptsException(e.getMessage(), e); } catch (UserBlockedException e) { throw new LockedAccountException(e.getMessage(), e); } catch (RoleBlockedException e) { throw new LockedAccountException(e.getMessage(), e); } catch (Exception e) { log.info("对用户[" + username + "]进行登录验证..验证未通过{}", e.getMessage()); throw new AuthenticationException(e.getMessage(), e); } SimpleAuthenticationInfo info = new SimpleAuthenticationInfo(user, password, getName()); return info; } /** * 清理缓存权限 */ public void clearCachedAuthorizationInfo() { this.clearCachedAuthorizationInfo(SecurityUtils.getSubject().getPrincipals()); } }
[ "y_gaofei@163.com" ]
y_gaofei@163.com
348129f4957ed47283d2902ed7a7ab43d0217a79
2ee773cbdc216c9165029632eb36fedd8de36ca5
/app/src/main/java/com/qualcomm/hardware/lynx/commands/core/LynxSetPWMEnableCommand.java
7e7eaaea2dc3f66cfd6f3fbd1353553dd19c17b8
[]
no_license
Killian-Townsend/Custom-FTC-Driver-Station-2021
6bee582afdb032ad2921b394280a2321f0f815ec
16e8999d7593ef2c4189902bf2d376db8a3a6b41
refs/heads/master
2023-03-28T04:48:30.704409
2021-03-19T01:09:18
2021-03-19T01:09:18
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,455
java
package com.qualcomm.hardware.lynx.commands.core; import com.qualcomm.hardware.lynx.LynxModuleIntf; import com.qualcomm.hardware.lynx.commands.LynxDatagram; import com.qualcomm.hardware.lynx.commands.standard.LynxAck; import java.nio.ByteBuffer; public class LynxSetPWMEnableCommand extends LynxDekaInterfaceCommand<LynxAck> { public static final int cbPayload = 2; private byte channel; private byte enable; public LynxSetPWMEnableCommand(LynxModuleIntf paramLynxModuleIntf) { super(paramLynxModuleIntf); } public LynxSetPWMEnableCommand(LynxModuleIntf paramLynxModuleIntf, int paramInt, boolean paramBoolean) {} public void fromPayloadByteArray(byte[] paramArrayOfbyte) { ByteBuffer byteBuffer = ByteBuffer.wrap(paramArrayOfbyte).order(LynxDatagram.LYNX_ENDIAN); this.channel = byteBuffer.get(); this.enable = byteBuffer.get(); } public boolean isResponseExpected() { return false; } public byte[] toPayloadByteArray() { ByteBuffer byteBuffer = ByteBuffer.allocate(2).order(LynxDatagram.LYNX_ENDIAN); byteBuffer.put(this.channel); byteBuffer.put(this.enable); return byteBuffer.array(); } } /* Location: C:\Users\Student\Desktop\APK Decompiling\com.qualcomm.ftcdriverstation_38_apps.evozi.com\classes-dex2jar.jar!\com\qualcomm\hardware\lynx\commands\core\LynxSetPWMEnableCommand.class * Java compiler version: 6 (50.0) * JD-Core Version: 1.1.3 */
[ "admin@thatsfuckingstupid.org" ]
admin@thatsfuckingstupid.org
180db804ce2903f15880829fb6f50bcbf6dc5d21
6b568c6f42c8909b30bb69e992c6527695c1fd15
/local/in/dhis-web-linelisting-in/src/main/java/org/hisp/dhis/ll/action/llgroup/DefineLLGroupAssociationsAction.java
797957b76fb3f05563c8e5d520b8a4c6811c3f5e
[]
no_license
onaio/dhis2
7f156f2b015b7b3683527c044c9ec6fd52c9bc66
2b4da26297dd6b27fd75babc743cf6b3be14aec0
refs/heads/master
2020-04-28T15:09:21.763055
2013-12-20T17:13:46
2013-12-20T17:14:38
15,343,468
0
2
null
null
null
null
UTF-8
Java
false
false
5,514
java
package org.hisp.dhis.ll.action.llgroup; /* * Copyright (c) 2004-2007, University of Oslo * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * Neither the name of the HISP project nor the names of its contributors may * be used to endorse or promote products derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ import java.util.HashSet; import org.hisp.dhis.linelisting.LineListGroup; import org.hisp.dhis.linelisting.LineListService; import org.hisp.dhis.organisationunit.OrganisationUnit; import org.hisp.dhis.oust.manager.SelectionTreeManager; import com.opensymphony.xwork2.Action; /** * @author Kristian * @version $Id: DefineDataSetAssociationsAction.java 3648 2007-10-15 22:47:45Z larshelg $ */ public class DefineLLGroupAssociationsAction implements Action { // ------------------------------------------------------------------------- // Dependencies // ------------------------------------------------------------------------- private SelectionTreeManager selectionTreeManager; public void setSelectionTreeManager( SelectionTreeManager selectionTreeManager ) { this.selectionTreeManager = selectionTreeManager; } private LineListService lineListService; public void setLineListService( LineListService lineListService ) { this.lineListService = lineListService; } // ------------------------------------------------------------------------- // Getters & Setters // ------------------------------------------------------------------------- private int id; public int getId() { return id; } public void setId( int id ) { this.id = id; } // ------------------------------------------------------------------------- // Action // ------------------------------------------------------------------------- public String execute() throws Exception { LineListGroup lineListGroup = lineListService.getLineListGroup( id ); lineListGroup.updateOrganisationUnits( new HashSet<OrganisationUnit>( selectionTreeManager.getReloadedSelectedOrganisationUnits() ) ); lineListService.updateLineListGroup( lineListGroup ); /* Collection<OrganisationUnit> rootUnits = selectionTreeManager.getRootOrganisationUnits(); Set<OrganisationUnit> unitsInTheTree = new HashSet<OrganisationUnit>(); getUnitsInTheTree( rootUnits, unitsInTheTree ); LineListGroup lineListGroup = lineListService.getLineListGroup( id ); //Set<Source> assignedSources = lineListGroup.getSources(); Set<OrganisationUnit> assignedSources = lineListGroup.getSources(); //assignedSources.removeAll( convert( unitsInTheTree ) ); assignedSources.removeAll( unitsInTheTree ); Collection<OrganisationUnit> selectedOrganisationUnits = selectionTreeManager.getSelectedOrganisationUnits(); //assignedSources.addAll( convert( selectedOrganisationUnits ) ); assignedSources.addAll( selectedOrganisationUnits ); lineListGroup.setSources( assignedSources ); lineListService.updateLineListGroup( lineListGroup ); */ return SUCCESS; } // ------------------------------------------------------------------------- // Supportive methods // ------------------------------------------------------------------------- /* private Set<Source> convert( Collection<OrganisationUnit> organisationUnits ) { Set<Source> sources = new HashSet<Source>(); sources.addAll( organisationUnits ); return sources; } */ /* private void getUnitsInTheTree( Collection<OrganisationUnit> rootUnits, Set<OrganisationUnit> unitsInTheTree ) { for( OrganisationUnit root : rootUnits ) { unitsInTheTree.add( root ); getUnitsInTheTree( root.getChildren(), unitsInTheTree ); } } */ }
[ "peter@helioid.com" ]
peter@helioid.com
388fbb3c448650d2ecd5d02b6bf8539a4c4ff178
7867212779fba845f04c2049bcdf535675a38db4
/pCrs/appModelAll/src/com/photel/webserviceClient/BDL244/vo/purchaseRQ/Contract.java
8fc48b9abbe95dfe6857f8b6e4130c5c4ae08950
[]
no_license
online4you/java-source
1b0f6727a7afb6df261d12b6f787f9a9a85136f4
ddaae964fcea6da11d811883cf4a93f61213c699
refs/heads/master
2020-04-02T03:52:55.226676
2018-10-21T16:03:06
2018-10-21T16:03:06
153,989,430
0
0
null
null
null
null
UTF-8
Java
false
false
5,222
java
// // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.5-b01-fcs // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2012.08.01 at 12:19:03 PM CEST // package com.photel.webserviceClient.BDL244.vo.purchaseRQ; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; /** * Contract information. * * <p>Java class for Contract complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="Contract"> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="Name"> * &lt;simpleType> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string"> * &lt;minLength value="1"/> * &lt;maxLength value="20"/> * &lt;/restriction> * &lt;/simpleType> * &lt;/element> * &lt;element name="IncomingOffice" type="{http://www.hotelbeds.com/schemas/2005/06/messages}IncomingOffice"/> * &lt;element name="Sequence" minOccurs="0"> * &lt;simpleType> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string"> * &lt;minLength value="1"/> * &lt;maxLength value="200"/> * &lt;/restriction> * &lt;/simpleType> * &lt;/element> * &lt;element name="Classification" type="{http://www.hotelbeds.com/schemas/2005/06/messages}ContractClassification" minOccurs="0"/> * &lt;element name="CommentList" type="{http://www.hotelbeds.com/schemas/2005/06/messages}CommentList" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "Contract", propOrder = { "name", "incomingOffice", "sequence", "classification", "commentList" }) public class Contract { @XmlElement(name = "Name", required = true) protected String name; @XmlElement(name = "IncomingOffice", required = true) protected IncomingOffice incomingOffice; @XmlElement(name = "Sequence") protected String sequence; @XmlElement(name = "Classification") protected ContractClassification classification; @XmlElement(name = "CommentList") protected CommentList commentList; /** * Gets the value of the name property. * * @return * possible object is * {@link String } * */ public String getName() { return name; } /** * Sets the value of the name property. * * @param value * allowed object is * {@link String } * */ public void setName(String value) { this.name = value; } /** * Gets the value of the incomingOffice property. * * @return * possible object is * {@link IncomingOffice } * */ public IncomingOffice getIncomingOffice() { return incomingOffice; } /** * Sets the value of the incomingOffice property. * * @param value * allowed object is * {@link IncomingOffice } * */ public void setIncomingOffice(IncomingOffice value) { this.incomingOffice = value; } /** * Gets the value of the sequence property. * * @return * possible object is * {@link String } * */ public String getSequence() { return sequence; } /** * Sets the value of the sequence property. * * @param value * allowed object is * {@link String } * */ public void setSequence(String value) { this.sequence = value; } /** * Gets the value of the classification property. * * @return * possible object is * {@link ContractClassification } * */ public ContractClassification getClassification() { return classification; } /** * Sets the value of the classification property. * * @param value * allowed object is * {@link ContractClassification } * */ public void setClassification(ContractClassification value) { this.classification = value; } /** * Gets the value of the commentList property. * * @return * possible object is * {@link CommentList } * */ public CommentList getCommentList() { return commentList; } /** * Sets the value of the commentList property. * * @param value * allowed object is * {@link CommentList } * */ public void setCommentList(CommentList value) { this.commentList = value; } }
[ "jceular.atwork@gmail.com" ]
jceular.atwork@gmail.com
d7818b9b8fffda03271ccb9f807a16ed40384f61
1e71068a5dd43072eba9044e129eef7c75caa90e
/src/main/java/havis/custom/harting/assignmentstore/ui/client/sections/location/LocationSpecList.java
42e36935fbff8eb16ad188602a6b99f8f41d05ba
[ "Apache-2.0" ]
permissive
peramic/App.AssignmentStore
7deb06b8834481ce3b69a55d59ad960b6c30d822
2c7171e45035b883ecea52e6f3b7711ce2ae5c68
refs/heads/main
2023-03-08T01:46:10.702276
2021-02-25T11:02:41
2021-02-25T11:02:41
334,917,367
0
0
null
null
null
null
UTF-8
Java
false
false
4,125
java
package havis.custom.harting.assignmentstore.ui.client.sections.location; import havis.custom.harting.assignmentstore.model.LocationSpec; import havis.custom.harting.assignmentstore.rest.async.AssignmentStoreServiceAsync; import havis.custom.harting.assignmentstore.ui.client.sections.Dialog; import havis.custom.harting.assignmentstore.ui.client.sections.SpecListItemView; import havis.net.ui.shared.client.event.MessageEvent.MessageType; import havis.net.ui.shared.client.widgets.CommonEditorDialog; import havis.net.ui.shared.client.widgets.CustomMessageWidget; import havis.net.ui.shared.client.widgets.Util; import java.util.LinkedList; import java.util.List; import org.fusesource.restygwt.client.Method; import org.fusesource.restygwt.client.MethodCallback; import com.google.gwt.core.client.GWT; import com.google.gwt.event.dom.client.ClickEvent; import com.google.gwt.uibinder.client.UiBinder; import com.google.gwt.uibinder.client.UiConstructor; import com.google.gwt.uibinder.client.UiField; import com.google.gwt.uibinder.client.UiHandler; import com.google.gwt.user.client.ui.Composite; import com.google.gwt.user.client.ui.FlowPanel; import com.google.gwt.user.client.ui.HTMLPanel; import com.google.gwt.user.client.ui.Widget; public class LocationSpecList extends Composite implements Dialog.Presenter, SpecListItemView.Presenter { private AssignmentStoreServiceAsync service = GWT.create(AssignmentStoreServiceAsync.class); private static LocationSpecListUiBinder uiBinder = GWT.create(LocationSpecListUiBinder.class); interface LocationSpecListUiBinder extends UiBinder<Widget, LocationSpecList> { } @UiField HTMLPanel container; @UiField FlowPanel specItemList; private List<LocationSpec> locationSpecs = new LinkedList<LocationSpec>(); private LinkedList<CommonEditorDialog> dialogs = new LinkedList<CommonEditorDialog>(); @UiConstructor public LocationSpecList() { initWidget(uiBinder.createAndBindUi(this)); refreshList(); } public void createDialog(CommonEditorDialog dialog) { if (dialogs.size() > 0) container.remove(dialogs.getFirst()); dialogs.addFirst(dialog); container.add(dialog); } @Override public void closeDialog(boolean refresh) { if (dialogs.size() > 0) { CommonEditorDialog dialog = dialogs.remove(); container.remove(dialog); } if (dialogs.size() > 0) { container.add(dialogs.getFirst()); } if (refresh) { refreshList(); } } @Override public void showSpec(String id) { LocationSpec spec = null; int indexOf = locationSpecs.indexOf(new LocationSpec(id)); if (indexOf > -1) { spec = locationSpecs.get(indexOf); LocationEditiorDialog dialog = new LocationEditiorDialog(spec); dialog.setPresenter(this); createDialog(dialog); } } public void removeSpec(String id) { service.deleteLocation(id, new MethodCallback<Void>() { @Override public void onSuccess(Method method, Void response) { refreshList(); } @Override public void onFailure(Method method, Throwable exception) { CustomMessageWidget.show(Util.getThrowableMessage(exception), MessageType.ERROR); } }); } public void refreshList() { specItemList.clear(); service.getLocations(new MethodCallback<List<LocationSpec>>() { @Override public void onSuccess(Method method, List<LocationSpec> response) { if (response != null) { locationSpecs = response; } else { locationSpecs = new LinkedList<LocationSpec>(); } for (LocationSpec spec : locationSpecs) { LocationSpecListItem i = new LocationSpecListItem(spec); i.setPresenter(LocationSpecList.this); specItemList.add(i); } } @Override public void onFailure(Method method, Throwable exception) { CustomMessageWidget.show(Util.getThrowableMessage(exception), MessageType.ERROR); } }); } @UiHandler("refreshButton") public void onRefresh(ClickEvent event) { refreshList(); } @UiHandler("addButton") public void onAdd(ClickEvent event) { LocationEditiorDialog dialog = new LocationEditiorDialog(new LocationSpec()); dialog.setPresenter(this); createDialog(dialog); } }
[ "abrams@peramic.io" ]
abrams@peramic.io
89cf958d90b791dbe40ceaca8a9dae172ef18efc
a24789efd2cb74131111acf2baf3ffff2d6e8280
/JavaCode/contest/weekly/n201_300/n257/N1.java
922121835e9569ec34e3cdf0e1d5a5088dacbe7f
[ "Apache-2.0" ]
permissive
MikuSugar/LeetCode
15e6c7a73b296a74f4c86435c832f99021a3b6d7
e9cf36e52ae38d92b97e3c5c026c97e300c07971
refs/heads/master
2023-06-26T10:39:50.001158
2023-06-21T08:31:37
2023-06-21T08:31:37
164,054,066
6
0
null
null
null
null
UTF-8
Java
false
false
1,349
java
package JavaCode.contest.weekly.n201_300.n257; import java.util.Arrays; /** * @author mikusugar */ public class N1 { public int countQuadruplets(int[] nums) { int res = 0; for (int i = 0; i < nums.length; i++) { for (int j = i + 1; j < nums.length; j++) { for (int k = j + 1; k < nums.length; k++) { int tar = nums[i] + nums[k] + nums[j]; for (int m = nums.length - 1; m > k; m--) { if (tar == nums[m]) res++; } } } } return res; } } /* 给你一个 下标从 0 开始 的整数数组 nums ,返回满足下述条件的 不同 四元组 (a, b, c, d) 的 数目 : nums[a] + nums[b] + nums[c] == nums[d] ,且 a < b < c < d 示例 1: 输入:nums = [1,2,3,6] 输出:1 解释:满足要求的唯一一个四元组是 (0, 1, 2, 3) 因为 1 + 2 + 3 == 6 。 示例 2: 输入:nums = [3,3,6,4,5] 输出:0 解释:[3,3,6,4,5] 中不存在满足要求的四元组。 示例 3: 输入:nums = [1,1,1,3,5] 输出:4 解释:满足要求的 4 个四元组如下: - (0, 1, 2, 3): 1 + 1 + 1 == 3 - (0, 1, 3, 4): 1 + 1 + 3 == 5 - (0, 2, 3, 4): 1 + 1 + 3 == 5 - (1, 2, 3, 4): 1 + 1 + 3 == 5 提示: 4 <= nums.length <= 50 1 <= nums[i] <= 100 */
[ "syfangjie@live.cn" ]
syfangjie@live.cn
1e9cd393cda4ad7814d4fefdbb37a2ee36962e64
5979994b215fabe125cd756559ef2166c7df7519
/aimir-mdms-iesco/src/main/java/org/multispeak/version_4/GetServiceOrdersByServiceLocation.java
715be7340888333dce49e355c8eac31047edb01f
[]
no_license
TechTinkerer42/Haiti
91c45cb1b784c9afc61bf60d43e1d5623aeba888
debaea96056d1d4611b79bd846af8f7484b93e6e
refs/heads/master
2023-04-28T23:39:43.176592
2021-05-03T10:49:42
2021-05-03T10:49:42
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,864
java
// // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.6 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2015.07.22 at 06:38:23 PM KST // package org.multispeak.version_4; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="serviceLocationID" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "serviceLocationID" }) @XmlRootElement(name = "GetServiceOrdersByServiceLocation") public class GetServiceOrdersByServiceLocation { protected String serviceLocationID; /** * Gets the value of the serviceLocationID property. * * @return * possible object is * {@link String } * */ public String getServiceLocationID() { return serviceLocationID; } /** * Sets the value of the serviceLocationID property. * * @param value * allowed object is * {@link String } * */ public void setServiceLocationID(String value) { this.serviceLocationID = value; } }
[ "marsr0913@nuritelecom.com" ]
marsr0913@nuritelecom.com
2cbec7c3c7f750604e5e99a07b7083b895304217
b99176418bbf194ecc4cb1a20e5450ee1ee2f32f
/app/src/main/java/com/alorma/github/ui/fragment/base/PaginatedListFragment.java
16655f485c1c254335820c9d72f940a0b6d364aa
[ "MIT" ]
permissive
prashant31191/Gitskarios
7cd783b43b6298cb688ea797fbf13036e0f75731
d5b4025447cae45ac657b1e5f3e3d66cb41a1235
refs/heads/master
2021-01-18T07:30:56.344562
2015-05-17T00:50:02
2015-05-17T00:50:02
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,421
java
package com.alorma.github.ui.fragment.base; import android.widget.AbsListView; import com.alorma.github.sdk.bean.info.PaginationLink; import com.alorma.github.sdk.bean.info.RelType; import com.alorma.gitskarios.basesdk.client.BaseClient; import com.alorma.github.ui.ErrorHandler; import java.util.HashMap; import java.util.List; import java.util.Map; import retrofit.RetrofitError; import retrofit.client.Header; import retrofit.client.Response; public abstract class PaginatedListFragment<K> extends LoadingListFragment implements BaseClient.OnResultCallback<K>, AbsListView.OnScrollListener { protected static final String USERNAME = "USERNAME"; protected boolean paging; private PaginationLink bottomPaginationLink; protected boolean refreshing; @Override public void onScroll(AbsListView absListView, int first, int last, int total) { super.onScroll(absListView, first, last, total); if (total > 0 && first + last == total) { if (bottomPaginationLink != null && bottomPaginationLink.rel == RelType.next) { paging = true; executePaginatedRequest(bottomPaginationLink.page); bottomPaginationLink = null; } } } @Override public void onResponseOk(K k, Response r) { stopRefresh(); hideEmpty(); if (getActivity() != null && isAdded()) { if (k != null && k instanceof List) { if (((List) k).size() > 0) { getLinkData(r); onResponse(k, refreshing); paging = false; refreshing = false; } } } } @Override public void onFail(RetrofitError error) { stopRefresh(); if (getActivity() != null) { ErrorHandler.onRetrofitError(getActivity(), "Paginated list fragment", error); } } protected abstract void onResponse(K k, boolean refreshing); private void getLinkData(Response r) { List<Header> headers = r.getHeaders(); Map<String, String> headersMap = new HashMap<String, String>(headers.size()); for (Header header : headers) { headersMap.put(header.getName(), header.getValue()); } String link = headersMap.get("Link"); if (link != null) { String[] parts = link.split(","); try { bottomPaginationLink = new PaginationLink(parts[0]); } catch (Exception e) { e.printStackTrace(); } } } @Override public void onRefresh() { refreshing = true; executeRequest(); } public void setRefreshing() { this.refreshing = true; } public boolean isRefreshing() { return refreshing; } }
[ "bernatbor15@gmail.com" ]
bernatbor15@gmail.com
9884a8810684150a0e337907a0bf731bc8b4e42e
986747fd09b6f2d8b768f64cde4bb741c0bdf5fd
/src/main/java/br/com/swconsultoria/nfe/schema_4/inutNFe/TProcInutNFe.java
ffa7ef49e42c2720afc14414da3fadc27bfe08f8
[ "MIT" ]
permissive
Samuel-Oliveira/Java_NFe
b7355043e8ef6595dcdc6c95ff88061de7e2de8f
768028e977d455d78cbcd9fdbce15cfde0917d56
refs/heads/master
2023-08-07T14:46:14.107125
2023-07-30T18:08:44
2023-07-30T18:08:44
68,949,807
554
285
MIT
2023-07-30T18:08:44
2016-09-22T18:23:23
Java
UTF-8
Java
false
false
3,247
java
package br.com.swconsultoria.nfe.schema_4.inutNFe; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; /** * Tipo Pedido de inutilzação de númeração de NF-e processado * * <p>Classe Java de TProcInutNFe complex type. * * <p>O seguinte fragmento do esquema especifica o conteúdo esperado contido dentro desta classe. * * <pre> * &lt;complexType name="TProcInutNFe"&gt; * &lt;complexContent&gt; * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; * &lt;sequence&gt; * &lt;element name="inutNFe" type="{http://www.portalfiscal.inf.br/nfe}TInutNFe"/&gt; * &lt;element name="retInutNFe" type="{http://www.portalfiscal.inf.br/nfe}TRetInutNFe"/&gt; * &lt;/sequence&gt; * &lt;attribute name="versao" use="required" type="{http://www.portalfiscal.inf.br/nfe}TVerInutNFe" /&gt; * &lt;/restriction&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "TProcInutNFe", namespace = "http://www.portalfiscal.inf.br/nfe", propOrder = { "inutNFe", "retInutNFe" }) public class TProcInutNFe { @XmlElement(namespace = "http://www.portalfiscal.inf.br/nfe", required = true) protected TInutNFe inutNFe; @XmlElement(namespace = "http://www.portalfiscal.inf.br/nfe", required = true) protected TRetInutNFe retInutNFe; @XmlAttribute(name = "versao", required = true) @XmlJavaTypeAdapter(CollapsedStringAdapter.class) protected String versao; /** * Obtém o valor da propriedade inutNFe. * * @return * possible object is * {@link TInutNFe } * */ public TInutNFe getInutNFe() { return inutNFe; } /** * Define o valor da propriedade inutNFe. * * @param value * allowed object is * {@link TInutNFe } * */ public void setInutNFe(TInutNFe value) { this.inutNFe = value; } /** * Obtém o valor da propriedade retInutNFe. * * @return * possible object is * {@link TRetInutNFe } * */ public TRetInutNFe getRetInutNFe() { return retInutNFe; } /** * Define o valor da propriedade retInutNFe. * * @param value * allowed object is * {@link TRetInutNFe } * */ public void setRetInutNFe(TRetInutNFe value) { this.retInutNFe = value; } /** * Obtém o valor da propriedade versao. * * @return * possible object is * {@link String } * */ public String getVersao() { return versao; } /** * Define o valor da propriedade versao. * * @param value * allowed object is * {@link String } * */ public void setVersao(String value) { this.versao = value; } }
[ "samuk.exe@hotmail.com" ]
samuk.exe@hotmail.com
56d475c62142cdfa5e90cc36ad40300bb5f01b43
9d7aace2b8508ec8b39c2692b5baf3c4bda56623
/ec-auto-persist/src/main/java/com/ecarinfo/auto/po/ViewpointType.java
ec6a9dcb1f11fd8561eb01550c36cb0e802cf634
[]
no_license
xiaobbbbbbb/ec-auto
317a92ac1d62da0f70b1c95dafceff953e8be087
70963565e24860a7f2b460484712dbfdcbe881ed
refs/heads/master
2021-01-19T13:00:33.691625
2014-05-07T07:26:32
2014-05-07T07:26:32
19,019,623
0
1
null
null
null
null
UTF-8
Java
false
false
895
java
package com.ecarinfo.auto.po; import java.io.Serializable; public class ViewpointType implements Serializable { private static final long serialVersionUID = -2260388125919493487L; private Integer id; private String name;//观点类型 private String type;//f分类 private Integer status = 1;//0无效,1有效 public Integer getId () { return id; } public void setId (Integer id) { this.id = id; } public String getName () { return name; } public void setName (String name) { this.name = name; } public String getType () { return type; } public void setType (String type) { this.type = type; } public Integer getStatus () { return status; } public void setStatus (Integer status) { this.status = status; } }
[ "6454166@qq.com" ]
6454166@qq.com
499c6b240ab9afed0e7f940dd5944c8209a4a86a
d2eee6e9a3ad0b3fd2899c3d1cf94778615b10cb
/PROMISE/archives/ant/1.6/org/apache/tools/ant/taskdefs/cvslib/CvsTagEntry.java
984160cf14df8ad3bfbfb8dead1208714bff1703
[]
no_license
hvdthong/DEFECT_PREDICTION
78b8e98c0be3db86ffaed432722b0b8c61523ab2
76a61c69be0e2082faa3f19efd76a99f56a32858
refs/heads/master
2021-01-20T05:19:00.927723
2018-07-10T03:38:14
2018-07-10T03:38:14
89,766,606
5
1
null
null
null
null
UTF-8
Java
false
false
1,544
java
package org.apache.tools.ant.taskdefs.cvslib; /** * Holds the information of a line of rdiff */ class CvsTagEntry { String m_filename; String m_prevRevision; String m_revision; public CvsTagEntry(String filename) { this(filename, null, null); } public CvsTagEntry(String filename, String revision) { this(filename, revision, null); } public CvsTagEntry(String filename, String revision, String prevRevision) { m_filename = filename; m_revision = revision; m_prevRevision = prevRevision; } public String getFile() { return m_filename; } public String getRevision() { return m_revision; } public String getPreviousRevision() { return m_prevRevision; } public String toString() { StringBuffer buffer = new StringBuffer(); buffer.append(m_filename); if ((m_revision == null)) { buffer.append(" was removed"); if(m_prevRevision != null) { buffer.append("; previous revision was ").append(m_prevRevision); } } else if (m_revision != null && m_prevRevision == null) { buffer.append(" is new; current revision is ") .append(m_revision); } else if (m_revision != null && m_prevRevision != null) { buffer.append(" has changed from ") .append(m_prevRevision).append(" to ").append(m_revision); } return buffer.toString(); } }
[ "hvdthong@github.com" ]
hvdthong@github.com
7cb26731ab42722bb86dc2989c5c1f1166d435be
53d677a55e4ece8883526738f1c9d00fa6560ff7
/com/tencent/mm/plugin/account/bind/ui/BindLinkedInUI$1.java
22c6fb3e63cb66d4ce93210fbef0e323322b328e
[]
no_license
0jinxing/wechat-apk-source
544c2d79bfc10261eb36389c1edfdf553d8f312a
f75eefd87e9b9ecf2f76fc6d48dbba8e24afcf3d
refs/heads/master
2020-06-07T20:06:03.580028
2019-06-21T09:17:26
2019-06-21T09:17:26
193,069,132
9
4
null
null
null
null
UTF-8
Java
false
false
763
java
package com.tencent.mm.plugin.account.bind.ui; import android.content.DialogInterface; import android.content.DialogInterface.OnClickListener; import com.tencent.matrix.trace.core.AppMethodBeat; final class BindLinkedInUI$1 implements DialogInterface.OnClickListener { BindLinkedInUI$1(BindLinkedInUI paramBindLinkedInUI) { } public final void onClick(DialogInterface paramDialogInterface, int paramInt) { AppMethodBeat.i(13387); BindLinkedInUI.a(this.grc); AppMethodBeat.o(13387); } } /* Location: C:\Users\Lin\Downloads\dex-tools-2.1-SNAPSHOT\dex-tools-2.1-SNAPSHOT\classes6-dex2jar.jar * Qualified Name: com.tencent.mm.plugin.account.bind.ui.BindLinkedInUI.1 * JD-Core Version: 0.6.2 */
[ "172601673@qq.com" ]
172601673@qq.com
7ac22d3fdb5dee34b3777b3278baae39b0d9ea18
e4613aa77f9ce6a860913a494a8662a5aaab3b37
/app/src/main/java/com/example/dharmendraverma/myapplication/gpuimage/GPUImageSaturationBlendFilter.java
e905b44db6670427bc0cfdf872eeec3d555cc015
[]
no_license
dharmendrahike/media
cb41d7a00f1d6f51048358c14767ad24e77cbc66
e3c501b0da6702d615b4c6b9b36e475461abd981
refs/heads/master
2021-09-02T11:11:24.805908
2018-01-02T07:12:42
2018-01-02T07:12:42
115,414,790
0
0
null
null
null
null
UTF-8
Java
false
false
5,185
java
/* * Copyright (C) 2012 CyberAgent * * 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.example.dharmendraverma.myapplication.gpuimage; public class GPUImageSaturationBlendFilter extends GPUImageTwoInputFilter { public static final String SATURATION_BLEND_FRAGMENT_SHADER = "varying highp vec2 textureCoordinate;\n" + " varying highp vec2 textureCoordinate2;\n" + " \n" + " uniform sampler2D inputImageTexture;\n" + " uniform sampler2D inputImageTexture2;\n" + " \n" + " highp float lum(lowp vec3 c) {\n" + " return dot(c, vec3(0.3, 0.59, 0.11));\n" + " }\n" + " \n" + " lowp vec3 clipcolor(lowp vec3 c) {\n" + " highp float l = lum(c);\n" + " lowp float n = min(min(c.r, c.g), c.b);\n" + " lowp float x = max(max(c.r, c.g), c.b);\n" + " \n" + " if (n < 0.0) {\n" + " c.r = l + ((c.r - l) * l) / (l - n);\n" + " c.g = l + ((c.g - l) * l) / (l - n);\n" + " c.b = l + ((c.b - l) * l) / (l - n);\n" + " }\n" + " if (x > 1.0) {\n" + " c.r = l + ((c.r - l) * (1.0 - l)) / (x - l);\n" + " c.g = l + ((c.g - l) * (1.0 - l)) / (x - l);\n" + " c.b = l + ((c.b - l) * (1.0 - l)) / (x - l);\n" + " }\n" + " \n" + " return c;\n" + " }\n" + " \n" + " lowp vec3 setlum(lowp vec3 c, highp float l) {\n" + " highp float d = l - lum(c);\n" + " c = c + vec3(d);\n" + " return clipcolor(c);\n" + " }\n" + " \n" + " highp float sat(lowp vec3 c) {\n" + " lowp float n = min(min(c.r, c.g), c.b);\n" + " lowp float x = max(max(c.r, c.g), c.b);\n" + " return x - n;\n" + " }\n" + " \n" + " lowp float mid(lowp float cmin, lowp float cmid, lowp float cmax, highp float s) {\n" + " return ((cmid - cmin) * s) / (cmax - cmin);\n" + " }\n" + " \n" + " lowp vec3 setsat(lowp vec3 c, highp float s) {\n" + " if (c.r > c.g) {\n" + " if (c.r > c.b) {\n" + " if (c.g > c.b) {\n" + " /* g is mid, b is min */\n" + " c.g = mid(c.b, c.g, c.r, s);\n" + " c.b = 0.0;\n" + " } else {\n" + " /* b is mid, g is min */\n" + " c.b = mid(c.g, c.b, c.r, s);\n" + " c.g = 0.0;\n" + " }\n" + " c.r = s;\n" + " } else {\n" + " /* b is max, r is mid, g is min */\n" + " c.r = mid(c.g, c.r, c.b, s);\n" + " c.b = s;\n" + " c.r = 0.0;\n" + " }\n" + " } else if (c.r > c.b) {\n" + " /* g is max, r is mid, b is min */\n" + " c.r = mid(c.b, c.r, c.g, s);\n" + " c.g = s;\n" + " c.b = 0.0;\n" + " } else if (c.g > c.b) {\n" + " /* g is max, b is mid, r is min */\n" + " c.b = mid(c.r, c.b, c.g, s);\n" + " c.g = s;\n" + " c.r = 0.0;\n" + " } else if (c.b > c.g) {\n" + " /* b is max, g is mid, r is min */\n" + " c.g = mid(c.r, c.g, c.b, s);\n" + " c.b = s;\n" + " c.r = 0.0;\n" + " } else {\n" + " c = vec3(0.0);\n" + " }\n" + " return c;\n" + " }\n" + " \n" + " void main()\n" + " {\n" + " highp vec4 baseColor = texture2D(inputImageTexture, textureCoordinate);\n" + " highp vec4 overlayColor = texture2D(inputImageTexture2, textureCoordinate2);\n" + " \n" + " gl_FragColor = vec4(baseColor.rgb * (1.0 - overlayColor.a) + setlum(setsat(baseColor.rgb, sat(overlayColor.rgb)), lum(baseColor.rgb)) * overlayColor.a, baseColor.a);\n" + " }"; public GPUImageSaturationBlendFilter() { super(SATURATION_BLEND_FRAGMENT_SHADER); } }
[ "dharmendra@hike.in" ]
dharmendra@hike.in
0626464ddd1356e120023b63304395e3e6d2cc93
32a35bdb2b7ba2413206893bcf5306d5ac84d296
/app/src/test/java/technologies/d/digital/whatsappdirect/ExampleUnitTest.java
090d640e0b9b3ed076446488f22a51667ea629ef
[]
no_license
ateeqrehman33/Whatsapp-Direct-Chat-Without-Saving-Phone-No.
cb349c4c9e0b4eae90b1c6fdb8359af3ec0ebed3
c1e6fabdfb2c333cd0d04f748175e3b743d7b404
refs/heads/master
2020-06-01T20:02:07.951590
2019-06-08T11:01:33
2019-06-08T11:01:33
190,910,536
2
0
null
null
null
null
UTF-8
Java
false
false
415
java
package technologies.d.digital.whatsappdirect; import org.junit.Test; import static org.junit.Assert.*; /** * Example local unit test, which will execute on the development machine (host). * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ public class ExampleUnitTest { @Test public void addition_isCorrect() throws Exception { assertEquals(4, 2 + 2); } }
[ "root@localhost.localdomain" ]
root@localhost.localdomain
89d90ff5550254e2ddb446a5527fe9e598f52050
70f7a06017ece67137586e1567726579206d71c7
/alimama/src/main/java/com/taobao/zcache/extension/R.java
6276e254d29475b85c4f8912076fc98bf11f68d9
[]
no_license
liepeiming/xposed_chatbot
5a3842bd07250bafaffa9f468562021cfc38ca25
0be08fc3e1a95028f8c074f02ca9714dc3c4dc31
refs/heads/master
2022-12-20T16:48:21.747036
2020-10-14T02:37:49
2020-10-14T02:37:49
null
0
0
null
null
null
null
UTF-8
Java
false
false
226
java
package com.taobao.zcache.extension; public final class R { private R() { } public static final class string { public static final int app_name = 2131296331; private string() { } } }
[ "zhangquan@snqu.com" ]
zhangquan@snqu.com
c0b4c4c61a79e0e5c457825171026bf4ef20c463
0c7d703c8a4729e0924d9b4a5446e861b4b7f083
/src/test/java/org/gridkit/jorka/JorkaTest.java
2bfef32da63e90b7338d2a6d8d21dd756d5021fd
[ "Apache-2.0" ]
permissive
aragozin/jorka
9763212153e737c5d94ac5d75414d7f1d317f2bc
3bd38b869dfb4521e71f3fdacd09c0fe342b97e3
refs/heads/master
2021-01-22T10:02:10.185853
2014-05-28T08:03:00
2014-05-28T08:03:00
14,843,567
1
0
null
null
null
null
UTF-8
Java
false
false
1,731
java
/** * Copyright 2013 Alexey Ragozin * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.gridkit.jorka; import org.gridkit.jorka.Jorka.Match; import org.junit.FixMethodOrder; import org.junit.Test; import org.junit.runners.MethodSorters; @FixMethodOrder(MethodSorters.JVM) public class JorkaTest { @Test public void test_simple_pattern() throws Throwable { Jorka g = new Jorka(); g.addPatternFromFile("src/test/resources/patterns/base"); g.compile("%{WORD:NAME}: %{NUMBER:TIME}ms"); Match gm = g.match("A: 1.0ms"); gm.parse(); // See the result System.out.println(gm.toJSON()); } @Test public void test_apache_pattern() throws Throwable { Jorka g = new Jorka(); g.addPatternFromFile("src/test/resources/patterns/base"); g.compile("%{APACHE:XXX}"); Match gm = g.match("10.192.1.47 - - [23/May/2013:10:47:40 0] \"GET /flower1_store/category1.screen?category_id1=FLOWERS HTTP/1.1\" 200 10577 \"http://mystore.abc.com/flower1_store/main.screen&JSESSIONID=SD1SL10FF3ADFF3\" \"Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.10) Gecko/20070223 CentOS/1.5.0.10-0.1.el4.centos Firefox/1.5.0.10\" 3823 404"); gm.parse(); // See the result System.out.println(gm.toJSON()); } }
[ "alexey.ragozin@gmail.com" ]
alexey.ragozin@gmail.com
dd5d6580bf097ebf9230029406366ee2baeff69a
2bdd57e8d9bfbf7709f2cf331af4e9a3cc2ae505
/src/main/java/com/farhan/myapp/web/rest/AccountResource.java
1e261b300e26830760398ba675356a5d4a1c61f9
[]
no_license
farhan9335/Jordan
6aa9e1ad6197ce193d4b2722da6bef0a665c8a10
a729f502b50790932903fc3ddb9064119d38b5de
refs/heads/master
2022-12-23T07:51:39.720471
2019-11-23T14:46:59
2019-11-23T14:46:59
223,604,551
0
0
null
2022-12-16T04:41:58
2019-11-23T14:46:43
Java
UTF-8
Java
false
false
7,467
java
package com.farhan.myapp.web.rest; import com.farhan.myapp.domain.User; import com.farhan.myapp.repository.UserRepository; import com.farhan.myapp.security.SecurityUtils; import com.farhan.myapp.service.MailService; import com.farhan.myapp.service.UserService; import com.farhan.myapp.service.dto.PasswordChangeDTO; import com.farhan.myapp.service.dto.UserDTO; import com.farhan.myapp.web.rest.errors.*; import com.farhan.myapp.web.rest.vm.KeyAndPasswordVM; import com.farhan.myapp.web.rest.vm.ManagedUserVM; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletRequest; import javax.validation.Valid; import java.util.*; /** * REST controller for managing the current user's account. */ @RestController @RequestMapping("/api") public class AccountResource { private static class AccountResourceException extends RuntimeException { private AccountResourceException(String message) { super(message); } } private final Logger log = LoggerFactory.getLogger(AccountResource.class); private final UserRepository userRepository; private final UserService userService; private final MailService mailService; public AccountResource(UserRepository userRepository, UserService userService, MailService mailService) { this.userRepository = userRepository; this.userService = userService; this.mailService = mailService; } /** * {@code POST /register} : register the user. * * @param managedUserVM the managed user View Model. * @throws InvalidPasswordException {@code 400 (Bad Request)} if the password is incorrect. * @throws EmailAlreadyUsedException {@code 400 (Bad Request)} if the email is already used. * @throws LoginAlreadyUsedException {@code 400 (Bad Request)} if the login is already used. */ @PostMapping("/register") @ResponseStatus(HttpStatus.CREATED) public void registerAccount(@Valid @RequestBody ManagedUserVM managedUserVM) { if (!checkPasswordLength(managedUserVM.getPassword())) { throw new InvalidPasswordException(); } User user = userService.registerUser(managedUserVM, managedUserVM.getPassword()); mailService.sendActivationEmail(user); } /** * {@code GET /activate} : activate the registered user. * * @param key the activation key. * @throws RuntimeException {@code 500 (Internal Server Error)} if the user couldn't be activated. */ @GetMapping("/activate") public void activateAccount(@RequestParam(value = "key") String key) { Optional<User> user = userService.activateRegistration(key); if (!user.isPresent()) { throw new AccountResourceException("No user was found for this activation key"); } } /** * {@code GET /authenticate} : check if the user is authenticated, and return its login. * * @param request the HTTP request. * @return the login if the user is authenticated. */ @GetMapping("/authenticate") public String isAuthenticated(HttpServletRequest request) { log.debug("REST request to check if the current user is authenticated"); return request.getRemoteUser(); } /** * {@code GET /account} : get the current user. * * @return the current user. * @throws RuntimeException {@code 500 (Internal Server Error)} if the user couldn't be returned. */ @GetMapping("/account") public UserDTO getAccount() { return userService.getUserWithAuthorities() .map(UserDTO::new) .orElseThrow(() -> new AccountResourceException("User could not be found")); } /** * {@code POST /account} : update the current user information. * * @param userDTO the current user information. * @throws EmailAlreadyUsedException {@code 400 (Bad Request)} if the email is already used. * @throws RuntimeException {@code 500 (Internal Server Error)} if the user login wasn't found. */ @PostMapping("/account") public void saveAccount(@Valid @RequestBody UserDTO userDTO) { String userLogin = SecurityUtils.getCurrentUserLogin().orElseThrow(() -> new AccountResourceException("Current user login not found")); Optional<User> existingUser = userRepository.findOneByEmailIgnoreCase(userDTO.getEmail()); if (existingUser.isPresent() && (!existingUser.get().getLogin().equalsIgnoreCase(userLogin))) { throw new EmailAlreadyUsedException(); } Optional<User> user = userRepository.findOneByLogin(userLogin); if (!user.isPresent()) { throw new AccountResourceException("User could not be found"); } userService.updateUser(userDTO.getFirstName(), userDTO.getLastName(), userDTO.getEmail(), userDTO.getLangKey(), userDTO.getImageUrl()); } /** * {@code POST /account/change-password} : changes the current user's password. * * @param passwordChangeDto current and new password. * @throws InvalidPasswordException {@code 400 (Bad Request)} if the new password is incorrect. */ @PostMapping(path = "/account/change-password") public void changePassword(@RequestBody PasswordChangeDTO passwordChangeDto) { if (!checkPasswordLength(passwordChangeDto.getNewPassword())) { throw new InvalidPasswordException(); } userService.changePassword(passwordChangeDto.getCurrentPassword(), passwordChangeDto.getNewPassword()); } /** * {@code POST /account/reset-password/init} : Send an email to reset the password of the user. * * @param mail the mail of the user. * @throws EmailNotFoundException {@code 400 (Bad Request)} if the email address is not registered. */ @PostMapping(path = "/account/reset-password/init") public void requestPasswordReset(@RequestBody String mail) { mailService.sendPasswordResetMail( userService.requestPasswordReset(mail) .orElseThrow(EmailNotFoundException::new) ); } /** * {@code POST /account/reset-password/finish} : Finish to reset the password of the user. * * @param keyAndPassword the generated key and the new password. * @throws InvalidPasswordException {@code 400 (Bad Request)} if the password is incorrect. * @throws RuntimeException {@code 500 (Internal Server Error)} if the password could not be reset. */ @PostMapping(path = "/account/reset-password/finish") public void finishPasswordReset(@RequestBody KeyAndPasswordVM keyAndPassword) { if (!checkPasswordLength(keyAndPassword.getNewPassword())) { throw new InvalidPasswordException(); } Optional<User> user = userService.completePasswordReset(keyAndPassword.getNewPassword(), keyAndPassword.getKey()); if (!user.isPresent()) { throw new AccountResourceException("No user was found for this reset key"); } } private static boolean checkPasswordLength(String password) { return !StringUtils.isEmpty(password) && password.length() >= ManagedUserVM.PASSWORD_MIN_LENGTH && password.length() <= ManagedUserVM.PASSWORD_MAX_LENGTH; } }
[ "jhipster-bot@jhipster.tech" ]
jhipster-bot@jhipster.tech
c30c995f9bf1924d8cfdc7fb91636c010078b9ab
4de08ee9e2b30387d276a731c800ca36744ca1f8
/Plugin/src/main/java/dev/rosewood/rosestacker/stack/settings/entity/MagmaCubeStackSettings.java
e48da65ce5f05a0ba17aca710060871908719e1e
[ "LicenseRef-scancode-other-permissive" ]
permissive
ncgst/RoseStacker
1deeebcb79238d0496816e849b7164007b50c40f
8fd8ad556aa91bf3f3348301893d0bfa314e10ec
refs/heads/master
2023-08-16T07:43:18.050440
2021-10-02T10:38:34
2021-10-02T10:38:34
412,683,396
0
0
NOASSERTION
2021-10-02T03:52:33
2021-10-02T03:52:32
null
UTF-8
Java
false
false
549
java
package dev.rosewood.rosestacker.stack.settings.entity; import com.google.gson.JsonObject; import dev.rosewood.rosegarden.config.CommentedFileConfiguration; import org.bukkit.entity.EntityType; public class MagmaCubeStackSettings extends SlimeStackSettings { public MagmaCubeStackSettings(CommentedFileConfiguration entitySettingsFileConfiguration, JsonObject jsonObject) { super(entitySettingsFileConfiguration, jsonObject); } @Override public EntityType getEntityType() { return EntityType.MAGMA_CUBE; } }
[ "esophose@gmail.com" ]
esophose@gmail.com
dc27866931e58ac716314d0298f5ce683fe86e1b
45e0473a3374ec0cdc2da9db7acc49dcf1658e9a
/src/com/laipai/base/util/LaipaiConstants.java
edd140b657051d058e6c80882fff52e8ed347aff
[]
no_license
yuluoqianmu/WeiChatAPI
881998d2ce56182bb673f61fae8c1b9bc35a1852
2e1080b4d485d94b0f67ccc42dab27d14f6545fb
refs/heads/master
2021-01-10T01:10:34.181057
2016-02-16T03:44:11
2016-02-16T03:44:11
51,801,020
0
0
null
null
null
null
UTF-8
Java
false
false
2,356
java
package com.laipai.base.util; import com.laipai.galaryManInfo.dto.SimpleImage; import com.laipai.laiPaiClubInfo.dto.LpClubBean; import com.laipai.userManInfo.dto.LpUserBean; public class LaipaiConstants { //系统所有图片上传物理路径 public static String UPLOAD_ABSOLUTE_IMG = "/data/laipai/upload"; //系统所有图片展示虚拟路径 public static String UPLOAD_VIRTUAL_IMG ="/upload"; public static final String serverUrl = "http://api.ilaipai.com"; public static final String imgUrl = "http://img.ilaipai.com/"; public static final String UPLOAD_SUBJECT_IMG = "lpSubjectImg"; /*用户头像保存的绝对路径*/ public static final String UPLOAD_USER_PATH = LaipaiConstants.UPLOAD_ABSOLUTE_IMG+LpUserBean.LP_USER_IMGURL; /*专题id*/ public static final String UPLOAD_SUBJECT_PATH = LaipaiConstants.UPLOAD_ABSOLUTE_IMG+ "/lpSubjectImg"; /*来拍摄*/ public static final String UPLOAD_CLUB_PATH = LaipaiConstants.UPLOAD_ABSOLUTE_IMG+LpClubBean.LP_CLUB_IMGURL; /*作品集*/ public static final String UPLOAD_GALARY_PATH = LaipaiConstants.UPLOAD_ABSOLUTE_IMG+SimpleImage.LP_GALLERY_IMGURL; /*作品集原图*/ public static final String UPLOAD_GALARY_SOURCE_PATH = LaipaiConstants.UPLOAD_ABSOLUTE_IMG+SimpleImage.LP_GALLERY_IMGURL; public static final String upload = serverUrl+LaipaiConstants.UPLOAD_VIRTUAL_IMG; //本地测试http接口地址 public static String HTTP_URL = "http://localhost:8080/LaiPai/laiPaiAPPServlet.htm"; //测试环境http接口地址 public static String HTTP_123_TEST = "http://123.56.102.223:8080/LaiPai/laiPaiAPPServlet.htm"; // public static String HTTP_123_ZS = "http://123.56.102.223/LaiPaizs/laiPaiAPPServlet.htm"; private static int verifyCodeLength = 4; public static int getVerifyCodeLength() { return verifyCodeLength; } public static void setVerifyCodeLength(int verifyCodeLength) { LaipaiConstants.verifyCodeLength = verifyCodeLength; } public static String getUPLOAD_ABSOLUTE_IMG() { return UPLOAD_ABSOLUTE_IMG; } public static void setUPLOAD_ABSOLUTE_IMG(String uPLOAD_ABSOLUTE_IMG) { UPLOAD_ABSOLUTE_IMG = uPLOAD_ABSOLUTE_IMG; } public static String getUPLOAD_VIRTUAL_IMG() { return UPLOAD_VIRTUAL_IMG; } public static void setUPLOAD_VIRTUAL_IMG(String uPLOAD_VIRTUAL_IMG) { UPLOAD_VIRTUAL_IMG = uPLOAD_VIRTUAL_IMG; } }
[ "350083890@qq.com" ]
350083890@qq.com
995614735ace8e363fe6fb4274cd918ad1153ce1
ef5bea450f69e1d16dee0cd15e9076da2a427e8f
/app/src/main/java/cn/longmaster/hospital/doctor/core/requests/consult/AddRemarkRequester.java
86cd91f2867e6e3c84a00bd74da5b3e8c3d51d6f
[]
no_license
chengsoft618/Internet_Hospital_Doctor
c9e37e8ce80bf3c303f799406644f1adf4cb10df
b6486de17b2246113bcee26d0ec3f2586828d5f7
refs/heads/master
2021-02-07T20:55:11.939929
2020-01-16T09:10:08
2020-01-16T09:10:08
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,464
java
package cn.longmaster.hospital.doctor.core.requests.consult; import android.support.annotation.NonNull; import org.json.JSONException; import org.json.JSONObject; import java.util.Map; import cn.longmaster.hospital.doctor.core.AppConfig; import cn.longmaster.hospital.doctor.core.requests.OnResultListener; import cn.longmaster.hospital.doctor.core.requests.OpTypeConfig; import cn.longmaster.hospital.doctor.core.requests.SimpleHttpRequester; /** * 给病历添加备注 * Created by Yang² on 2016/7/27. */ public class AddRemarkRequester extends SimpleHttpRequester<Void> { public int appointmentId;//预约ID public int userType;//用户类型 public String remarkDesc;//备注描述 public AddRemarkRequester(@NonNull OnResultListener<Void> onResultListener) { super(onResultListener); } @Override protected String getUrl() { return AppConfig.getClientApiUrl(); } @Override protected int getOpType() { return OpTypeConfig.CLIENTAPI_OPTYE_ADD_REMARK; } @Override protected String getTaskId() { return getOpType() + ""; } @Override protected Void onDumpData(JSONObject data) throws JSONException { return null; } @Override protected void onPutParams(Map<String, Object> params) { params.put("appointment_id", appointmentId); params.put("user_type", userType); params.put("remark_desc", remarkDesc); } }
[ "wangyangguiyang@163.com" ]
wangyangguiyang@163.com
4e18470df70a230a8a29b5f1fa7893d2c6b87495
100b7b21bd72f2291943cbe250d0f4442a9b17c1
/src/main/java/io/gomint/proxprox/network/protocol/PacketChangeDimension.java
1eeb5915fc5d8ceaf6e9a6c8e781ab4cce52a929
[ "BSD-3-Clause" ]
permissive
GWD1/ProxProx
b190ee1e4c8ba13eabcec5cc518e182325462e47
91221154bba881fef222a6f91a445b51aa245fb8
refs/heads/master
2021-10-27T19:40:53.496205
2017-11-27T05:24:36
2017-11-27T05:24:36
112,011,870
1
0
null
2017-11-27T19:39:06
2017-11-25T14:58:35
Java
UTF-8
Java
false
false
1,321
java
/* * Copyright (c) 2016, GoMint, BlackyPaw and geNAZt * * This code is licensed under the BSD license found in the * LICENSE file in the root directory of this source tree. */ package io.gomint.proxprox.network.protocol; import io.gomint.jraknet.PacketBuffer; import io.gomint.proxprox.api.network.Packet; import io.gomint.proxprox.network.Protocol; import lombok.Getter; /** * @author geNAZt * @version 1.0 */ @Getter public class PacketChangeDimension extends Packet { private byte dimension; private float x; private float y; private float z; private byte unknown; /** * Constructor for implemented Packet AddEntity * * @param dimension The dimension we want to travel to */ public PacketChangeDimension( byte dimension ) { super( Protocol.CHANGE_DIMENSION_PACKET ); this.dimension = dimension; } @Override public void serialize( PacketBuffer buffer ) { buffer.writeUnsignedVarInt( this.dimension ); buffer.writeLFloat( this.x ); buffer.writeLFloat( this.y ); buffer.writeLFloat( this.z ); buffer.writeByte( this.unknown ); } @Override public void deserialize( PacketBuffer buffer ) { } @Override public boolean mustBeInBatch() { return false; } }
[ "fabian.fassbender42@googlemail.com" ]
fabian.fassbender42@googlemail.com
65735646741e15fdec5726ab1e1c3cca2c411190
8af1164bac943cef64e41bae312223c3c0e38114
/results-java/ReactiveX--RxJava/b7de349250af69428c2fb45acd83b769a2392a42/before/OperationSample.java
b14998d786e0759e68db914cc9f19fab3e7cbddb
[]
no_license
fracz/refactor-extractor
3ae45c97cc63f26d5cb8b92003b12f74cc9973a9
dd5e82bfcc376e74a99e18c2bf54c95676914272
refs/heads/master
2021-01-19T06:50:08.211003
2018-11-30T13:00:57
2018-11-30T13:00:57
87,353,478
0
0
null
null
null
null
UTF-8
Java
false
false
7,622
java
/** * Copyright 2013 Netflix, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package rx.operators; import static org.mockito.Matchers.*; import static org.mockito.Mockito.*; import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicReference; import org.junit.Before; import org.junit.Test; import org.mockito.InOrder; import rx.Observable; import rx.Observer; import rx.Scheduler; import rx.Subscription; import rx.concurrency.Schedulers; import rx.concurrency.TestScheduler; import rx.subscriptions.Subscriptions; import rx.util.functions.Action0; import rx.util.functions.Func1; /** * Returns an Observable that emits the results of sampling the items emitted by the source * Observable at a specified time interval. * <p> * <img width="640" src="https://github.com/Netflix/RxJava/wiki/images/rx-operators/sample.png"> */ public final class OperationSample { /** * Samples the observable sequence at each interval. */ public static <T> Func1<Observer<? super T>, Subscription> sample(final Observable<? extends T> source, long period, TimeUnit unit) { return new Sample<T>(source, period, unit, Schedulers.executor(Executors.newSingleThreadScheduledExecutor())); } /** * Samples the observable sequence at each interval. */ public static <T> Func1<Observer<? super T>, Subscription> sample(final Observable<? extends T> source, long period, TimeUnit unit, Scheduler scheduler) { return new Sample<T>(source, period, unit, scheduler); } private static class Sample<T> implements Func1<Observer<? super T>, Subscription> { private final Observable<? extends T> source; private final long period; private final TimeUnit unit; private final Scheduler scheduler; private final AtomicBoolean hasValue = new AtomicBoolean(); private final AtomicReference<T> latestValue = new AtomicReference<T>(); private Sample(Observable<? extends T> source, long interval, TimeUnit unit, Scheduler scheduler) { this.source = source; this.period = interval; this.unit = unit; this.scheduler = scheduler; } @Override public Subscription call(final Observer<? super T> observer) { Observable<Long> clock = Observable.create(OperationInterval.interval(period, unit, scheduler)); final Subscription clockSubscription = clock.subscribe(new Observer<Long>() { @Override public void onCompleted() { /* the clock never completes */ } @Override public void onError(Throwable e) { /* the clock has no errors */ } @Override public void onNext(Long tick) { if (hasValue.get()) { observer.onNext(latestValue.get()); } } }); final Subscription sourceSubscription = source.subscribe(new Observer<T>() { @Override public void onCompleted() { clockSubscription.unsubscribe(); observer.onCompleted(); } @Override public void onError(Throwable e) { clockSubscription.unsubscribe(); observer.onError(e); } @Override public void onNext(T value) { latestValue.set(value); hasValue.set(true); } }); return Subscriptions.create(new Action0() { @Override public void call() { clockSubscription.unsubscribe(); sourceSubscription.unsubscribe(); } }); } } public static class UnitTest { private TestScheduler scheduler; private Observer<Long> observer; @Before @SuppressWarnings("unchecked") // due to mocking public void before() { scheduler = new TestScheduler(); observer = mock(Observer.class); } @Test public void testSample() { Observable<Long> source = Observable.create(new Func1<Observer<? super Long>, Subscription>() { @Override public Subscription call(final Observer<? super Long> observer1) { scheduler.schedule(new Action0() { @Override public void call() { observer1.onNext(1L); } }, 1, TimeUnit.SECONDS); scheduler.schedule(new Action0() { @Override public void call() { observer1.onNext(2L); } }, 2, TimeUnit.SECONDS); scheduler.schedule(new Action0() { @Override public void call() { observer1.onCompleted(); } }, 3, TimeUnit.SECONDS); return Subscriptions.empty(); } }); Observable<Long> sampled = Observable.create(OperationSample.sample(source, 400L, TimeUnit.MILLISECONDS, scheduler)); sampled.subscribe(observer); InOrder inOrder = inOrder(observer); scheduler.advanceTimeTo(800L, TimeUnit.MILLISECONDS); verify(observer, never()).onNext(any(Long.class)); verify(observer, never()).onCompleted(); verify(observer, never()).onError(any(Throwable.class)); scheduler.advanceTimeTo(1200L, TimeUnit.MILLISECONDS); inOrder.verify(observer, times(1)).onNext(1L); verify(observer, never()).onNext(2L); verify(observer, never()).onCompleted(); verify(observer, never()).onError(any(Throwable.class)); scheduler.advanceTimeTo(1600L, TimeUnit.MILLISECONDS); inOrder.verify(observer, times(1)).onNext(1L); verify(observer, never()).onNext(2L); verify(observer, never()).onCompleted(); verify(observer, never()).onError(any(Throwable.class)); scheduler.advanceTimeTo(2000L, TimeUnit.MILLISECONDS); inOrder.verify(observer, never()).onNext(1L); inOrder.verify(observer, times(1)).onNext(2L); verify(observer, never()).onCompleted(); verify(observer, never()).onError(any(Throwable.class)); scheduler.advanceTimeTo(3000L, TimeUnit.MILLISECONDS); inOrder.verify(observer, never()).onNext(1L); inOrder.verify(observer, times(2)).onNext(2L); verify(observer, times(1)).onCompleted(); verify(observer, never()).onError(any(Throwable.class)); } } }
[ "fraczwojciech@gmail.com" ]
fraczwojciech@gmail.com
939eb2953388c7b7eb0f8c9cd4b8b65d2f29e978
39bb67d27c696a47e82ced53bb77a8cce9b87d7f
/src/design_mode/chain_of_responsibility/entity_logicalOperation/OfficialHandler.java
a71240e6ad34133e6c94712675b46d99cd50d4fd
[]
no_license
Automannn/designMode
1976a3b64c105c089cb847de9774f98180e7357a
a5d2516f1c583afabacac6b617eb14091ddfa6f4
refs/heads/master
2020-03-30T12:27:54.029735
2018-10-02T09:11:41
2018-10-02T09:12:20
151,225,471
0
0
null
null
null
null
UTF-8
Java
false
false
593
java
package design_mode.chain_of_responsibility.entity_logicalOperation; import com.automannn.design_mode.chain_of_responsibility.OOP_class.BaseHandler; /** * @author automannn@163.com * @time 2018/9/18 18:50 */ public class OfficialHandler extends BaseHandler { private String name; public OfficialHandler(String name) { this.name = name; } @Override public void operate() { System.out.println(name+"接收到了通知,将立即通知下级部门马上处理"); if (getHandler() != null){ getHandler().operate(); } } }
[ "Automannn@163.com" ]
Automannn@163.com
368a197fe2d0681d93b135c6f1d6c63e3af8f6d3
ad64a14fac1f0d740ccf74a59aba8d2b4e85298c
/linkwee-supermarket/src/main/java/com/linkwee/web/service/ActivityListService.java
64804b40a261fd79d18ec02bd28b4a86025e315d
[]
no_license
zhangjiayin/supermarket
f7715aa3fdd2bf202a29c8683bc9322b06429b63
6c37c7041b5e1e32152e80564e7ea4aff7128097
refs/heads/master
2020-06-10T16:57:09.556486
2018-10-30T07:03:15
2018-10-30T07:03:15
193,682,975
0
1
null
2019-06-25T10:03:03
2019-06-25T10:03:03
null
UTF-8
Java
false
false
3,927
java
package com.linkwee.web.service; import java.math.BigDecimal; import java.util.List; import java.util.Map; import com.linkwee.api.activity.response.NewYearHelpStatusResponse; import com.linkwee.api.activity.response.YearStaPersonAchiResponse; import com.linkwee.api.activity.response.YearStaTeamAchiResponse; import com.linkwee.api.response.activity.YearMaxProfitUserResponse; import com.linkwee.core.base.api.PaginatorResponse; import com.linkwee.core.datatable.DataTable; import com.linkwee.core.datatable.DataTableReturn; import com.linkwee.core.generic.GenericService; import com.linkwee.core.orm.paging.Page; import com.linkwee.web.model.ActivityList; /** * * 描述:精彩活动 * @author yalin * @date 2016年7月26日 下午6:15:07 * Copyright (c) 深圳市前海领会科技有限公司 */ public interface ActivityListService extends GenericService<ActivityList,Long>{ /** * 查询所有精彩活动 * @param req * @return */ public PaginatorResponse<ActivityList> queryActivities(Page<ActivityList> page,Map<String,Object> conditions); /** * 查询ActivityList列表,为data-tables封装 * @param dataTable * @return */ DataTableReturn selectByDatatables(DataTable dataTable, String actitityName); /** * 活动平台(有封面的平台) * @param page * @param conditions * @return */ public PaginatorResponse<ActivityList> queryActivitiesByPlatform(Page<ActivityList> page, Map<String, Object> conditions); /** * 某个平台的活动列表(分页) * @param page * @param conditions * @return */ public PaginatorResponse<ActivityList> queryActivitiesListByPlatform(Page<ActivityList> page, Map<String, Object> conditions); /** * 某个平台的活动列表(不分页) * @param conditions * @return */ public List<ActivityList> queryPlatformActivities(Map<String, Object> conditions); /** * 最新开始的活动 * @return */ public ActivityList queryNewest(Integer appType); /** * 根据活动名称(模糊检索)和活动平台查活动 * @param activityName * @param activityPlatform * @return */ public List<ActivityList> queryActivity(String activityName,String activityPlatform); /** * 根据code查活动 * @param activityCode * @return */ public ActivityList queryByCode(String activityCode); /** * 当前时间在活动期间的活动 * @param selectCondition * @return */ public ActivityList selectActiveOne(ActivityList selectCondition); /** * 中秋节活动--子活动列表 * @param conditions * @return */ public List<ActivityList> querySubActivitiesList(Map<String, Object> conditions); /** * 2017年度账单个人成绩 * @param userId * @return */ public YearStaPersonAchiResponse yearStatiPersonAchievement(String userId); /** * 团队理财师 * @param userId * @return */ public List<String> teamCfp(String userId); /** * 2017年度账单团队成绩 * @param teamCfpList * @return */ public YearStaTeamAchiResponse yearTeamAchievement(List<String> teamCfpList); /** * 2017年度账单获取佣金最多的客户信息 * @param userId * @return */ public YearMaxProfitUserResponse yearMaxProfitUser(String userId); /** * 新年活动奖励状况 * @param userId * @return */ public NewYearHelpStatusResponse newYearHelpStatus(String userId,String startTime,String endTime); /** * 新年活动最大业绩(自己和直接推荐理财师出单) * @param startTime * @param endTime * @return */ public BigDecimal newYearMaxSaleAmount(String startTime,String endTime); /** * 根据A平台查询A平台相关的活动 * @param orgNumber * @return */ public List<ActivityList> queryOrginfoaActivityList(String orgNumber); }
[ "liqimoon@qq.com" ]
liqimoon@qq.com
69ec47d0cf9be5eb05a85006a8de09896aa49c60
0ac05e3da06d78292fdfb64141ead86ff6ca038f
/OSWE/oswe/openCRX/rtjar/rt.jar.src/sun/misc/JavaNetAccess.java
644cb950059752511c75ad7dbbe075f529a6220d
[]
no_license
qoo7972365/timmy
31581cdcbb8858ac19a8bb7b773441a68b6c390a
2fc8baba4f53d38dfe9c2b3afd89dcf87cbef578
refs/heads/master
2023-07-26T12:26:35.266587
2023-07-17T12:35:19
2023-07-17T12:35:19
353,889,195
7
1
null
null
null
null
UTF-8
Java
false
false
419
java
package sun.misc; import java.net.InetAddress; import java.net.URLClassLoader; public interface JavaNetAccess { URLClassPath getURLClassPath(URLClassLoader paramURLClassLoader); String getOriginalHostName(InetAddress paramInetAddress); } /* Location: /Users/timmy/timmy/OSWE/oswe/openCRX/rt.jar!/sun/misc/JavaNetAccess.class * Java compiler version: 8 (52.0) * JD-Core Version: 1.1.3 */
[ "t0984456716" ]
t0984456716
a1e4fcdf46fdd6b917ef92c3310830d1363f4eb6
247284c42d81900eee055977b88c97aed27ee681
/ch.elexis.core.data/src/ch/elexis/views/textsystem/PlatzhalterTreeData.java
f7da95319f0e6c2bf9e4fd3b03ab19910713062f
[]
no_license
elexis/elexis-next
6d982c5b11eae57f62385b802356de6d8f8a7bec
e760412d2d431b0ff291538376790d23875bc1fb
refs/heads/master
2020-05-19T07:58:56.760253
2013-06-26T10:25:44
2013-06-26T10:25:44
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,641
java
/******************************************************************************* * Copyright (c) 2007-2011, G. Weirich and Elexis * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * G. Weirich - initial API and implementation ******************************************************************************/ package ch.elexis.views.textsystem; import java.util.Comparator; import java.util.List; import ch.elexis.util.SortedList; public class PlatzhalterTreeData { private PlatzhalterTreeData parent; final private SortedList<PlatzhalterTreeData> childrenList = new SortedList<PlatzhalterTreeData>(new TreeComparator()); final private String name; final private String key; final private String description; class TreeComparator implements Comparator<PlatzhalterTreeData> { public int compare(PlatzhalterTreeData o1, PlatzhalterTreeData o2){ return o1.getName().compareTo(o2.getName()); } }; public PlatzhalterTreeData(final PlatzhalterTreeData _parent, final String _name, final String _key, final String _description){ super(); if (parent != null) { if (_name.startsWith(parent.getName())) { this.name = _name.substring(parent.getName().length()); } else { this.name = _name; } } else { this.name = _name; } this.key = _key; this.description = _description; setParent(_parent); } public PlatzhalterTreeData(final String _name, final String _key, final String _description){ this(null, _name, _key, _description); } public PlatzhalterTreeData getChild(final String name){ for (PlatzhalterTreeData ptd : childrenList) { if (name.equals(ptd.getName())) { return ptd; } } return null; } public void addChild(final PlatzhalterTreeData child){ if (!childrenList.contains(child)) { childrenList.add(child); } } public void addChildren(final List<PlatzhalterTreeData> children){ for (PlatzhalterTreeData ptd : children) { addChild(ptd); } } private void setParent(final PlatzhalterTreeData _parent){ if (_parent != null) { this.parent = _parent; this.parent.addChild(this); } } public SortedList<PlatzhalterTreeData> getChildren(){ return childrenList; } public PlatzhalterTreeData getParent(){ return this.parent; } public String getDescription(){ return this.description; } public String getName(){ return this.name; } public String getKey(){ return this.key; } }
[ "marco@descher.at" ]
marco@descher.at
3c3b3c26279d65a4d3d6c62d11e5a1afb817f8ab
f1697fd34ce1af3a31e7af546cd8dbdff5ae5281
/app/src/main/java/github/tornaco/xposedmoduletest/xposed/submodules/SubModule.java
89640081c7f41154b86001e6815415d80cf0065c
[]
no_license
starscryer/X-APM-1
3529ee4ea2b7dba0cf2d5f1852e8ec69c997d0f8
1f459846059042de2e75cebcfe469bac1904ab19
refs/heads/master
2020-12-26T07:49:45.289068
2020-01-23T15:58:18
2020-01-23T15:58:18
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,054
java
package github.tornaco.xposedmoduletest.xposed.submodules; import java.util.Set; import de.robv.android.xposed.IXposedHookZygoteInit; import de.robv.android.xposed.callbacks.XC_LoadPackage; import github.tornaco.xposedmoduletest.xposed.service.IModuleBridge; /** * Created by guohao4 on 2017/10/30. * Email: Tornaco@163.com */ public interface SubModule { void onBridgeCreate(IModuleBridge bridge); void handleLoadingPackage(String pkg, XC_LoadPackage.LoadPackageParam lpparam); void initZygote(IXposedHookZygoteInit.StartupParam startupParam); Set<String> getInterestedPackages(); SubModuleStatus getStatus(); String getErrorMessage(); String name(); String needBuildVar(); enum SubModuleStatus { UNKNOWN, ERROR, READY; public static SubModuleStatus valueOf(int i) { for (SubModuleStatus s : values()) { if (i == s.ordinal()) return s; } return UNKNOWN; } } }
[ "tornaco@163.com" ]
tornaco@163.com
f84eb8d4a4603a96b3cc12c92d6a8a110f6c30bd
3ca934c5e29147bffc57a7212a450681d12b12ce
/Code/functional-testing/desktop-page-objects/src/main/java/com/hotwire/selenium/desktop/travelsavingsindicator/TravelSavingsIndicatorPage.java
8ab310b854f115f2f68f7ad70edf9dc7f05fbc2b
[]
no_license
amitoj/spring_cucumber
8af821fd183e8a1ce049a3dc326dac9d80fc3e9a
fd4d207bca1645fb6f0465d1e016bfc607b39b43
refs/heads/master
2020-09-04T00:23:35.762856
2017-04-19T15:27:51
2017-04-19T15:27:51
null
0
0
null
null
null
null
UTF-8
Java
false
false
903
java
/* * Copyright 2014 Hotwire. All Rights Reserved. * * This software is the proprietary information of Hotwire. * Use is subject to license terms. */ package com.hotwire.selenium.desktop.travelsavingsindicator; import org.openqa.selenium.By; import org.openqa.selenium.NoSuchElementException; import org.openqa.selenium.WebDriver; import com.hotwire.selenium.desktop.us.AbstractUSPage; /** * @author vjong * */ public class TravelSavingsIndicatorPage extends AbstractUSPage { public TravelSavingsIndicatorPage(WebDriver webdriver) { super(webdriver, "tiles-def.spotlight.hotel-rate-report"); } public boolean isSavingsIndicatorTableDisplayed() { try { return getWebDriver().findElement(By.cssSelector(".columnLeft .universalVariant img")).isDisplayed(); } catch (NoSuchElementException e) { return false; } } }
[ "jiniguez@foundationmedicine.com" ]
jiniguez@foundationmedicine.com
d39de6edd77123f640f9df0356a885631f4f650b
d876db09f1299636d425731f7c68230233c00a25
/src/main/java/be/fgov/famhp/pharmastatus/extrar/config/FeignConfiguration.java
2ea5cbe524f2d7e91c52d00ecdad43593de75d90
[]
no_license
cedricclaus/pharma-status-extrar-inital
970e86c711c4059c85bba2c43eddc50b08bd09fd
2ff019526b74cc27007766f9dc75d785fda7c0d3
refs/heads/master
2020-06-11T21:38:13.891262
2019-06-27T12:48:16
2019-06-27T12:48:16
null
0
0
null
null
null
null
UTF-8
Java
false
false
704
java
package be.fgov.famhp.pharmastatus.extrar.config; import org.springframework.cloud.openfeign.EnableFeignClients; import org.springframework.cloud.openfeign.FeignClientsConfiguration; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; @Configuration @EnableFeignClients(basePackages = "be.fgov.famhp.pharmastatus.extrar") @Import(FeignClientsConfiguration.class) public class FeignConfiguration { /** * Set the Feign specific log level to log client REST requests. */ @Bean feign.Logger.Level feignLoggerLevel() { return feign.Logger.Level.BASIC; } }
[ "jhipster-bot@jhipster.tech" ]
jhipster-bot@jhipster.tech
c36c6b079fa32a4621608933b9defb9812e9a99f
c3101515ddde8a6e6ddc4294a4739256d1600df0
/GeneralApp__2.20_1.0(1)_source_from_JADX/sources/com/navibees/navigatorapp/data/Prefs.java
bf0af450c718e17ddac001f84fad6113ba7c76ef
[]
no_license
Aelshazly/Carty
b56fdb1be58a6d12f26d51b46f435ea4a73c8168
d13f3a4ad80e8a7d0ed1c6a5720efb4d1ca721ee
refs/heads/master
2022-11-14T23:29:53.547694
2020-07-08T19:23:39
2020-07-08T19:23:39
278,175,183
0
0
null
null
null
null
UTF-8
Java
false
false
3,857
java
package com.navibees.navigatorapp.data; import android.content.Context; import android.content.SharedPreferences; import android.content.SharedPreferences.Editor; import com.navibees.navigatorapp.models.AgendaData; public class Prefs { public static String AGENDA = "agenda"; public static String IS_ADMIN = "isAdmin"; private static final String OPERATION_DATA = "OPERATION_DATA"; private static final String OPERATION_IS_USER_ADMIN = "OPERATION_IS_USER_ADMIN"; private static final String OPERATION_USERNAME_DATA = "OPERATION_USERNAME_DATA"; private static final String OPERATION_VENUE_ID = "OPERATION_VENUE_ID"; private static final String OPERATION_VENUE_NAME_DATA = "OPERATION_VENUE_NAME_DATA"; private static Prefs ourInstance; private Editor editor = this.prefs.edit(); private SharedPreferences prefs; public static Prefs getInstance(Context applicationContext) { if (ourInstance == null) { ourInstance = new Prefs(applicationContext); } return ourInstance; } private Prefs(Context mContext) { this.prefs = mContext.getSharedPreferences("operationsPrefs", 0); } public void saveOperationData(String operationData) { this.editor.putString(OPERATION_DATA, operationData).commit(); } public void saveOperationUsername(String username) { this.editor.putString(OPERATION_USERNAME_DATA, username).commit(); } public void saveOperationVenue(String venueName, String venueId) { this.editor.putString(OPERATION_VENUE_NAME_DATA, venueName); this.editor.putString(OPERATION_VENUE_ID, venueId); this.editor.commit(); } public void saveOperationUserType(boolean userType) { this.editor.putBoolean(OPERATION_IS_USER_ADMIN, userType).commit(); } public void saveKey(String key, String val) { this.editor = this.prefs.edit(); this.editor.putString(key, val); this.editor.apply(); } public void saveKey(String key, int val) { this.editor = this.prefs.edit(); this.editor.putInt(key, val); this.editor.apply(); } public void saveKey(String key, boolean val) { this.editor = this.prefs.edit(); this.editor.putBoolean(key, val); this.editor.apply(); } public String getStringValue(String key) { return this.prefs.getString(key, null); } public int getIntValue(String key) { return this.prefs.getInt(key, -1); } public boolean getBooleanValue(String key) { return this.prefs.getBoolean(key, false); } public void saveAgendaData(AgendaData val) { this.editor = this.prefs.edit(); this.editor.putString(AGENDA, val.toString()); this.editor.apply(); } public AgendaData getAgendaData() { return AgendaData.fromString(this.prefs.getString(AGENDA, null)); } public int getInt(String key) { return this.prefs.getInt(key, -1); } public String getString(String key) { return this.prefs.getString(key, null); } public void save(String key, int val) { this.editor.putInt(key, val).commit(); } public String getOperationData() { return this.prefs.getString(OPERATION_DATA, null); } public String getOperationUsername() { return this.prefs.getString(OPERATION_USERNAME_DATA, ""); } public String getOperationVenueName() { return this.prefs.getString(OPERATION_VENUE_NAME_DATA, ""); } public String getOperationVenueId() { return this.prefs.getString(OPERATION_VENUE_ID, ""); } public boolean getOperationUserIsAdmin() { return this.prefs.getBoolean(OPERATION_IS_USER_ADMIN, false); } public void clearPref() { saveOperationUsername(""); } }
[ "aelshazly@engineer.com" ]
aelshazly@engineer.com
c498db03e51009c95813f6a6cf2a8002b4a364a9
5252a00843c6082d739d7a00142525fff0a2f3e7
/zoeeasy-cloud-platform/zoeeasy-cloud-modules/zoeeasy-cloud-gather/zoeeasy-cloud-gather-api/src/main/java/com/zoeeasy/cloud/gather/magnetic/dto/request/fushang/FuShangRegisterBodyRequestDto.java
0c259dc461f51d579d3455732a758709da949bdd
[]
no_license
P79N6A/parking
be8dc0ae6394096ec49faa89521d723425a5c965
6e3ea14312edc7487f725f2df315de989eaabb10
refs/heads/master
2020-05-07T22:07:03.790311
2019-04-12T03:06:26
2019-04-12T03:06:26
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,725
java
package com.zoeeasy.cloud.gather.magnetic.dto.request.fushang; import com.scapegoat.infrastructure.core.dto.basic.BaseDto; import com.zoeeasy.cloud.gather.magnetic.cst.InMotionConstant; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; import org.hibernate.validator.constraints.NotBlank; import javax.validation.constraints.NotNull; import java.io.Serializable; /** * 富尚注册数据推送主体请求参数 * * @Date: 2018/12/5 * @author: lhj */ @Data @EqualsAndHashCode(callSuper = false) @ApiModel(value = "FuShangRegisterBodyRequestDto", description = "富尚注册数据推送主体请求参数") public class FuShangRegisterBodyRequestDto extends BaseDto implements Serializable { private static final long serialVersionUID = 1L; /** * 停车场编号 */ @ApiModelProperty(value = "停车场编号") @NotNull(message = InMotionConstant.PARKING_INFO_PARKING_CODE_NOT_NULL) private Integer parkID; /** * 上报时间 */ @ApiModelProperty(value = "上报时间") @NotBlank(message = InMotionConstant.IN_MOTION_HEART_BEAT_TIME_NOT_NULL) private String time; /** * 设备Id */ @ApiModelProperty("设备Id") @NotBlank(message = InMotionConstant.IN_MOTION_HEART_BEAT_DEVICE_ID_NOT_NULL) private String deviceID; /** * 版本 */ @ApiModelProperty("版本") @NotBlank(message = InMotionConstant.VERSION_NOT_NULL) private String version; /** * 校验和 */ @ApiModelProperty("校验和") @NotBlank(message = InMotionConstant.IN_MOTION_HEART_BEAT_TOKEN_NOT_NULL) private String token; }
[ "xuqinghuo@126.com" ]
xuqinghuo@126.com
40bb63418f2389695a0f7db0491913a20fbaa02e
377e5e05fb9c6c8ed90ad9980565c00605f2542b
/.gitignore/bin/ext-commerce/basecommerce/testsrc/de/hybris/platform/storelocator/impl/GeoWebServiceWrapperTest.java
918a950675f0b68bd91d091e54288d2cdb1555bb
[]
no_license
automaticinfotech/HybrisProject
c22b13db7863e1e80ccc29774f43e5c32e41e519
fc12e2890c569e45b97974d2f20a8cbe92b6d97f
refs/heads/master
2021-07-20T18:41:04.727081
2017-10-30T13:24:11
2017-10-30T13:24:11
108,957,448
0
0
null
null
null
null
UTF-8
Java
false
false
2,984
java
/* * [y] hybris Platform * * Copyright (c) 2000-2016 SAP SE or an SAP affiliate company. * All rights reserved. * * This software is the confidential and proprietary information of SAP * ("Confidential Information"). You shall not disclose such Confidential * Information and shall use it only in accordance with the terms of the * license agreement you entered into with SAP. * * */ package de.hybris.platform.storelocator.impl; import de.hybris.bootstrap.annotations.ManualTest; import de.hybris.platform.servicelayer.ServicelayerTest; import de.hybris.platform.storelocator.GPS; import de.hybris.platform.storelocator.GeoWebServiceWrapper; import de.hybris.platform.storelocator.data.AddressData; import de.hybris.platform.storelocator.location.Location; import de.hybris.platform.storelocator.route.DistanceAndRoute; import javax.annotation.Resource; import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.mockito.BDDMockito; import org.mockito.Mock; import org.mockito.MockitoAnnotations; @ManualTest public class GeoWebServiceWrapperTest extends ServicelayerTest { @Resource private GeoWebServiceWrapper geoServiceWrapper; @Mock private Location start; @Mock private Location dest; @Before public void setUp() { MockitoAnnotations.initMocks(this); } @Test public void testGetLeedsCoordinates() { final AddressData address = new AddressData(); address.setCity("Leeds"); final GPS gps = geoServiceWrapper.geocodeAddress(address); Assert.assertEquals(-1.549416d, gps.getDecimalLongitude(), 0.01); Assert.assertEquals(53.805517d, gps.getDecimalLatitude(), 0.01); } @Test public void testGetBerlinCoordinates() { final AddressData address = new AddressData(); address.setCity("Berlin"); final GPS gps = geoServiceWrapper.geocodeAddress(address); Assert.assertEquals(13.4060912d, gps.getDecimalLongitude(), 0.01); Assert.assertEquals(52.5191710d, gps.getDecimalLatitude(), 0.01); } @Test public void testDistanceFromLondonToLeeds() { final AddressData londonAddress = new AddressData(); londonAddress.setCity("London"); final AddressData leedsAddress = new AddressData(); leedsAddress.setCity("Leeds"); final GPS londonGps = geoServiceWrapper.geocodeAddress(londonAddress); final GPS leedsGps = geoServiceWrapper.geocodeAddress(leedsAddress); BDDMockito.given(start.getAddressData()).willReturn(londonAddress); BDDMockito.given(dest.getAddressData()).willReturn(leedsAddress); BDDMockito.given(start.getGPS()).willReturn(londonGps); BDDMockito.given(dest.getGPS()).willReturn(leedsGps); final DistanceAndRoute route = geoServiceWrapper.getDistanceAndRoute(start, dest); Assert.assertNotNull(route); Assert.assertEquals(272.0, route.getEagleFliesDistance(), 1); Assert.assertEquals(313306.0, route.getRoadDistance(), 1); Assert.assertNotNull(route.getRoute()); } }
[ "santosh.kshirsagar@automaticinfotech.com" ]
santosh.kshirsagar@automaticinfotech.com
0bdfa670929bd8dab65892c8ab6df41f994a041a
94d91903819947c4fb2598af40cf53344304dbac
/wssmall_1.2.0/base_module/base/src/main/java/com/ztesoft/mq/example/rocketmq/transaction/ReceiveExample.java
4a7ff4c2e3bdfa43f9a65849fe1773c56a2dd719
[]
no_license
lichao20000/Union
28175725ad19733aa92134ccbfb8c30570f4795a
a298de70065c5193c98982dacc7c2b3e2d4b5d86
refs/heads/master
2023-03-07T16:24:58.933965
2021-02-22T12:34:05
2021-02-22T12:34:05
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,501
java
package com.ztesoft.mq.example.rocketmq.transaction; import java.util.Set; import org.apache.log4j.Logger; import com.ztesoft.mq.client.EventMessageExt; import com.ztesoft.mq.client.EventQueue; import com.ztesoft.mq.client.rocketMQ.RocketMQEventTemplateGeneral; import com.ztesoft.mq.client.rocketMQ.RocketReceiveEventTemplate; public class ReceiveExample extends TransactionExample { private static Logger logger = Logger.getLogger(ReceiveExample.class); private String action = "SimpleTransactionTest"; public ReceiveExample() { this.init(); } public void executeSyncReceive() { RocketReceiveEventTemplate template = null; try { template = RocketMQEventTemplateGeneral .createRocketMQReceiveTemplate(this.TEST_CONSUMER_POOL); Set<EventQueue> queues = template .searchQueuer(this.topic); for (EventQueue queue : queues) { logger.info(".....receive from queue " + queue.getQueueId()); EventMessageExt messageExt = template.receiveEventMessage( queue, action); if (messageExt != null) { logger.info("receive message: " + messageExt.toString()); } } } catch (Exception e) { e.printStackTrace(); } finally { try { RocketMQEventTemplateGeneral.closeRocketMQReceiveTemplate( this.TEST_CONSUMER_POOL, template); } catch (Exception e) { e.printStackTrace(); } } } public static void main(String[] args) { ReceiveExample example = new ReceiveExample(); example.executeSyncReceive(); } }
[ "hxl971230.outlook.com" ]
hxl971230.outlook.com
1f4eeae80d9e69fa645ceac5754ee1bae0c5262d
b39cbeaeb411968d6fa3c059b833fe4c06852a33
/src/Chapter8/Task18/Unicycle.java
f5962337aee29db58ff89d90690514b04a73516b
[]
no_license
AvdeevaElena/FromBookEckel_JavaSE
1e11b3265f3f84306fdf9d74a55e622a32fdafc9
89ff1b084a9d1c6ff69b05333d57fbea7c0b9620
refs/heads/master
2020-04-16T17:19:37.451624
2019-01-15T02:42:18
2019-01-15T02:42:18
null
0
0
null
null
null
null
UTF-8
Java
false
false
229
java
package Chapter8.Task18; public class Unicycle extends Cycle { @Override public String toString() { return "Unicycle"; } public void balance() { System.out.println("Unicycle balance"); } }
[ "avdeevaelena5@gmail.com" ]
avdeevaelena5@gmail.com
96b47dfaf140d2ceda10e6499256301eaa65a940
73458087c9a504dedc5acd84ecd63db5dfcd5ca1
/src/b/a/a/f.java
f772072d9bcf5979d3615f5df146287ff443d97b
[]
no_license
jtap60/com.estr
99ff2a6dd07b02b41a9cc3c1d28bb6545e68fb27
8b70bf2da8b24c7cef5973744e6054ef972fc745
refs/heads/master
2020-04-14T02:12:20.424436
2018-12-30T10:56:45
2018-12-30T10:56:45
163,578,360
0
0
null
null
null
null
UTF-8
Java
false
false
194
java
package b.a.a; public abstract interface f extends a { public abstract e a(); } /* Location: * Qualified Name: b.a.a.f * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */
[ "reverseengineeringer@hackeradmin.com" ]
reverseengineeringer@hackeradmin.com
38a2d3769d6f6dec243ebe07e38001ff9e8fad75
180e78725121de49801e34de358c32cf7148b0a2
/dataset/protocol1/neo4j/learning/5655/Action.java
02104c28dadd5a93a64942926107cd305f530c61
[]
no_license
ASSERT-KTH/synthetic-checkstyle-error-dataset
40e8d1e0a7ebe7f7711def96a390891a6922f7bd
40c057e1669584bfc6fecf789b5b2854660222f3
refs/heads/master
2023-03-18T12:50:55.410343
2019-01-25T09:54:39
2019-01-25T09:54:39
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,880
java
/* * Copyright (c) 2002-2018 "Neo4j," * Neo4j Sweden AB [http://neo4j.com] * * This file is part of Neo4j. * * Neo4j is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package org.neo4j.io.pagecache.randomharness; abstract class Action { private final Command command; private final String format; private final Object[] parameters; private final Action innerAction; protected Action( Command command, String format, Object... parameters ) { this( command, null, format, parameters ); } protected Action( Command command, Action innerAction, String format, Object... parameters ) { this.command = command; this.format = format; this.parameters = parameters; this.innerAction = innerAction; } abstract void perform() throws Exception; protected void performInnerAction() throws Exception { if ( innerAction != null ) { innerAction.perform(); } } @Override public String toString() { if ( innerAction == null ) { return String.format( command + format, parameters ); } else { return String.format( command + format + ", and then " + innerAction, parameters ); } } }
[ "bloriot97@gmail.com" ]
bloriot97@gmail.com
4fc4d57d6f1585baa448123e18c67e2633fbf5d5
5124c83de0ce2ebd73b7a4edd1dc6edfc3523af5
/Aurora-2.5/org/spongepowered/asm/mixin/injection/struct/ModifyConstantInjectionInfo.java
60930e2c6e3c94a3773a7233479383eb82472299
[]
no_license
Sixtieth/rip-aurora
44306d2b97f7c14e805724dac7afd2f36af0caeb
30665f17ea09f4995569de887fd14d9ff942b36b
refs/heads/master
2022-11-26T15:28:27.287942
2020-08-08T22:04:45
2020-08-08T22:04:45
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,247
java
package org.spongepowered.asm.mixin.injection.struct; import org.spongepowered.asm.mixin.injection.Constant; import com.google.common.base.Strings; import org.spongepowered.asm.mixin.injection.invoke.ModifyConstantInjector; import org.spongepowered.asm.mixin.injection.code.Injector; import java.util.Iterator; import org.spongepowered.asm.mixin.injection.points.BeforeConstant; import org.spongepowered.asm.lib.Type; import com.google.common.collect.ImmutableList; import java.util.List; import org.spongepowered.asm.lib.tree.AnnotationNode; import org.spongepowered.asm.lib.tree.MethodNode; import org.spongepowered.asm.mixin.transformer.MixinTargetContext; public class ModifyConstantInjectionInfo extends InjectionInfo { private static final String CONSTANT_ANNOTATION_CLASS; public ModifyConstantInjectionInfo(final MixinTargetContext mixin, final MethodNode method, final AnnotationNode annotation) { super(mixin, method, annotation, "constant"); } @Override protected List<AnnotationNode> readInjectionPoints(final String type) { List<AnnotationNode> ats = super.readInjectionPoints(type); if (ats.isEmpty()) { final AnnotationNode c = new AnnotationNode(ModifyConstantInjectionInfo.CONSTANT_ANNOTATION_CLASS); c.visit("log", Boolean.TRUE); ats = (List<AnnotationNode>)ImmutableList.of((Object)c); } return ats; } @Override protected void parseInjectionPoints(final List<AnnotationNode> ats) { final Type returnType = Type.getReturnType(this.method.desc); for (final AnnotationNode at : ats) { this.injectionPoints.add(new BeforeConstant(this.getContext(), at, returnType.getDescriptor())); } } @Override protected Injector parseInjector(final AnnotationNode injectAnnotation) { return new ModifyConstantInjector(this); } @Override protected String getDescription() { return "Constant modifier method"; } @Override public String getSliceId(final String id) { return Strings.nullToEmpty(id); } static { CONSTANT_ANNOTATION_CLASS = Constant.class.getName().replace('.', '/'); } }
[ "adadadw123@gmail.com" ]
adadadw123@gmail.com
fc41d9e13fd6dee9e6eeb6d5737502745b6b65b9
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/8/8_0aff8eef2bb9b332ea7791847cd109c54efef8bd/main/8_0aff8eef2bb9b332ea7791847cd109c54efef8bd_main_s.java
7cdacc50b522c56e502cf359d3c4c19c990ebb7b
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
2,580
java
/* Author: Erik Youngren <eyoungre@callutheran.edu> Date Created: 2010-00-00 Purpose ======= Solution to Programming Exercise 8.5 (8e), 7.5 (7e). Using the `GregorianCalendar` class Java API has the `GregorianCalendar` class in the java.util package that can be used to obtain the year, month, and day of a date. The no-arg constructor constructs an instance for the current date, and the methods `get(GregorianCalendar.YEAR)`, `get(GregorianCalendar.MONTH)`, and `get(GregorianCalendar.DAY_OF_MONTH)` return the year, month, and day. Write a program to perform two tasks: * Display the current year, month and day. * The `GregorianCalendar` class has the `setTimeInMillis(long)`, which can be used to set a specified elapsed time since January 1, 1970. Set the value to 1234567898765L and display the year, month, and day. .. note:: Did this exact exercise in the last class. Yay! Hmm. Good thing it wasn't collected, though. I typoed the `setTimeInMillis()` part. 123456789L instead of the correct 1234567898765L. .. note:: Obligatory related XKCD Comic: http://www.xkcd.com/376/ "Bug" Document History ================ ============= ================================================================== Date Modified Reason ============= ================================================================== 2010-00-00 Document Created ============= ================================================================== */ /** * Driver class */ class main { public static void main (String[] args) { GregorianCalendar date = new GregorianCalendar(); System.out.println(String.format( "Current Date: %s", Calendar.print_date(date))); long millis = 1234567898765L; date.setTimeInMillis(millis); System.out.println(String.format( "Date at %d milli-seconds past Unix Epoch: %s", millis, Calendar.print_date(date))); } /** * Creates a string representing the date in the format specified. * * @param GregorianCalendar date * * @return String representation of the date */ public static String print_date(GregorianCalendar date) { return String.format( "%d-%d-%d %d:%d:%d.%d", date.get(GregorianCalendar.YEAR), date.get(GregorianCalendar.MONTH), date.get(GregorianCalendar.DAY_OF_MONTH), date.get(GregorianCalendar.HOUR), date.get(GregorianCalendar.MINUTE), date.get(GregorianCalendar.SECOND), date.get(GregorianCalendar.MILLISECOND)); } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
21cc46668260aa598c05d55e15ac54005207bc2d
fda2f41ff66ff6eeae2b94ef98e88a9ee3c8ff4c
/qflbaioldLib/src/main/java/com/qflbai/lib/utils/BitmapUtils.java
9077be21864c2890a2d5aa340cc0774e3e294ff8
[]
no_license
qflbai/AndroidJetpack
04847dfb53b6949c9ec85fae9bc3a7c7b40d12bc
edd0375b98950e3675acf2bb1c25b8c63780fb8b
refs/heads/master
2020-03-27T15:09:16.204116
2018-12-07T09:53:15
2018-12-07T09:53:15
146,700,639
0
0
null
null
null
null
UTF-8
Java
false
false
4,925
java
package com.qflbai.lib.utils; import android.graphics.Bitmap; import android.graphics.Canvas; import com.google.zxing.BarcodeFormat; import com.google.zxing.EncodeHintType; import com.google.zxing.MultiFormatWriter; import com.google.zxing.WriterException; import com.google.zxing.common.BitMatrix; import com.google.zxing.qrcode.QRCodeWriter; import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel; import java.util.HashMap; import java.util.Hashtable; import java.util.Map; import static android.graphics.Color.BLACK; /** * @author WenXian Bai * @Date: 2018/4/24. * @Description: */ public class BitmapUtils { //生成二维码图片(不带图片) public static Bitmap createQRCode(String contents, int widthAndHeight) { Hashtable<EncodeHintType, String> hints = new Hashtable<EncodeHintType, String>(); hints.put(EncodeHintType.CHARACTER_SET, "utf-8"); Bitmap bitmap = null; try { MultiFormatWriter multiFormatWriter = new MultiFormatWriter(); BitMatrix matrix = multiFormatWriter.encode(contents, BarcodeFormat.QR_CODE, widthAndHeight, widthAndHeight); int width = matrix.getWidth(); int height = matrix.getHeight(); int[] pixels = new int[width * height]; //画黑点 for (int y = 0; y < height; y++) { for (int x = 0; x < width; x++) { if (matrix.get(x, y)) { pixels[y * width + x] = BLACK; //0xff000000 } } } bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888); bitmap.setPixels(pixels, 0, width, 0, 0, width, height); } catch (WriterException e) { e.printStackTrace(); } return bitmap; } //带图片的二维码 public static Bitmap createQRImage(String content, int heightPix, Bitmap logoBm) { try { //配置参数 Map<EncodeHintType, Object> hints = new HashMap<>(); hints.put(EncodeHintType.CHARACTER_SET, "utf-8"); //容错级别 hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.H); // 图像数据转换,使用了矩阵转换 BitMatrix bitMatrix = new QRCodeWriter().encode(content, BarcodeFormat.QR_CODE, heightPix, heightPix, hints); int[] pixels = new int[heightPix * heightPix]; // 下面这里按照二维码的算法,逐个生成二维码的图片, // 两个for循环是图片横列扫描的结果 for (int y = 0; y < heightPix; y++) { for (int x = 0; x < heightPix; x++) { if (bitMatrix.get(x, y)) { pixels[y * heightPix + x] = 0xff000000; } else { pixels[y * heightPix + x] = 0xffffffff; } } } // 生成二维码图片的格式,使用ARGB_8888 Bitmap bitmap = Bitmap.createBitmap(heightPix, heightPix, Bitmap.Config.ARGB_8888); bitmap.setPixels(pixels, 0, heightPix, 0, 0, heightPix, heightPix); if (logoBm != null) { bitmap = addLogo(bitmap, logoBm); } //必须使用compress方法将bitmap保存到文件中再进行读取。直接返回的bitmap是没有任何压缩的,内存消耗巨大! return bitmap; } catch (WriterException e) { e.printStackTrace(); } return null; } /** * 在二维码中间添加Logo图案 */ private static Bitmap addLogo(Bitmap src, Bitmap logo) { if (src == null) { return null; } if (logo == null) { return src; } //获取图片的宽高 int srcWidth = src.getWidth(); int srcHeight = src.getHeight(); int logoWidth = logo.getWidth(); int logoHeight = logo.getHeight(); if (srcWidth == 0 || srcHeight == 0) { return null; } if (logoWidth == 0 || logoHeight == 0) { return src; } //logo大小为二维码整体大小的1/5 float scaleFactor = srcWidth * 1.0f / 5 / logoWidth; Bitmap bitmap = Bitmap.createBitmap(srcWidth, srcHeight, Bitmap.Config.ARGB_8888); try { Canvas canvas = new Canvas(bitmap); canvas.drawBitmap(src, 0, 0, null); canvas.scale(scaleFactor, scaleFactor, srcWidth / 2, srcHeight / 2); canvas.drawBitmap(logo, (srcWidth - logoWidth) / 2, (srcHeight - logoHeight) / 2, null); canvas.save(Canvas.ALL_SAVE_FLAG); canvas.restore(); } catch (Exception e) { bitmap = null; e.getStackTrace(); } return bitmap; } }
[ "qflbai@163.com" ]
qflbai@163.com
63cf69e21ab536099126b404f2bf866a9a514499
3927258e502590626dd18034000e7cad5bb46af6
/aws-java-sdk-route53/src/main/java/com/amazonaws/services/route53domains/model/transform/TransferDomainRequestMarshaller.java
45d8c78de5adb621688f2b3fee8ca09756b7f4be
[ "JSON", "Apache-2.0" ]
permissive
gauravbrills/aws-sdk-java
332f9cf1e357c3d889f753b348eb8d774a30f07c
09d91b14bfd6fbc81a04763d679e0f94377e9007
refs/heads/master
2021-01-21T18:15:06.060014
2016-06-11T18:12:40
2016-06-11T18:12:40
58,072,311
0
0
null
2016-05-04T17:52:28
2016-05-04T17:52:28
null
UTF-8
Java
false
false
6,594
java
/* * Copyright 2010-2016 Amazon.com, Inc. or its affiliates. All Rights * Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file 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.amazonaws.services.route53domains.model.transform; import java.io.ByteArrayInputStream; import java.util.Collections; import java.util.Map; import java.util.List; import java.util.regex.Pattern; import com.amazonaws.AmazonClientException; import com.amazonaws.Request; import com.amazonaws.DefaultRequest; import com.amazonaws.http.HttpMethodName; import com.amazonaws.services.route53domains.model.*; import com.amazonaws.transform.Marshaller; import com.amazonaws.util.BinaryUtils; import com.amazonaws.util.StringUtils; import com.amazonaws.util.IdempotentUtils; import com.amazonaws.util.StringInputStream; import com.amazonaws.util.json.*; /** * TransferDomainRequest Marshaller */ public class TransferDomainRequestMarshaller implements Marshaller<Request<TransferDomainRequest>, TransferDomainRequest> { public Request<TransferDomainRequest> marshall( TransferDomainRequest transferDomainRequest) { if (transferDomainRequest == null) { throw new AmazonClientException( "Invalid argument passed to marshall(...)"); } Request<TransferDomainRequest> request = new DefaultRequest<TransferDomainRequest>( transferDomainRequest, "AmazonRoute53Domains"); request.addHeader("X-Amz-Target", "Route53Domains_v20140515.TransferDomain"); request.setHttpMethod(HttpMethodName.POST); request.setResourcePath(""); try { final StructuredJsonGenerator jsonGenerator = SdkJsonProtocolFactory .createWriter(false, "1.1"); jsonGenerator.writeStartObject(); if (transferDomainRequest.getDomainName() != null) { jsonGenerator.writeFieldName("DomainName").writeValue( transferDomainRequest.getDomainName()); } if (transferDomainRequest.getIdnLangCode() != null) { jsonGenerator.writeFieldName("IdnLangCode").writeValue( transferDomainRequest.getIdnLangCode()); } if (transferDomainRequest.getDurationInYears() != null) { jsonGenerator.writeFieldName("DurationInYears").writeValue( transferDomainRequest.getDurationInYears()); } com.amazonaws.internal.SdkInternalList<Nameserver> nameserversList = (com.amazonaws.internal.SdkInternalList<Nameserver>) transferDomainRequest .getNameservers(); if (!nameserversList.isEmpty() || !nameserversList.isAutoConstruct()) { jsonGenerator.writeFieldName("Nameservers"); jsonGenerator.writeStartArray(); for (Nameserver nameserversListValue : nameserversList) { if (nameserversListValue != null) { NameserverJsonMarshaller.getInstance().marshall( nameserversListValue, jsonGenerator); } } jsonGenerator.writeEndArray(); } if (transferDomainRequest.getAuthCode() != null) { jsonGenerator.writeFieldName("AuthCode").writeValue( transferDomainRequest.getAuthCode()); } if (transferDomainRequest.getAutoRenew() != null) { jsonGenerator.writeFieldName("AutoRenew").writeValue( transferDomainRequest.getAutoRenew()); } if (transferDomainRequest.getAdminContact() != null) { jsonGenerator.writeFieldName("AdminContact"); ContactDetailJsonMarshaller.getInstance().marshall( transferDomainRequest.getAdminContact(), jsonGenerator); } if (transferDomainRequest.getRegistrantContact() != null) { jsonGenerator.writeFieldName("RegistrantContact"); ContactDetailJsonMarshaller.getInstance().marshall( transferDomainRequest.getRegistrantContact(), jsonGenerator); } if (transferDomainRequest.getTechContact() != null) { jsonGenerator.writeFieldName("TechContact"); ContactDetailJsonMarshaller.getInstance().marshall( transferDomainRequest.getTechContact(), jsonGenerator); } if (transferDomainRequest.getPrivacyProtectAdminContact() != null) { jsonGenerator.writeFieldName("PrivacyProtectAdminContact") .writeValue( transferDomainRequest .getPrivacyProtectAdminContact()); } if (transferDomainRequest.getPrivacyProtectRegistrantContact() != null) { jsonGenerator.writeFieldName("PrivacyProtectRegistrantContact") .writeValue( transferDomainRequest .getPrivacyProtectRegistrantContact()); } if (transferDomainRequest.getPrivacyProtectTechContact() != null) { jsonGenerator.writeFieldName("PrivacyProtectTechContact") .writeValue( transferDomainRequest .getPrivacyProtectTechContact()); } jsonGenerator.writeEndObject(); byte[] content = jsonGenerator.getBytes(); request.setContent(new ByteArrayInputStream(content)); request.addHeader("Content-Length", Integer.toString(content.length)); request.addHeader("Content-Type", jsonGenerator.getContentType()); } catch (Throwable t) { throw new AmazonClientException( "Unable to marshall request to JSON: " + t.getMessage(), t); } return request; } }
[ "aws@amazon.com" ]
aws@amazon.com
baba77f81abfa987b415b4737359fac38ba3f26e
4aa90348abcb2119011728dc067afd501f275374
/app/src/main/java/com/tencent/mm/app/plugin/URISpanHandlerSet$SettingBindEmailUriSpanHandler.java
75d03039460ce3273fb71bbda9dab8d43d21178c
[]
no_license
jambestwick/HackWechat
0d4ceb2d79ccddb45004ca667e9a6a984a80f0f6
6a34899c8bfd50d19e5a5ec36a58218598172a6b
refs/heads/master
2022-01-27T12:48:43.446804
2021-12-29T10:36:30
2021-12-29T10:36:30
249,366,791
0
0
null
2020-03-23T07:48:32
2020-03-23T07:48:32
null
UTF-8
Java
false
false
1,332
java
package com.tencent.mm.app.plugin; import android.os.Bundle; import com.tencent.mm.app.plugin.URISpanHandlerSet.BaseUriSpanHandler; import com.tencent.mm.pluginsdk.t; import com.tencent.mm.pluginsdk.ui.applet.k; import com.tencent.mm.pluginsdk.ui.d.f; import com.tencent.mm.ui.LauncherUI; @URISpanHandlerSet$a class URISpanHandlerSet$SettingBindEmailUriSpanHandler extends BaseUriSpanHandler { final /* synthetic */ URISpanHandlerSet fhe; URISpanHandlerSet$SettingBindEmailUriSpanHandler(URISpanHandlerSet uRISpanHandlerSet) { this.fhe = uRISpanHandlerSet; super(uRISpanHandlerSet); } final k cH(String str) { if (str.trim().startsWith("weixin://setting/bindemail")) { return new k(str, 7, null); } return null; } final int[] uC() { return new int[]{7}; } final boolean a(k kVar, f fVar) { if (kVar.type != 7) { return false; } if (fVar != null) { fVar.a(kVar); } LauncherUI cmG = LauncherUI.cmG(); if (cmG != null) { cmG.xGS.xGh.Yp("tab_settings"); } if (fVar != null) { fVar.b(kVar); } return true; } final boolean a(String str, boolean z, t tVar, Bundle bundle) { return false; } }
[ "malin.myemail@163.com" ]
malin.myemail@163.com
3979c8abf4b5bc9e98198bd5e478865e88907d03
8f2f10e6e1c6503d134760be14125c7dc0a7f494
/whatsmars-rpc/whatsmars-logging/src/main/java/org/hongxi/whatsmars/common/logging/Slf4jLoggerFactory.java
b3d70d0b26a7e0ded3f821368539480c35797af7
[ "Apache-2.0" ]
permissive
qq969934482/whatsmars
b64b7342e36f421a25547d9bec54a893b9a2cbea
aae00f5aad28cd4357bdcd3d2cecdb2778c18001
refs/heads/master
2020-09-24T15:21:56.913657
2019-12-04T04:32:05
2019-12-04T04:32:05
225,789,112
1
0
Apache-2.0
2019-12-04T05:47:20
2019-12-04T05:47:19
null
UTF-8
Java
false
false
3,962
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.hongxi.whatsmars.common.logging; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class Slf4jLoggerFactory extends InternalLoggerFactory { public Slf4jLoggerFactory() { LoggerFactory.getILoggerFactory(); doRegister(); } @Override protected String getLoggerType() { return LOGGER_SLF4J; } @Override protected InternalLogger getLoggerInstance(String name) { return new Slf4jLogger(name); } @Override protected void shutdown() { } public static class Slf4jLogger implements InternalLogger { private Logger logger = null; public Slf4jLogger(String name) { logger = LoggerFactory.getLogger(name); } @Override public String getName() { return logger.getName(); } @Override public void debug(String s) { logger.debug(s); } @Override public void debug(String s, Object o) { logger.debug(s, o); } @Override public void debug(String s, Object o, Object o1) { logger.debug(s, o, o1); } @Override public void debug(String s, Object... objects) { logger.debug(s, objects); } @Override public void debug(String s, Throwable throwable) { logger.debug(s, throwable); } @Override public void info(String s) { logger.info(s); } @Override public void info(String s, Object o) { logger.info(s, o); } @Override public void info(String s, Object o, Object o1) { logger.info(s, o, o1); } @Override public void info(String s, Object... objects) { logger.info(s, objects); } @Override public void info(String s, Throwable throwable) { logger.info(s, throwable); } @Override public void warn(String s) { logger.warn(s); } @Override public void warn(String s, Object o) { logger.warn(s, o); } @Override public void warn(String s, Object... objects) { logger.warn(s, objects); } @Override public void warn(String s, Object o, Object o1) { logger.warn(s, o, o1); } @Override public void warn(String s, Throwable throwable) { logger.warn(s, throwable); } @Override public void error(String s) { logger.error(s); } @Override public void error(String s, Object o) { logger.error(s, o); } @Override public void error(String s, Object o, Object o1) { logger.error(s, o, o1); } @Override public void error(String s, Object... objects) { logger.error(s, objects); } @Override public void error(String s, Throwable throwable) { logger.error(s, throwable); } } }
[ "javahongxi@qq.com" ]
javahongxi@qq.com
21e24c455ed26132bdec49a0e18e6ce93413de47
be73270af6be0a811bca4f1710dc6a038e4a8fd2
/crash-reproduction-moho/results/MATH-32b-8-29-PESA_II-WeightedSum:TestLen:CallDiversity/org/apache/commons/math3/geometry/partitioning/BSPTree_ESTest.java
3a42bfb95e3305347036b8d7909679d50964181b
[]
no_license
STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application
cf118b23ecb87a8bf59643e42f7556b521d1f754
3bb39683f9c343b8ec94890a00b8f260d158dfe3
refs/heads/master
2022-07-29T14:44:00.774547
2020-08-10T15:14:49
2020-08-10T15:14:49
285,804,495
0
0
null
null
null
null
UTF-8
Java
false
false
567
java
/* * This file was automatically generated by EvoSuite * Thu Apr 02 12:44:36 UTC 2020 */ package org.apache.commons.math3.geometry.partitioning; import org.junit.Test; import static org.junit.Assert.*; import org.evosuite.runtime.EvoRunner; import org.evosuite.runtime.EvoRunnerParameters; import org.junit.runner.RunWith; @RunWith(EvoRunner.class) @EvoRunnerParameters(useVFS = true, useJEE = true) public class BSPTree_ESTest extends BSPTree_ESTest_scaffolding { @Test public void notGeneratedAnyTest() { // EvoSuite did not generate any tests } }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
9c912b0e44b7d730f02ff168140af600335c892c
2e17f9bab427647bd7ad5b6a07544d21e16b11e3
/Chapter17_kiv/SuburbanScene/House.java
676349371862dc0473ddcde45aba1d4e827a5121
[ "MIT" ]
permissive
freakygeeks/BigJavaCodeSolution
42918111d8efb7bcb88616b256e44894c6433ed1
ed02f808cf61a1bf0f3af8bd5fb891d10229e3f3
refs/heads/master
2021-07-11T13:15:00.466897
2021-04-02T14:49:48
2021-04-02T14:49:48
52,708,407
3
0
null
2021-04-02T14:41:13
2016-02-28T06:35:46
Java
UTF-8
Java
false
false
1,180
java
//Chapter 17 - Exercise 17.7 import java.awt.Color; import java.awt.Graphics2D; import java.awt.geom.Rectangle2D; import java.awt.geom.Line2D; public class House { private double xLeft; private double yBottom; private Color color; private final int WIDTH = 50; private final int HEIGHT = 70; public House(double x, double y, Color aColor) { xLeft = x; yBottom = y; color = aColor; } public void draw (Graphics2D g2) { Rectangle2D.Double front = new Rectangle2D.Double (xLeft, yBottom-WIDTH, WIDTH, WIDTH); Rectangle2D.Double door = new Rectangle2D.Double (xLeft+WIDTH/5, yBottom-WIDTH/2, WIDTH/5, WIDTH/2); Rectangle2D.Double window = new Rectangle2D.Double (xLeft+WIDTH*3/5, yBottom-WIDTH/2, WIDTH/5, WIDTH/5); Line2D.Double roofLeft = new Line2D.Double (xLeft, yBottom-WIDTH, xLeft+WIDTH/2, yBottom-HEIGHT); Line2D.Double roofRight = new Line2D.Double (xLeft+WIDTH, yBottom-WIDTH, xLeft+WIDTH/2, yBottom-HEIGHT); g2.draw(front); g2.draw(roofLeft); g2.draw(roofRight); g2.setColor(color); g2.fill(front); g2.fill(door); g2.fill(window); g2.setColor(Color.black); g2.draw(front); g2.draw(door); g2.draw(window); } }
[ "freakygeeks@users.noreply.github.com" ]
freakygeeks@users.noreply.github.com
a2affc70e41ec35cf0be1c8139c6ce8c743fdb6c
c4816c3806b4fde2764085b838340287f81a8827
/com.sap.jnc.marketing.service/src/main/java/com/sap/jnc/marketing/service/contract/ContractImportDeleteService.java
f3751d5eeec9fb4d18283dee4452a6d3f6680fc1
[]
no_license
enyeama/jnc-marketing
65e87588109504920251a2c44b3873b09825fc07
9e0ab45c29af57536128161bc6084c63408d74e7
refs/heads/master
2021-01-11T22:13:03.164353
2017-01-14T13:26:37
2017-01-14T13:26:37
78,935,958
0
0
null
null
null
null
UTF-8
Java
false
false
369
java
package com.sap.jnc.marketing.service.contract; import java.util.List; import com.sap.jnc.marketing.dto.response.contract.ContractImportResponse; import com.sap.jnc.marketing.dto.shared.contract.ContractRecord; public interface ContractImportDeleteService { public void ContractDelete(List<ContractRecord> requestList, List<ContractImportResponse> responseList); }
[ "vincent.chen01@sap.com" ]
vincent.chen01@sap.com
dc8bf60f31862a74577f309eace443c1939b8362
3ef55e152decb43bdd90e3de821ffea1a2ec8f75
/large/module0114/src/java/module0114/a/Foo1.java
420c54d64e6c831848aa8f8e79ae65d61b71d741
[ "BSD-3-Clause" ]
permissive
salesforce/bazel-ls-demo-project
5cc6ef749d65d6626080f3a94239b6a509ef145a
948ed278f87338edd7e40af68b8690ae4f73ebf0
refs/heads/master
2023-06-24T08:06:06.084651
2023-03-14T11:54:29
2023-03-14T11:54:29
241,489,944
0
5
BSD-3-Clause
2023-03-27T11:28:14
2020-02-18T23:30:47
Java
UTF-8
Java
false
false
1,473
java
package module0114.a; import java.util.zip.*; import javax.annotation.processing.*; import javax.lang.model.*; /** * Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut * labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. * Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. * * @see java.awt.datatransfer.DataFlavor * @see java.beans.beancontext.BeanContext * @see java.io.File */ @SuppressWarnings("all") public abstract class Foo1<T> extends module0114.a.Foo0<T> implements module0114.a.IFoo1<T> { java.rmi.Remote f0 = null; java.nio.file.FileStore f1 = null; java.sql.Array f2 = null; public T element; public static Foo1 instance; public static Foo1 getInstance() { return instance; } public static <T> T create(java.util.List<T> input) { return module0114.a.Foo0.create(input); } public String getName() { return module0114.a.Foo0.getInstance().getName(); } public void setName(String string) { module0114.a.Foo0.getInstance().setName(getName()); return; } public T get() { return (T)module0114.a.Foo0.getInstance().get(); } public void set(Object element) { this.element = (T)element; module0114.a.Foo0.getInstance().set(this.element); } public T call() throws Exception { return (T)module0114.a.Foo0.getInstance().call(); } }
[ "gwagenknecht@salesforce.com" ]
gwagenknecht@salesforce.com
c0586a5987fc0cedeee5b1de3844950fcc1538d1
b2a50f92f359a63a4adf9c42e7d9734b1f87c50e
/src/main/java/com/epmresources/server/web/rest/CompareProductsResource.java
0ab4496c73f09c421d436f705d2878da38f6f553
[]
no_license
thetlwinoo/epm-resources
a9dbc08bacd45a0e57c31c14aff3a3e5c6a82597
88f2918de8c07cd1c3a2f701c4adfa97305b974d
refs/heads/master
2022-12-26T15:46:06.041561
2019-12-20T07:35:25
2019-12-20T07:35:25
220,428,422
0
0
null
2022-12-16T04:40:56
2019-11-08T09:06:17
Java
UTF-8
Java
false
false
6,681
java
package com.epmresources.server.web.rest; import com.epmresources.server.service.CompareProductsService; import com.epmresources.server.web.rest.errors.BadRequestAlertException; import com.epmresources.server.service.dto.CompareProductsDTO; import com.epmresources.server.service.dto.CompareProductsCriteria; import com.epmresources.server.service.CompareProductsQueryService; import io.github.jhipster.web.util.HeaderUtil; import io.github.jhipster.web.util.ResponseUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Value; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; import java.net.URI; import java.net.URISyntaxException; import java.util.List; import java.util.Optional; /** * REST controller for managing {@link com.epmresources.server.domain.CompareProducts}. */ @RestController @RequestMapping("/api") public class CompareProductsResource { private final Logger log = LoggerFactory.getLogger(CompareProductsResource.class); private static final String ENTITY_NAME = "compareProducts"; @Value("${jhipster.clientApp.name}") private String applicationName; private final CompareProductsService compareProductsService; private final CompareProductsQueryService compareProductsQueryService; public CompareProductsResource(CompareProductsService compareProductsService, CompareProductsQueryService compareProductsQueryService) { this.compareProductsService = compareProductsService; this.compareProductsQueryService = compareProductsQueryService; } /** * {@code POST /compare-products} : Create a new compareProducts. * * @param compareProductsDTO the compareProductsDTO to create. * @return the {@link ResponseEntity} with status {@code 201 (Created)} and with body the new compareProductsDTO, or with status {@code 400 (Bad Request)} if the compareProducts has already an ID. * @throws URISyntaxException if the Location URI syntax is incorrect. */ @PostMapping("/compare-products") public ResponseEntity<CompareProductsDTO> createCompareProducts(@RequestBody CompareProductsDTO compareProductsDTO) throws URISyntaxException { log.debug("REST request to save CompareProducts : {}", compareProductsDTO); if (compareProductsDTO.getId() != null) { throw new BadRequestAlertException("A new compareProducts cannot already have an ID", ENTITY_NAME, "idexists"); } CompareProductsDTO result = compareProductsService.save(compareProductsDTO); return ResponseEntity.created(new URI("/api/compare-products/" + result.getId())) .headers(HeaderUtil.createEntityCreationAlert(applicationName, true, ENTITY_NAME, result.getId().toString())) .body(result); } /** * {@code PUT /compare-products} : Updates an existing compareProducts. * * @param compareProductsDTO the compareProductsDTO to update. * @return the {@link ResponseEntity} with status {@code 200 (OK)} and with body the updated compareProductsDTO, * or with status {@code 400 (Bad Request)} if the compareProductsDTO is not valid, * or with status {@code 500 (Internal Server Error)} if the compareProductsDTO couldn't be updated. * @throws URISyntaxException if the Location URI syntax is incorrect. */ @PutMapping("/compare-products") public ResponseEntity<CompareProductsDTO> updateCompareProducts(@RequestBody CompareProductsDTO compareProductsDTO) throws URISyntaxException { log.debug("REST request to update CompareProducts : {}", compareProductsDTO); if (compareProductsDTO.getId() == null) { throw new BadRequestAlertException("Invalid id", ENTITY_NAME, "idnull"); } CompareProductsDTO result = compareProductsService.save(compareProductsDTO); return ResponseEntity.ok() .headers(HeaderUtil.createEntityUpdateAlert(applicationName, true, ENTITY_NAME, compareProductsDTO.getId().toString())) .body(result); } /** * {@code GET /compare-products} : get all the compareProducts. * * @param criteria the criteria which the requested entities should match. * @return the {@link ResponseEntity} with status {@code 200 (OK)} and the list of compareProducts in body. */ @GetMapping("/compare-products") public ResponseEntity<List<CompareProductsDTO>> getAllCompareProducts(CompareProductsCriteria criteria) { log.debug("REST request to get CompareProducts by criteria: {}", criteria); List<CompareProductsDTO> entityList = compareProductsQueryService.findByCriteria(criteria); return ResponseEntity.ok().body(entityList); } /** * {@code GET /compare-products/count} : count all the compareProducts. * * @param criteria the criteria which the requested entities should match. * @return the {@link ResponseEntity} with status {@code 200 (OK)} and the count in body. */ @GetMapping("/compare-products/count") public ResponseEntity<Long> countCompareProducts(CompareProductsCriteria criteria) { log.debug("REST request to count CompareProducts by criteria: {}", criteria); return ResponseEntity.ok().body(compareProductsQueryService.countByCriteria(criteria)); } /** * {@code GET /compare-products/:id} : get the "id" compareProducts. * * @param id the id of the compareProductsDTO to retrieve. * @return the {@link ResponseEntity} with status {@code 200 (OK)} and with body the compareProductsDTO, or with status {@code 404 (Not Found)}. */ @GetMapping("/compare-products/{id}") public ResponseEntity<CompareProductsDTO> getCompareProducts(@PathVariable Long id) { log.debug("REST request to get CompareProducts : {}", id); Optional<CompareProductsDTO> compareProductsDTO = compareProductsService.findOne(id); return ResponseUtil.wrapOrNotFound(compareProductsDTO); } /** * {@code DELETE /compare-products/:id} : delete the "id" compareProducts. * * @param id the id of the compareProductsDTO to delete. * @return the {@link ResponseEntity} with status {@code 204 (NO_CONTENT)}. */ @DeleteMapping("/compare-products/{id}") public ResponseEntity<Void> deleteCompareProducts(@PathVariable Long id) { log.debug("REST request to delete CompareProducts : {}", id); compareProductsService.delete(id); return ResponseEntity.noContent().headers(HeaderUtil.createEntityDeletionAlert(applicationName, true, ENTITY_NAME, id.toString())).build(); } }
[ "thetlwinoo85@yahoo.com" ]
thetlwinoo85@yahoo.com
e12d7c4eb5f1f7c7f678bde072669c448c0ea7f9
1350f85cd7e8c5606bc84bec9cc6d5a14d4640a5
/shared-web/src/main/java/au/edu/aekos/shared/spatial/CRSBounds.java
b8c71e45c7cc533b4f2420769b4ae0f323336cb8
[]
no_license
Tillbilly/shared-ecoinformatics
5b900ccdf226288eb8f1e6dc8acdf47845ffcbe1
f5a1396cc3f265fea449698be8a898e59803c99d
refs/heads/master
2022-12-21T18:17:46.554664
2016-08-23T07:40:21
2016-08-23T07:40:21
66,336,965
0
0
null
2022-12-16T01:53:00
2016-08-23T05:46:55
Java
UTF-8
Java
false
false
3,096
java
package au.edu.aekos.shared.spatial; import java.util.Collections; import java.util.HashMap; import java.util.Map; public class CRSBounds { private static final Map<String, BBOX> EPSG_BOUNDS_MAP; static { Map<String, BBOX> boundsMap = new HashMap<String, BBOX>(); boundsMap.put("EPSG:4283", new BBOX(-180.0,-90.0,180.0,90.0)); boundsMap.put("EPSG:4326", new BBOX(-180.0000, -90.0000, 180.0000, 90.0000)); boundsMap.put("EPSG:3577", new BBOX(-2690013.3995, -5098960.4467, 2579169.8548, -1281018.4757)); boundsMap.put("EPSG:3112", new BBOX(-2918276.3772, -5287521.9260, 2362935.9369, -1372651.4100)); boundsMap.put("EPSG:28349", new BBOX(189586.6272, 6954598.0530, 810413.3728, 7597371.5494)); boundsMap.put("EPSG:28350", new BBOX(185287.0543, 6100653.3235, 814712.9457, 7830016.0842)); boundsMap.put("EPSG:28351", new BBOX(175342.3099, 6211597.9440, 824657.6901, 8494511.0513)); boundsMap.put("EPSG:28352", new BBOX(171800.9465, 6400173.7198, 828199.0535, 8815595.0072)); boundsMap.put("EPSG:28353", new BBOX(171800.9465, 6000791.7730, 828199.0535, 8815595.0072)); boundsMap.put("EPSG:28354", new BBOX(171172.5136, 5534625.2435, 828827.4864, 8882020.4168)); boundsMap.put("EPSG:28355", new BBOX(175479.2570, 5112643.4740, 824520.7430, 8483438.2879)); boundsMap.put("EPSG:28356", new BBOX(189586.6272, 5812134.5296, 810413.3728, 7597371.5494)); boundsMap.put("EPSG:28357", new BBOX(306694.5349, 3923337.2742, 693305.4651, 3934459.6225)); boundsMap.put("EPSG:28358", new BBOX(171071.2640, 3789858.6732, 828928.7360, 8893091.1458)); EPSG_BOUNDS_MAP = Collections.unmodifiableMap(boundsMap); } public static boolean isCoordinateInBounds(double x, double y, String coordinateSystem){ if(!isCoordSystemSupport(coordinateSystem)){ return false; } return isXInBounds(x , coordinateSystem ) && isYInBounds(y , coordinateSystem ); } public static boolean isXInBounds(double x, String coordinateSystem){ if(!isCoordSystemSupport(coordinateSystem)) return false; return x >= EPSG_BOUNDS_MAP.get(coordinateSystem).getXmin() && x <= EPSG_BOUNDS_MAP.get(coordinateSystem).getXmax() ; } public static boolean isYInBounds(double y, String coordinateSystem){ if(!isCoordSystemSupport(coordinateSystem)){ return false; } return y >= EPSG_BOUNDS_MAP.get(coordinateSystem).getYmin() && y <= EPSG_BOUNDS_MAP.get(coordinateSystem).getYmax() ; } public static boolean isCoordSystemSupport(String epsgCode){ return EPSG_BOUNDS_MAP.containsKey(epsgCode); } public static BBOX getBoundsBBOX(String coordinateSystem){ if(!isCoordSystemSupport(coordinateSystem)) return null; return new BBOX(EPSG_BOUNDS_MAP.get(coordinateSystem).getXmin().doubleValue(), EPSG_BOUNDS_MAP.get(coordinateSystem).getYmin().doubleValue(), EPSG_BOUNDS_MAP.get(coordinateSystem).getXmax().doubleValue(), EPSG_BOUNDS_MAP.get(coordinateSystem).getYmax().doubleValue(), coordinateSystem); } }
[ "madbatch@gmail.com" ]
madbatch@gmail.com
a576fb6a7ba7fc457a771c2e51335adf374859ec
45e9d8d21ef26c7534eb055b8610333936ea2b30
/src/main/java/com/nntu/klaster/config/LoggingConfiguration.java
c17166936b352d0d1806d71a7f4dba0b4a006058
[]
no_license
EkaterinaAn99/jhipster-klaster
e548b32ab11638281945de2a9ac776ca861f96e1
2cf5d61ab42147247806d618b948275bda27c8e7
refs/heads/main
2023-01-28T00:32:12.974657
2020-12-07T08:30:18
2020-12-07T08:30:18
319,243,829
0
0
null
2020-12-07T08:30:19
2020-12-07T07:55:01
Java
UTF-8
Java
false
false
2,318
java
package com.nntu.klaster.config; import static io.github.jhipster.config.logging.LoggingUtils.*; import ch.qos.logback.classic.LoggerContext; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import io.github.jhipster.config.JHipsterProperties; import java.util.HashMap; import java.util.Map; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.ObjectProvider; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.info.BuildProperties; import org.springframework.cloud.context.config.annotation.RefreshScope; import org.springframework.context.annotation.Configuration; /* * Configures the console and Logstash log appenders from the app properties */ @Configuration @RefreshScope public class LoggingConfiguration { public LoggingConfiguration( @Value("${spring.application.name}") String appName, @Value("${server.port}") String serverPort, JHipsterProperties jHipsterProperties, ObjectProvider<BuildProperties> buildProperties, ObjectMapper mapper ) throws JsonProcessingException { LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory(); Map<String, String> map = new HashMap<>(); map.put("app_name", appName); map.put("app_port", serverPort); buildProperties.ifAvailable(it -> map.put("version", it.getVersion())); String customFields = mapper.writeValueAsString(map); JHipsterProperties.Logging loggingProperties = jHipsterProperties.getLogging(); JHipsterProperties.Logging.Logstash logstashProperties = loggingProperties.getLogstash(); if (loggingProperties.isUseJsonFormat()) { addJsonConsoleAppender(context, customFields); } if (logstashProperties.isEnabled()) { addLogstashTcpSocketAppender(context, customFields, logstashProperties); } if (loggingProperties.isUseJsonFormat() || logstashProperties.isEnabled()) { addContextListener(context, customFields, loggingProperties); } if (jHipsterProperties.getMetrics().getLogs().isEnabled()) { setMetricsMarkerLogbackFilter(context, loggingProperties.isUseJsonFormat()); } } }
[ "jhipster-bot@jhipster.tech" ]
jhipster-bot@jhipster.tech