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
81b457814cfd5f7d857d85934ba2d5324025b892
a34d3ed0e4dbda04c5c117c3be64378f4f414a2c
/src/main/java/com/up72/hq/model/RoleManager.java
0b49405e5a84b5abd1e0ab4bec5f00aca10f19f2
[]
no_license
lgcwn/hq100
30e117fdd2cce4307d623bdd2cd9ef5a555464e3
77b20342a8e63cd8f316b4f70cb451db2c950f0f
refs/heads/master
2020-12-30T13:08:08.325769
2017-08-26T07:35:16
2017-08-26T07:35:16
91,324,893
0
0
null
null
null
null
UTF-8
Java
false
false
5,848
java
/* * Powered By [up72-framework] * Web Site: http://www.up72.com * Since 2006 - 2016 */ package com.up72.hq.model; import javax.validation.constraints.*; import com.up72.hq.utils.CodeEncryption; import org.hibernate.validator.constraints.*; import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; /** * 角色管理 * * @author liuguicheng * @version 1.0 * @since 1.0 */ public class RoleManager implements java.io.Serializable{ //alias public static final String TABLE_ALIAS = "角色管理"; public static final String ALIAS_ID = "id"; public static final String ALIAS_ROLE_SELECT_ID = "角色选拔ID"; public static final String ALIAS_NAME = "角色名称"; public static final String ALIAS_ACTOR_CNT = "演员数量"; public static final String ALIAS_GENDER = "性别"; public static final String ALIAS_IMG = "图片"; public static final String ALIAS_RULES = "选拔规则"; public static final String ALIAS_REMARK = "报名须知"; public static final String ALIAS_INTRO = "简介详情"; public static final String IS_DELETE = "上下架(0-下架,1-上架)"; public static final String ALIAS_GET_POINTS = "获得积分"; //可以直接使用: @Length(max=50,message="用户名长度不能大于50")显示错误消息 //columns START /** * id db_column: ID */ private java.lang.Long id; /** * 角色选拔ID db_column: ROLE_SELECT_ID */ @NotNull private java.lang.Long roleSelectId; /** * (角色名称) db_column: NAME */ @NotBlank @Length(max=30) private java.lang.String name; /** * (演员数量) db_column: ACTOR_CNT */ @NotNull private java.lang.Integer actorCnt; /** * (性别) db_column: GENDER */ @NotNull private Integer gender; /** * 图片 db_column: IMG */ @NotBlank @Length(max=100) private java.lang.String img; /** * (选拔规则) db_column: RULES */ @NotBlank @Length(max=1000) private java.lang.String rules; /** * (报名须知) db_column: REMARK */ @NotBlank @Length(max=1000) private java.lang.String remark; /** * (简介) db_column: INTRO */ @NotBlank @Length(max=1000) private java.lang.String intro; /** * (详情) db_column: DETAILS */ @NotBlank @Length(max=2147483647) private java.lang.String details; //columns END /** * 添加时间 db_column: ADD_TIME */ @NotNull private java.lang.Long addTime; /** * 排序ID db_column: SORT_ID */ @NotNull private java.lang.Long sortId; /** * 排序ID db_column: IS_DELETE */ @NotNull private java.lang.Integer isDelete; /** * 报名费 db_column: SIGN_MONEY */ @NotNull private java.lang.Integer signMoney; /** * 获得积分 db_column: GIVE_POINTS */ private java.lang.Integer givePoints; /** * id 密文 */ private String idCipher; public RoleManager(){ } public RoleManager( java.lang.Long id ){ this.id = id; } public void setId(java.lang.Long value) { this.id = value; } public java.lang.Long getId() { return this.id; } public void setRoleSelectId(java.lang.Long value) { this.roleSelectId = value; } public java.lang.Long getRoleSelectId() { return this.roleSelectId; } public void setName(java.lang.String value) { this.name = value; } public java.lang.String getName() { return this.name; } public void setActorCnt(java.lang.Integer value) { this.actorCnt = value; } public java.lang.Integer getActorCnt() { return this.actorCnt; } public void setGender(Integer value) { this.gender = value; } public Integer getGender() { return this.gender; } public void setImg(java.lang.String value) { this.img = value; } public java.lang.String getImg() { return this.img; } public void setRules(java.lang.String value) { this.rules = value; } public java.lang.String getRules() { return this.rules; } public void setRemark(java.lang.String value) { this.remark = value; } public java.lang.String getRemark() { return this.remark; } public void setIntro(java.lang.String value) { this.intro = value; } public java.lang.String getIntro() { return this.intro; } public Long getAddTime() { return addTime; } public void setAddTime(Long addTime) { this.addTime = addTime; } public String getDetails() { return details; } public void setDetails(String details) { this.details = details; } public String toString() { return ToStringBuilder.reflectionToString(this); } public int hashCode() { return new HashCodeBuilder() .append(getId()) .toHashCode(); } public boolean equals(Object obj) { if(obj instanceof RoleManager == false) return false; if(this == obj) return true; RoleManager other = (RoleManager)obj; return new EqualsBuilder() .append(getId(),other.getId()) .isEquals(); } public Long getSortId() { return sortId; } public void setSortId(Long sortId) { this.sortId = sortId; } public Integer getIsDelete() { return isDelete; } public void setIsDelete(Integer isDelete) { this.isDelete = isDelete; } public Integer getSignMoney() { return signMoney; } public void setSignMoney(Integer signMoney) { this.signMoney = signMoney; } public Integer getGivePoints() { return givePoints; } public void setGivePoints(Integer givePoints) { this.givePoints = givePoints; } public String getIdCipher() { idCipher= CodeEncryption.encryption(getId()); return idCipher; } public void setIdCipher(String idCipher) { this.idCipher = idCipher; } }
[ "435164706@qq.com" ]
435164706@qq.com
4961a59b36fa77023304bb9481a7097b60288768
f0349ce9bc4b14ec3f21251163b4c2a404959ddf
/zhiliao/src/main/java/leavesc/hello/zhiliao/bean/Others.java
ec8e2bde26af536651b4fcec81403596da184c18
[]
no_license
lgq2015/SmallApp
6103bd653c5b31f555bb216889f6292f4afa2fc7
9b0264ef76d4f5d4649f50c42b4286c927228752
refs/heads/master
2021-01-15T06:16:27.345124
2019-04-04T06:09:18
2019-04-04T06:09:18
null
0
0
null
null
null
null
UTF-8
Java
false
false
968
java
package leavesc.hello.zhiliao.bean; /** * Created by ZY on 2016/7/27. * 文章主题详细介绍 */ public class Others { private int color; private String thumbnail; private String description; private int id; private String name; public int getColor() { return color; } public void setColor(int color) { this.color = color; } public String getThumbnail() { return thumbnail; } public void setThumbnail(String thumbnail) { this.thumbnail = thumbnail; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public int getId() { return id; } public void setId(int id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } }
[ "1990724437@qq.com" ]
1990724437@qq.com
98b86ca22ce10b595b0edd08c78fd97f481cd8e2
e054c1e6903e4b5eb166d107802c0c2cadd2eb03
/modules/datex-serializer/src/generated/java/eu/datex2/schema/_3/locationreferencing/_TpegLoc03OtherPointDescriptorSubtypeEnum.java
f98d0571a7e896e0188cc380c5105c601cc8fa25
[ "MIT" ]
permissive
svvsaga/gradle-modules-public
02dc90ad2feb58aef7629943af3e0d3a9f61d5cf
e4ef4e2ed5d1a194ff426411ccb3f81d34ff4f01
refs/heads/main
2023-05-27T08:25:36.578399
2023-05-12T14:15:47
2023-05-12T14:33:14
411,986,217
2
1
MIT
2023-05-12T14:33:15
2021-09-30T08:36:11
Java
UTF-8
Java
false
false
2,338
java
package eu.datex2.schema._3.locationreferencing; import jakarta.xml.bind.annotation.XmlAccessType; import jakarta.xml.bind.annotation.XmlAccessorType; import jakarta.xml.bind.annotation.XmlAttribute; import jakarta.xml.bind.annotation.XmlType; import jakarta.xml.bind.annotation.XmlValue; /** * <p>Java class for _TpegLoc03OtherPointDescriptorSubtypeEnum complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="_TpegLoc03OtherPointDescriptorSubtypeEnum"&gt; * &lt;simpleContent&gt; * &lt;extension base="&lt;http://datex2.eu/schema/3/locationReferencing&gt;TpegLoc03OtherPointDescriptorSubtypeEnum"&gt; * &lt;attribute name="_extendedValue" type="{http://www.w3.org/2001/XMLSchema}string" /&gt; * &lt;/extension&gt; * &lt;/simpleContent&gt; * &lt;/complexType&gt; * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "_TpegLoc03OtherPointDescriptorSubtypeEnum", propOrder = { "value" }) public class _TpegLoc03OtherPointDescriptorSubtypeEnum { @XmlValue protected TpegLoc03OtherPointDescriptorSubtypeEnum value; @XmlAttribute(name = "_extendedValue") protected String _ExtendedValue; /** * Gets the value of the value property. * * @return * possible object is * {@link TpegLoc03OtherPointDescriptorSubtypeEnum } * */ public TpegLoc03OtherPointDescriptorSubtypeEnum getValue() { return value; } /** * Sets the value of the value property. * * @param value * allowed object is * {@link TpegLoc03OtherPointDescriptorSubtypeEnum } * */ public void setValue(TpegLoc03OtherPointDescriptorSubtypeEnum value) { this.value = value; } /** * Gets the value of the _ExtendedValue property. * * @return * possible object is * {@link String } * */ public String get_ExtendedValue() { return _ExtendedValue; } /** * Sets the value of the _ExtendedValue property. * * @param value * allowed object is * {@link String } * */ public void set_ExtendedValue(String value) { this._ExtendedValue = value; } }
[ "geir.sagberg@gmail.com" ]
geir.sagberg@gmail.com
81fa66c40fc98a0fcad0aafa1375c95b5808bae9
9b87065da0abba051240eb115afd6c58d913d906
/app/src/main/java/com/liangjing/beziertest/views/ThirdBezierView.java
3a9b9a2915a702a6861a4b1670990bef6ca70d36
[]
no_license
liangjingdev/BezierTest
aab51d01ed879c64798da1f3d8a05c8e138885c1
44984c729e0271d937241d4ae79212058bd0e948
refs/heads/master
2021-01-01T15:37:34.529501
2017-07-19T01:25:52
2017-07-19T01:25:52
97,657,611
0
0
null
null
null
null
UTF-8
Java
false
false
4,131
java
package com.liangjing.beziertest.views; import android.content.Context; import android.graphics.Canvas; import android.graphics.Paint; import android.graphics.Path; import android.util.AttributeSet; import android.view.MotionEvent; import android.view.View; /** * Created by liangjing on 2017/7/15. * 目的:了解三阶Bezier曲线的原理和运用 */ public class ThirdBezierView extends View { //起始点 private float mStartPointX; private float mStartPointY; //终点 private float mEndPointX; private float mEndPointY; //控制点 private float mFlagPointOneX; private float mFlagPointOneY; private float mFlagPointTwoX; private float mFlagPointTwoY; private Path mPath; private Paint mPaintBezier; private Paint mPaintFlag; private Paint mPaintFlagText; //用于判断是否有两根手指同时触摸到手机屏幕 private boolean isSecondPoint = false; public ThirdBezierView(Context context) { super(context); } public ThirdBezierView(Context context, AttributeSet attrs) { super(context, attrs); mPaintBezier = new Paint(Paint.ANTI_ALIAS_FLAG); mPaintBezier.setStrokeWidth(8); mPaintBezier.setStyle(Paint.Style.STROKE); mPaintFlag = new Paint(Paint.ANTI_ALIAS_FLAG); mPaintFlag.setStrokeWidth(3); mPaintFlag.setStyle(Paint.Style.STROKE); mPaintFlagText = new Paint(Paint.ANTI_ALIAS_FLAG); mPaintFlagText.setStyle(Paint.Style.STROKE); mPaintFlagText.setTextSize(20); } public ThirdBezierView(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); } @Override protected void onSizeChanged(int w, int h, int oldw, int oldh) { super.onSizeChanged(w, h, oldw, oldh); mStartPointX = w / 4; mStartPointY = h / 2 - 200; mEndPointX = w * 3 / 4; mEndPointY = h / 2 - 200; mFlagPointOneX = w / 2 - 100; mFlagPointOneY = h / 2 - 300; mFlagPointTwoX = w / 2 + 100; mFlagPointTwoY = h / 2 - 300; mPath = new Path(); } @Override protected void onDraw(Canvas canvas) { super.onDraw(canvas); mPath.reset(); mPath.moveTo(mStartPointX, mStartPointY); mPath.cubicTo(mFlagPointOneX, mFlagPointOneY, mFlagPointTwoX, mFlagPointTwoY, mEndPointX, mEndPointY); canvas.drawPoint(mStartPointX, mStartPointY, mPaintFlag); canvas.drawText("起点", mStartPointX, mStartPointY, mPaintFlagText); canvas.drawPoint(mEndPointX, mEndPointY, mPaintFlag); canvas.drawText("终点", mEndPointX, mEndPointY, mPaintFlagText); canvas.drawPoint(mFlagPointOneX, mFlagPointOneY, mPaintFlag); canvas.drawText("控制点1", mFlagPointOneX, mFlagPointOneY, mPaintFlagText); canvas.drawText("控制点2", mFlagPointTwoX, mFlagPointTwoY, mPaintFlagText); canvas.drawLine(mStartPointX, mStartPointY, mFlagPointOneX, mFlagPointOneY, mPaintFlag); canvas.drawLine(mFlagPointOneX, mFlagPointOneY, mFlagPointTwoX, mFlagPointTwoY, mPaintFlag); canvas.drawLine(mEndPointX, mEndPointY, mFlagPointTwoX, mFlagPointTwoY, mPaintFlag); canvas.drawPath(mPath, mPaintBezier); } @Override public boolean onTouchEvent(MotionEvent event) { //多点触控。0表示第一根手指,1表示第二根手指。(映射) switch (event.getAction() & MotionEvent.ACTION_MASK) { case MotionEvent.ACTION_POINTER_DOWN: isSecondPoint = true; break; case MotionEvent.ACTION_POINTER_UP: isSecondPoint = false; break; case MotionEvent.ACTION_MOVE: mFlagPointOneX = event.getX(0); mFlagPointOneY = event.getY(0); if (isSecondPoint) { mFlagPointTwoX = event.getX(1); mFlagPointTwoY = event.getY(1); } invalidate(); break; } return true; } }
[ "1184106223@qq.com" ]
1184106223@qq.com
5e0817bf543d944cd497cad8eb19332c6214968d
30debfb588d3df553019a29d761f53698564e8c8
/modules/adwords_axis/src/main/java/com/google/api/ads/adwords/axis/v201609/cm/PolicyTopicEvidence.java
e82cd940f8e237694b17f82d22409b39655f8358
[ "Apache-2.0" ]
permissive
jinhyeong/googleads-java-lib
8f7a5b9cad5189e45b5ddcdc215bbb4776b614f9
872c39ba20f30f7e52d3d4c789a1c5cbefaf80fc
refs/heads/master
2021-01-19T09:35:38.933267
2017-04-03T14:12:43
2017-04-03T14:12:43
null
0
0
null
null
null
null
UTF-8
Java
false
false
7,293
java
// Copyright 2016 Google Inc. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. /** * PolicyTopicEvidence.java * * This file was auto-generated from WSDL * by the Apache Axis 1.4 Mar 02, 2009 (07:08:06 PST) WSDL2Java emitter. */ package com.google.api.ads.adwords.axis.v201609.cm; /** * Evidence that caused this policy topic to be reported. */ public class PolicyTopicEvidence implements java.io.Serializable { /* The type of evidence for the policy topic. */ private com.google.api.ads.adwords.axis.v201609.cm.PolicyTopicEvidenceType policyTopicEvidenceType; /* The actual evidence that triggered this policy topic to be * reported. This field is associated * with the policyTopicEvidenceType. So for example, * when policyTopicEvidenceType is AD_TEXT the * evidence is the text associated with the Ad. */ private java.lang.String evidenceText; public PolicyTopicEvidence() { } public PolicyTopicEvidence( com.google.api.ads.adwords.axis.v201609.cm.PolicyTopicEvidenceType policyTopicEvidenceType, java.lang.String evidenceText) { this.policyTopicEvidenceType = policyTopicEvidenceType; this.evidenceText = evidenceText; } /** * Gets the policyTopicEvidenceType value for this PolicyTopicEvidence. * * @return policyTopicEvidenceType * The type of evidence for the policy topic. */ public com.google.api.ads.adwords.axis.v201609.cm.PolicyTopicEvidenceType getPolicyTopicEvidenceType() { return policyTopicEvidenceType; } /** * Sets the policyTopicEvidenceType value for this PolicyTopicEvidence. * * @param policyTopicEvidenceType * The type of evidence for the policy topic. */ public void setPolicyTopicEvidenceType(com.google.api.ads.adwords.axis.v201609.cm.PolicyTopicEvidenceType policyTopicEvidenceType) { this.policyTopicEvidenceType = policyTopicEvidenceType; } /** * Gets the evidenceText value for this PolicyTopicEvidence. * * @return evidenceText * The actual evidence that triggered this policy topic to be * reported. This field is associated * with the policyTopicEvidenceType. So for example, * when policyTopicEvidenceType is AD_TEXT the * evidence is the text associated with the Ad. */ public java.lang.String getEvidenceText() { return evidenceText; } /** * Sets the evidenceText value for this PolicyTopicEvidence. * * @param evidenceText * The actual evidence that triggered this policy topic to be * reported. This field is associated * with the policyTopicEvidenceType. So for example, * when policyTopicEvidenceType is AD_TEXT the * evidence is the text associated with the Ad. */ public void setEvidenceText(java.lang.String evidenceText) { this.evidenceText = evidenceText; } private java.lang.Object __equalsCalc = null; public synchronized boolean equals(java.lang.Object obj) { if (!(obj instanceof PolicyTopicEvidence)) return false; PolicyTopicEvidence other = (PolicyTopicEvidence) obj; if (obj == null) return false; if (this == obj) return true; if (__equalsCalc != null) { return (__equalsCalc == obj); } __equalsCalc = obj; boolean _equals; _equals = true && ((this.policyTopicEvidenceType==null && other.getPolicyTopicEvidenceType()==null) || (this.policyTopicEvidenceType!=null && this.policyTopicEvidenceType.equals(other.getPolicyTopicEvidenceType()))) && ((this.evidenceText==null && other.getEvidenceText()==null) || (this.evidenceText!=null && this.evidenceText.equals(other.getEvidenceText()))); __equalsCalc = null; return _equals; } private boolean __hashCodeCalc = false; public synchronized int hashCode() { if (__hashCodeCalc) { return 0; } __hashCodeCalc = true; int _hashCode = 1; if (getPolicyTopicEvidenceType() != null) { _hashCode += getPolicyTopicEvidenceType().hashCode(); } if (getEvidenceText() != null) { _hashCode += getEvidenceText().hashCode(); } __hashCodeCalc = false; return _hashCode; } // Type metadata private static org.apache.axis.description.TypeDesc typeDesc = new org.apache.axis.description.TypeDesc(PolicyTopicEvidence.class, true); static { typeDesc.setXmlType(new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201609", "PolicyTopicEvidence")); org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); elemField.setFieldName("policyTopicEvidenceType"); elemField.setXmlName(new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201609", "policyTopicEvidenceType")); elemField.setXmlType(new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201609", "PolicyTopicEvidenceType")); elemField.setMinOccurs(0); elemField.setNillable(false); typeDesc.addFieldDesc(elemField); elemField = new org.apache.axis.description.ElementDesc(); elemField.setFieldName("evidenceText"); elemField.setXmlName(new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201609", "evidenceText")); elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); elemField.setMinOccurs(0); elemField.setNillable(false); typeDesc.addFieldDesc(elemField); } /** * Return type metadata object */ public static org.apache.axis.description.TypeDesc getTypeDesc() { return typeDesc; } /** * Get Custom Serializer */ public static org.apache.axis.encoding.Serializer getSerializer( java.lang.String mechType, java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { return new org.apache.axis.encoding.ser.BeanSerializer( _javaType, _xmlType, typeDesc); } /** * Get Custom Deserializer */ public static org.apache.axis.encoding.Deserializer getDeserializer( java.lang.String mechType, java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { return new org.apache.axis.encoding.ser.BeanDeserializer( _javaType, _xmlType, typeDesc); } }
[ "jradcliff@users.noreply.github.com" ]
jradcliff@users.noreply.github.com
f13d91ed4ac4d3ec3818b76f45fbcbb8cebf1ca2
005aa476ac9d11d36d1c0d202daa1e7c86df94c2
/hedwig-jdesignpattern/dp-advanced/src/main/java/io/hedwig/dp/advanced/refactoring/breakDepenency/Feeder.java
139f5a73c01fe5a60056bb00cd1fe3c1576e5d8e
[]
no_license
qdriven/designpattern-sanity
51d2c9ebb1970c24bb2746ac6ba38ffd966a541c
c67622c9d153a9154e941fa2aad4ab1c10dd37a9
refs/heads/master
2022-12-06T22:02:15.117957
2020-08-21T05:59:25
2020-08-21T05:59:25
98,328,079
0
0
null
2020-05-15T19:22:30
2017-07-25T16:33:31
Java
UTF-8
Java
false
false
218
java
package io.hedwig.dp.advanced.refactoring.breakDepenency; /** * Created by patrick on 15/10/29. */ public class Feeder { public static void replenishFood(){ System.out.println("replenish food"); } }
[ "patrickwuke@163.com" ]
patrickwuke@163.com
bee4951c392cc748ef4c97896a4d3832d302e210
082e26b011e30dc62a62fae95f375e4f87d9e99c
/docs/weixin_7.0.4_source/反编译源码/反混淆后/src/main/java/com/tencent/p177mm/plugin/p398f/C39004a.java
d128670b3d8c221d51885e80749a8c4331a4fc16
[]
no_license
xsren/AndroidReverseNotes
9631a5aabc031006e795a112b7ac756a8edd4385
9202c276fe9f04a978e4e08b08e42645d97ca94b
refs/heads/master
2021-04-07T22:50:51.072197
2019-07-16T02:24:43
2019-07-16T02:24:43
null
0
0
null
null
null
null
UTF-8
Java
false
false
352
java
package com.tencent.p177mm.plugin.p398f; /* renamed from: com.tencent.mm.plugin.f.a */ public final class C39004a { /* renamed from: sJ */ public static boolean m66252sJ(int i) { if (i == 2 || i == 21 || i == 22 || i == 24 || i == 25 || i == 31 || i == 33 || i == 35) { return true; } return false; } }
[ "alwangsisi@163.com" ]
alwangsisi@163.com
113652288d01c8503a80b28529b49c74b6af035b
6d9f43cfe25f91a0aba12454e193eaf8b80e6ab9
/support_lib/app/src/main/java/multi/android/support_lib/fragment/MainActivity.java
dfa57ce657da85fead219b1e251d59254930297a
[]
no_license
sonic247897/multicampus-android
5f35a9571f17bbc06a26ada415146142eb6987db
914cc401091682c77e65e9281f715d7c9873b816
refs/heads/master
2021-04-23T12:42:55.482707
2020-06-02T05:31:23
2020-06-02T05:31:23
249,926,079
0
0
null
null
null
null
UTF-8
Java
false
false
2,896
java
package multi.android.support_lib.fragment; import androidx.appcompat.app.AppCompatActivity; import androidx.fragment.app.FragmentManager; import androidx.fragment.app.FragmentTransaction; import android.os.Bundle; import android.util.Log; import android.view.View; import android.widget.Button; import multi.android.support_lib.R; public class MainActivity extends AppCompatActivity { //화면에 연결할 프레그먼트 객체를 생성한다. FirstFragment firstFragment = new FirstFragment(); SecondFragment secondFragment = new SecondFragment(); @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Button btnFirst = findViewById(R.id.btnAddFrag); Button btnRemove = findViewById(R.id.btnRemoveFrag); Button btnSecond = findViewById(R.id.btnSecondFrag); btnFirst.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { setFragment("first"); } }); btnRemove.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { setFragment("remove"); } }); btnSecond.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { setFragment("second"); } }); } //구분해 놓은 영역에 fragment를 교체해서 보여줄 메소드 public void setFragment(String name){ //fragment객체를 관리하는 관리자 객체를 구한다. FragmentManager fragmentManager = getSupportFragmentManager(); //fragment작업을 시작위한 트랜잭션객체를 구한다. -> 여기부터 트랜잭션 시작 FragmentTransaction transaction = fragmentManager.beginTransaction(); // switch나 if를 name에 따라서 돌린다. switch(name){ case "first": //지정한 fragment로 특정영역을 교체하는 작업 -> container에 firstFragment를 넣겠다. transaction.replace(R.id.container,firstFragment); break; case "remove": //firstFragment를 안 보이도록 //detach()는 한 번 제거하면 다시는 replace를 못하니까 remove를 쓴다. transaction.remove(firstFragment); break; case "second": transaction.replace(R.id.container,secondFragment); } //commitNow는 지금 당장 처리해달라고 요청 //transaction.commitNow(); //commit은 스케쥴 고려해서 적당한 시기에 변경해달라고 요청을 의뢰 (더 많이 사용!) transaction.commit(); } }
[ "sonic247897@gmail.com" ]
sonic247897@gmail.com
58fa4b133e7d923ee1c587b36fb8568445bf5b74
dea18e7c41034fb04bf11d52ae2a86e1e263d71a
/resources/src/main/java/org/bndly/ebx/resources/listener/CheckoutRequestPersistListener.java
2d36f6bc43479ff7df316b241dc355c74b0eedba
[ "Apache-2.0" ]
permissive
bndly/bndly-ebx
be3288d028a6e6dc79c900a62c95792ecdc7600d
384179bce2cac1ce55cd3d9ddb6ec12b188f3a78
refs/heads/master
2022-11-30T09:14:09.011802
2020-08-11T09:28:43
2020-08-11T09:28:43
281,734,099
2
1
null
null
null
null
UTF-8
Java
false
false
2,417
java
package org.bndly.ebx.resources.listener; /*- * #%L * org.bndly.ebx.resources * %% * Copyright (C) 2013 - 2020 Cybercon GmbH * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * #L% */ import org.bndly.ebx.resources.bpm.CheckoutBusinessProcesses; import org.bndly.ebx.model.CheckoutRequest; import org.bndly.schema.api.Record; import org.bndly.schema.api.listener.PersistListener; import org.bndly.schema.beans.ActiveRecord; import org.bndly.schema.beans.SchemaBeanFactory; import org.osgi.service.component.annotations.Activate; import org.osgi.service.component.annotations.Component; import org.osgi.service.component.annotations.Deactivate; import org.osgi.service.component.annotations.Reference; @Component(service = {CheckoutRequestPersistListener.class, PersistListener.class}, immediate = true) public class CheckoutRequestPersistListener implements PersistListener { @Reference(target = "(service.pid=org.bndly.schema.beans.SchemaBeanFactory.ebx)") private SchemaBeanFactory schemaBeanFactory; @Reference private CheckoutBusinessProcesses checkoutBusinessProcesses; @Activate public void activate() { schemaBeanFactory.getEngine().addListener(this); } @Deactivate public void deactivate() { schemaBeanFactory.getEngine().removeListener(this); } @Override public void onPersist(Record record) { if (record.getType().getName().equals(CheckoutRequest.class.getSimpleName())) { CheckoutRequest cr = schemaBeanFactory.getSchemaBean(CheckoutRequest.class, record); cr = checkoutBusinessProcesses.runCheckout(cr, record.getContext()); ((ActiveRecord) cr).update(); } } public void setSchemaBeanFactory(SchemaBeanFactory schemaBeanFactory) { this.schemaBeanFactory = schemaBeanFactory; } public void setCheckoutBusinessProcesses(CheckoutBusinessProcesses checkoutBusinessProcesses) { this.checkoutBusinessProcesses = checkoutBusinessProcesses; } }
[ "mika.goeckel@cybercon.de" ]
mika.goeckel@cybercon.de
c940fe00e510df84d2b0a1424a66dd107f85c06c
3bab81792c722411c542596fedc8e4b1d086c1a9
/src/main/java/com/gome/maven/ui/EditorComboBoxEditor.java
1faf51e0745fd5f76f7cee52d7663d2be1309217
[]
no_license
nicholas879110/maven-code-check-plugin
80d6810cc3c12a3b6c22e3eada331136e3d9a03e
8162834e19ed0a06ae5240b5e11a365c0f80d0a0
refs/heads/master
2021-04-30T07:09:42.455482
2018-03-01T03:21:21
2018-03-01T03:21:21
121,457,530
0
0
null
null
null
null
UTF-8
Java
false
false
2,397
java
/* * Copyright 2000-2009 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.gome.maven.ui; import com.gome.maven.openapi.editor.Document; import com.gome.maven.openapi.editor.Editor; import com.gome.maven.openapi.editor.ex.EditorEx; import com.gome.maven.openapi.fileTypes.FileType; import com.gome.maven.openapi.project.Project; import javax.swing.*; import java.awt.event.ActionListener; /** * Combobox items are Documents for this combobox * @author max */ public class EditorComboBoxEditor implements ComboBoxEditor{ private final EditorTextField myTextField; protected static final String NAME = "ComboBox.textField"; public EditorComboBoxEditor(Project project, FileType fileType) { myTextField = new ComboboxEditorTextField((Document)null, project, fileType) { @Override protected EditorEx createEditor() { EditorEx editor = super.createEditor(); onEditorCreate(editor); return editor; } }; myTextField.setName(NAME); } protected void onEditorCreate(EditorEx editor) {} @Override public void selectAll() { myTextField.selectAll(); myTextField.requestFocus(); } public Editor getEditor() { return myTextField.getEditor(); } @Override public EditorTextField getEditorComponent() { return myTextField; } @Override public void addActionListener(ActionListener l) { } @Override public void removeActionListener(ActionListener l) { } @Override public Object getItem() { return getDocument(); } protected Document getDocument() { return myTextField.getDocument(); } @Override public void setItem(Object anObject) { myTextField.setDocument((Document)anObject); } }
[ "zhangliewei@gome.com.cn" ]
zhangliewei@gome.com.cn
6a317b6cc3b1241c3d4d23335e77c93aa04a82bd
958af2ec9c25998e053e3e98a163b95dd969c40f
/src/main/java/org/bian/dto/SDProspectCampaignExecutionRetrieveInputModelServiceDomainRetrieveActionRecordServiceDomainActivityAnalysis.java
14deea0ff7ea1b7fa9746a3fb0ba09e169619e80
[ "Apache-2.0" ]
permissive
bianapis/sd-prospect-campaign-execution-v2
57be52ba5464ef1bebf655465d2b7a4115100dd8
d3d65fed470f9915bd98c6079d760aac06ae0c09
refs/heads/master
2020-07-24T04:26:31.097153
2019-09-12T06:21:58
2019-09-12T06:21:58
207,801,328
0
0
null
null
null
null
UTF-8
Java
false
false
1,068
java
package org.bian.dto; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import javax.validation.Valid; /** * SDProspectCampaignExecutionRetrieveInputModelServiceDomainRetrieveActionRecordServiceDomainActivityAnalysis */ public class SDProspectCampaignExecutionRetrieveInputModelServiceDomainRetrieveActionRecordServiceDomainActivityAnalysis { private String activityAnalysisReference = null; /** * `status: Not Mapped` core-data-type-reference: BIAN::DataTypesLibrary::CoreDataTypes::ISO20022andUNCEFACT::Identifier general-info: Reference to the internal activity analysis view maintained by the service center * @return activityAnalysisReference **/ public String getActivityAnalysisReference() { return activityAnalysisReference; } public void setActivityAnalysisReference(String activityAnalysisReference) { this.activityAnalysisReference = activityAnalysisReference; } }
[ "team1@bian.org" ]
team1@bian.org
6205780800a535a5196418b693b7838b81331a6c
00b960f0f03b682ba0bb7773294963461ce2b48d
/benworks-dp-javapatterns/src/main/java/com/javapatterns/command/audioplayer2/RewindCommand.java
b879a4e8f24778b6f66284a1dcc559f9f05b27d6
[]
no_license
aben328/benworks-dp
c9b9ff9868c792ed754ff494f9b0018c88346f2c
d1371011fb0b949346973c80a9255a3dcb77e20d
refs/heads/master
2020-04-25T07:28:12.047218
2015-10-24T02:18:29
2015-10-24T02:18:29
9,467,085
1
0
null
null
null
null
UTF-8
Java
false
false
292
java
package com.javapatterns.command.audioplayer2; /** * This class plays the role of Concrete Command */ public class RewindCommand implements Command { private AudioPlayer myAudio; public RewindCommand(AudioPlayer a) { myAudio = a; } public void execute() { myAudio.rewind(); } }
[ "aben328@gmail.com" ]
aben328@gmail.com
ffc93a4a4edb937574d42d77fee9050dd71999a8
4a9a1803c418ceb7739a19dbcbb47c6aa7dc6b1a
/src/chapter2/t6/MyThread2.java
7822284710ff4796bad474648c94b796a65af1ac
[]
no_license
spencercjh/multithread
f061d9f03d93b618bfa961bec9637c3183fe8c3d
2ae6871822cd5e4cabe095f7c2bc2553c381d114
refs/heads/master
2020-04-01T16:42:00.032379
2018-07-10T08:14:05
2018-07-10T08:14:05
153,393,775
1
0
null
null
null
null
UTF-8
Java
false
false
416
java
package chapter2.t6; /** * @author spencercjh */ public class MyThread2 extends Thread { private Task task; public MyThread2(Task task) { super(); this.task = task; } @Override public void run() { super.run(); CommonUtil.beginTime2 = System.currentTimeMillis(); task.doLongTimeTask(); CommonUtil.endTime2 = System.currentTimeMillis(); } }
[ "864712437@qq.com" ]
864712437@qq.com
50a6743831bea1b838e835383b6e5ac1f0e7bec6
ed5159d056e98d6715357d0d14a9b3f20b764f89
/test/irvine/oeis/a003/A003532Test.java
93ef63fee4367cabbfa049185f63c047f23da09d
[]
no_license
flywind2/joeis
c5753169cf562939b04dd246f8a2958e97f74558
e5efd6971a0062ac99f4fae21a7c78c9f9e74fea
refs/heads/master
2020-09-13T18:34:35.080552
2019-11-19T05:40:55
2019-11-19T05:40:55
null
0
0
null
null
null
null
UTF-8
Java
false
false
195
java
package irvine.oeis.a003; import irvine.oeis.AbstractSequenceTest; /** * Tests the corresponding class. * @author Sean A. Irvine */ public class A003532Test extends AbstractSequenceTest { }
[ "sairvin@gmail.com" ]
sairvin@gmail.com
464e8a3348e935ad3eee41378b3f281fcf86bff5
100898d5a2e914f09ee8a86d545bbcc7698f0962
/src/org/ojalgo/access/Access2D.java
8b94ad524027335128f6f32bd41a5a088feed041
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
jqxu/ojAlgo
6ef08b15987c1489d1a806078d278246d0339168
e91ed854e5bcde0ae2274fcae76b22601188aaf4
refs/heads/master
2021-01-15T13:00:49.290254
2015-04-07T11:09:47
2015-04-07T11:09:47
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,081
java
/* * Copyright 1997-2014 Optimatika (www.optimatika.se) * * 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 org.ojalgo.access; import java.util.List; import org.ojalgo.constant.PrimitiveMath; import org.ojalgo.function.NullaryFunction; import org.ojalgo.function.UnaryFunction; import org.ojalgo.function.VoidFunction; import org.ojalgo.random.RandomNumber; import org.ojalgo.scalar.Scalar; public interface Access2D<N extends Number> extends Structure2D, Access1D<N> { /** * This interface mimics {@linkplain Fillable}, but methods return the builder instance instead, and then * adds the {@link #build()} method. * * @author apete */ public interface Builder<I extends Access2D<?>> extends Structure2D, Access1D.Builder<I> { I build(); Builder<I> fillColumn(long row, long column, Number value); Builder<I> fillDiagonal(long row, long column, Number value); Builder<I> fillRow(long row, long column, Number value); Builder<I> set(long row, long column, double value); Builder<I> set(long row, long column, Number value); } public interface Elements extends Structure2D, Access1D.Elements { /** * @see Scalar#isAbsolute() */ boolean isAbsolute(long row, long column); /** * @see Scalar#isSmall(double) */ boolean isSmall(long row, long column, double comparedTo); /** * @see Scalar#isZero() * @deprecated v37 */ @Deprecated default boolean isZero(final long row, final long column) { return this.isSmall(row, column, PrimitiveMath.ONE); } } public interface Factory<I extends Access2D<?>> { I columns(Access1D<?>... source); I columns(double[]... source); @SuppressWarnings("unchecked") I columns(List<? extends Number>... source); I columns(Number[]... source); I copy(Access2D<?> source); I makeEye(long rows, long columns); I makeRandom(long rows, long columns, RandomNumber distribution); I makeZero(long rows, long columns); I rows(Access1D<?>... source); I rows(double[]... source); @SuppressWarnings("unchecked") I rows(List<? extends Number>... source); I rows(Number[]... source); } public interface Fillable<N extends Number> extends Structure2D, Access1D.Fillable<N> { default void fillColumn(final long row, final long column, final Access1D<N> values) { final long tmpCount = values.count(); for (long i = 0L; i < tmpCount; i++) { this.set(row + i, column, values.get(i)); } } void fillColumn(long row, long column, N value); void fillColumn(long row, long column, NullaryFunction<N> supplier); default void fillDiagonal(final long row, final long column, final Access1D<N> values) { for (long ij = 0L; ij < values.count(); ij++) { this.set(row + ij, column + ij, values.get(ij)); } } void fillDiagonal(long row, long column, N value); void fillDiagonal(long row, long column, NullaryFunction<N> supplier); default void fillRow(final long row, final long column, final Access1D<N> values) { for (long j = 0L; j < values.count(); j++) { this.set(row, column + j, values.get(j)); } } void fillRow(long row, long column, N value); void fillRow(long row, long column, NullaryFunction<N> supplier); void set(long row, long column, double value); void set(long row, long column, Number value); } public interface Iterable2D<N extends Number> extends Access2D<N> { default Iterable<Access1D<N>> columns() { return ColumnsIterator.make(this); } default Iterable<Access1D<N>> rows() { return RowsIterator.make(this); } } public interface Modifiable<N extends Number> extends Structure2D, Access1D.Modifiable<N> { void modifyColumn(long row, long column, UnaryFunction<N> function); void modifyDiagonal(long row, long column, UnaryFunction<N> function); void modifyOne(long row, long column, UnaryFunction<N> function); void modifyRow(long row, long column, UnaryFunction<N> function); } public interface Visitable<N extends Number> extends Structure2D, Access1D.Visitable<N> { void visitColumn(long row, long column, VoidFunction<N> visitor); void visitDiagonal(long row, long column, VoidFunction<N> visitor); void visitRow(long row, long column, VoidFunction<N> visitor); } /** * Extracts one element of this matrix as a double. * * @param row A row index. * @param column A column index. * @return One matrix element */ double doubleValue(long row, long column); N get(long row, long column); }
[ "apete@optimatika.se" ]
apete@optimatika.se
ea60458aa4fcbfbcb2d3180976bf4a1ba36758a5
42cbee6b16b3c7d6dde71c8c393a9ef0f60abc02
/src/main/java/com/liuyanzhao/netty/demo2/client/FirstClientHandler.java
40e748000c8eb8c0c1492f706e8b7b31119a1c4a
[]
no_license
saysky/netty-demo
b99610ff475bf3ddc650eb01ce8370d93b7d8099
1689e0a7ed70a634e2e8b571d1cb510d1f4ab218
refs/heads/master
2020-07-16T15:24:34.331971
2019-09-03T13:05:56
2019-09-03T13:05:56
205,814,709
0
0
null
2019-11-02T23:15:09
2019-09-02T08:47:08
Java
UTF-8
Java
false
false
1,147
java
package com.liuyanzhao.netty.demo2.client; import io.netty.buffer.ByteBuf; import io.netty.channel.ChannelHandlerContext; import io.netty.channel.ChannelInboundHandlerAdapter; import java.nio.charset.Charset; import java.util.Date; /** * @author 言曌 * @date 2019-09-02 17:24 */ public class FirstClientHandler extends ChannelInboundHandlerAdapter { @Override public void channelActive(ChannelHandlerContext ctx) { System.out.println(new Date() + ": 客户端写出数据"); // 1.获取数据 ByteBuf buffer = getByteBuf(ctx); // 2.写数据 ctx.channel().writeAndFlush(buffer); } private ByteBuf getByteBuf(ChannelHandlerContext ctx) { byte[] bytes = "你好,Netty!".getBytes(Charset.forName("utf-8")); ByteBuf buffer = ctx.alloc().buffer(); buffer.writeBytes(bytes); return buffer; } @Override public void channelRead(ChannelHandlerContext ctx, Object msg) { ByteBuf byteBuf = (ByteBuf) msg; System.out.println(new Date() + ": 客户端读到数据 -> " + byteBuf.toString(Charset.forName("utf-8"))); } }
[ "847064370@qq.com" ]
847064370@qq.com
12fe1af2a14cbf621b59359a6d88442bec196cdb
5e0ec9c4ad9a381aa4605eea1f80bf41a26df28b
/dataset/digits/d2b889e1ac42bc85f9df5c45c10708f46784be93d69acd1415cfd4d028cb50b19f50c374a9498c8e8b909173053a100e20c279ddb06c6359a06a920ead3e8080/003/src/test/java/introclassJava/digits_d2b889e1ac42bc85f9df5c45c10708f46784be93d69acd1415cfd4d028cb50b19f50c374a9498c8e8b909173053a100e20c279ddb06c6359a06a920ead3e8080_003BlackboxTest.java
7c7594f82a6ad81d0e7d822aaddc143d579379df
[]
no_license
dufaux/IntroClassJava
8d763bf225e8c4eec8426b919309f2ae0dc40c78
a6ac9c2d4d71621d4841bfd308a51c3eb4511606
refs/heads/master
2021-01-14T14:18:57.699360
2015-09-23T15:00:46
2015-09-23T15:03:07
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,110
java
package introclassJava; import org.junit.Test; import static org.junit.Assert.assertEquals; public class digits_d2b889e1ac42bc85f9df5c45c10708f46784be93d69acd1415cfd4d028cb50b19f50c374a9498c8e8b909173053a100e20c279ddb06c6359a06a920ead3e8080_003BlackboxTest { @Test(timeout=1000) public void test1() throws Exception { digits_d2b889e1ac42bc85f9df5c45c10708f46784be93d69acd1415cfd4d028cb50b19f50c374a9498c8e8b909173053a100e20c279ddb06c6359a06a920ead3e8080_003 mainClass = new digits_d2b889e1ac42bc85f9df5c45c10708f46784be93d69acd1415cfd4d028cb50b19f50c374a9498c8e8b909173053a100e20c279ddb06c6359a06a920ead3e8080_003(); String expected = "Enter an integer > 4 3 2 1 That's all, have a nice day!"; mainClass.scanner = new java.util.Scanner("1234"); mainClass.exec(); String out = mainClass.output.replace("\n"," ").trim(); assertEquals(expected.replace(" ",""), out.replace(" ","")); } @Test(timeout=1000) public void test2() throws Exception { digits_d2b889e1ac42bc85f9df5c45c10708f46784be93d69acd1415cfd4d028cb50b19f50c374a9498c8e8b909173053a100e20c279ddb06c6359a06a920ead3e8080_003 mainClass = new digits_d2b889e1ac42bc85f9df5c45c10708f46784be93d69acd1415cfd4d028cb50b19f50c374a9498c8e8b909173053a100e20c279ddb06c6359a06a920ead3e8080_003(); String expected = "Enter an integer > 6 7 8 -9 That's all, have a nice day!"; mainClass.scanner = new java.util.Scanner("-9876"); mainClass.exec(); String out = mainClass.output.replace("\n"," ").trim(); assertEquals(expected.replace(" ",""), out.replace(" ","")); } @Test(timeout=1000) public void test3() throws Exception { digits_d2b889e1ac42bc85f9df5c45c10708f46784be93d69acd1415cfd4d028cb50b19f50c374a9498c8e8b909173053a100e20c279ddb06c6359a06a920ead3e8080_003 mainClass = new digits_d2b889e1ac42bc85f9df5c45c10708f46784be93d69acd1415cfd4d028cb50b19f50c374a9498c8e8b909173053a100e20c279ddb06c6359a06a920ead3e8080_003(); String expected = "Enter an integer > 2 7 2 0 3 7 3 That's all, have a nice day!"; mainClass.scanner = new java.util.Scanner("3730272"); mainClass.exec(); String out = mainClass.output.replace("\n"," ").trim(); assertEquals(expected.replace(" ",""), out.replace(" ","")); } @Test(timeout=1000) public void test4() throws Exception { digits_d2b889e1ac42bc85f9df5c45c10708f46784be93d69acd1415cfd4d028cb50b19f50c374a9498c8e8b909173053a100e20c279ddb06c6359a06a920ead3e8080_003 mainClass = new digits_d2b889e1ac42bc85f9df5c45c10708f46784be93d69acd1415cfd4d028cb50b19f50c374a9498c8e8b909173053a100e20c279ddb06c6359a06a920ead3e8080_003(); String expected = "Enter an integer > 8 That's all, have a nice day!"; mainClass.scanner = new java.util.Scanner("8"); mainClass.exec(); String out = mainClass.output.replace("\n"," ").trim(); assertEquals(expected.replace(" ",""), out.replace(" ","")); } @Test(timeout=1000) public void test5() throws Exception { digits_d2b889e1ac42bc85f9df5c45c10708f46784be93d69acd1415cfd4d028cb50b19f50c374a9498c8e8b909173053a100e20c279ddb06c6359a06a920ead3e8080_003 mainClass = new digits_d2b889e1ac42bc85f9df5c45c10708f46784be93d69acd1415cfd4d028cb50b19f50c374a9498c8e8b909173053a100e20c279ddb06c6359a06a920ead3e8080_003(); String expected = "Enter an integer > 4 7 3 9 8 That's all, have a nice day!"; mainClass.scanner = new java.util.Scanner("89374"); mainClass.exec(); String out = mainClass.output.replace("\n"," ").trim(); assertEquals(expected.replace(" ",""), out.replace(" ","")); } @Test(timeout=1000) public void test6() throws Exception { digits_d2b889e1ac42bc85f9df5c45c10708f46784be93d69acd1415cfd4d028cb50b19f50c374a9498c8e8b909173053a100e20c279ddb06c6359a06a920ead3e8080_003 mainClass = new digits_d2b889e1ac42bc85f9df5c45c10708f46784be93d69acd1415cfd4d028cb50b19f50c374a9498c8e8b909173053a100e20c279ddb06c6359a06a920ead3e8080_003(); String expected = "Enter an integer > 6 6 6 6 6 6 6 That's all, have a nice day!"; mainClass.scanner = new java.util.Scanner("6666666"); mainClass.exec(); String out = mainClass.output.replace("\n"," ").trim(); assertEquals(expected.replace(" ",""), out.replace(" ","")); } }
[ "durieuxthomas@hotmail.com" ]
durieuxthomas@hotmail.com
9a503edf31ef72da001c510f147a1933b1bf5ae9
5222f9852802a6c0f54e4d9acb8991cec1fb901f
/ADTsAlgoServices/src/test/java/com/algo_data/arrays/StringIsAPermutationTest.java
b456d6ea695c8bfbf6336ff29b1534dca9715347
[]
no_license
jfspps/AlgorithmsInJava
460e50381e270f04180907a921be7f40e74918ee
83ed21449eddf120d61814329ff4329826080f22
refs/heads/main
2023-05-11T20:25:39.785645
2021-05-26T21:49:30
2021-05-26T21:49:30
329,451,170
0
0
null
null
null
null
UTF-8
Java
false
false
725
java
package com.algo_data.arrays; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.*; class StringIsAPermutationTest { StringIsAPermutation stringIsAPermutation; @BeforeEach void setUp() { stringIsAPermutation = new StringIsAPermutation("aabbccddee"); } @Test void isAPermutation1() { assertTrue(stringIsAPermutation.isAPermutation("abcdeabcde")); } @Test void isAPermutation2() { assertFalse(stringIsAPermutation.isAPermutation("1234567890")); } @Test void isAPermutation_differentLength() { assertFalse(stringIsAPermutation.isAPermutation("somethingelse")); } }
[ "jfsapps@gmail.com" ]
jfsapps@gmail.com
1393dad23add4aa0b02adfcaac1db70cb648cc55
d1ad33f6a5bd99abfc413b3c8ded8904f3d62ad0
/4.JavaCollections/src/com/javarush/task/task32/task3206/Solution.java
e8e2b5ff39f627cc7a38dc317c029e91cf50629c
[]
no_license
nikitakoliadin/JavaRushTasks
96872b9a2293e05129225f3a30f3a6c98f5ec677
9b1fbc149863043cd72150c2de7d6b7a802b3b0a
refs/heads/master
2021-09-18T09:09:44.863281
2018-07-12T11:00:39
2018-07-12T11:00:39
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,629
java
package com.javarush.task.task32.task3206; import java.lang.reflect.InvocationHandler; import java.lang.reflect.Proxy; /* Дженерики для создания прокси-объекта */ public class Solution { public static void main(String[] args) { Solution solution = new Solution(); test(solution.getProxy(Item.class)); //true false false test(solution.getProxy(Item.class, Small.class)); //true false true test(solution.getProxy(Item.class, Big.class, Small.class));//true true true test(solution.getProxy(Big.class, Small.class)); //true true true т.к. Big наследуется от Item test(solution.getProxy(Big.class)); //true true false т.к. Big наследуется от Item } public Item getProxy(Class resultType, Class... addInterfaces) { ClassLoader classLoader = this.getClass().getClassLoader(); Class<?>[] interfaces = new Class[addInterfaces.length + 1]; interfaces[0] = resultType; for (int i = 1; i < interfaces.length; i++) { interfaces[i] = addInterfaces[i - 1]; } InvocationHandler invocationHandler = new ItemInvocationHandler(); return (Item) Proxy.newProxyInstance(classLoader,interfaces, invocationHandler); } private static void test(Object proxy) { boolean isItem = proxy instanceof Item; boolean isBig = proxy instanceof Big; boolean isSmall = proxy instanceof Small; System.out.format("%b %b %b\n", isItem, isBig, isSmall); } }
[ "qThegamEp@gmail.com" ]
qThegamEp@gmail.com
4a3318ec8e7bf4d46de3fa6f6843cc345c7ad41c
c278b2e06e98b0b99ca7350cfc12d2e535db1841
/realAuth/realAuth-model/src/main/java/com/yl/realAuth/bean/CardTypeInfo.java
d7dbac8f4d5f578c36f8f2f3792a27b5b8454033
[]
no_license
SplendorAnLin/paymentSystem
ea778c03179a36755c52498fd3f5f1a5bbeb5d34
db308a354a23bd3a48ff88c16b29a43c4e483e7d
refs/heads/master
2023-02-26T14:16:27.283799
2022-10-20T07:50:35
2022-10-20T07:50:35
191,535,643
5
6
null
2023-02-22T06:42:24
2019-06-12T09:01:15
Java
UTF-8
Java
false
false
755
java
package com.yl.realAuth.bean; import java.io.Serializable; import com.yl.realAuth.enums.CardType; /** * 按卡类型区分的信息 * @author boyang.sun * @since 2016年3月8日 */ public class CardTypeInfo implements Serializable { private static final long serialVersionUID = -215604098028654109L; /** 卡类型 */ private CardType cardType; /** 支持的接口提供方编号列表 */ private String[] supportProviders; public CardType getCardType() { return cardType; } public void setCardType(CardType cardType) { this.cardType = cardType; } public String[] getSupportProviders() { return supportProviders; } public void setSupportProviders(String[] supportProviders) { this.supportProviders = supportProviders; } }
[ "zl88888@live.com" ]
zl88888@live.com
3bace5f2036367933eceff2cbf0577afb2d9faf0
bd6d40ccc1d62d3aaabaf250ec332042791fde80
/2_jsp1/src/com/bjpowernode/domain/City.java
e2224e6e5f848362c9e0087ff0f4024d5119c252
[]
no_license
DataBoxWx/mvc_servlet_3
ab9577c5f1e9f6be4829ece2aaaa217ffafe48ab
206a8118714635b072f3f1bf9089fe722d659eb5
refs/heads/master
2020-04-26T07:48:37.172198
2019-03-02T04:58:55
2019-03-02T04:58:55
null
0
0
null
null
null
null
UTF-8
Java
false
false
546
java
package com.bjpowernode.domain; public class City { private int id; private String name; private int pid; public City() { super(); } public City(int id, String name, int pid) { super(); this.id = id; this.name = name; this.pid = pid; } public int getId() { return id; } public void setId(int id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public int getPid() { return pid; } public void setPid(int pid) { this.pid = pid; } }
[ "1136421035@qq.com" ]
1136421035@qq.com
33ec6448b5fd85977913456f60bb5b712a6b808d
58c00bf811d02379aef98b6da0bdc7ff27728145
/JAVA/src/matera/jooq/routines/Existefactura.java
94632dbe715d602f980cb90acfadf017bb8b173d
[]
no_license
tinchogava/Matera
9e39ad2deb5da7f61be6854e54afb49c933fc87a
63b0f60c65af0293d6384837d03116d588996370
refs/heads/master
2021-05-05T22:30:17.306179
2018-01-03T16:06:00
2018-01-03T16:06:00
116,151,161
0
0
null
null
null
null
UTF-8
Java
false
false
1,840
java
/** * This class is generated by jOOQ */ package matera.jooq.routines; import javax.annotation.Generated; import matera.jooq.Matera; import org.jooq.Parameter; import org.jooq.impl.AbstractRoutine; /** * This class is generated by jOOQ. */ @Generated( value = { "http://www.jooq.org", "jOOQ version:3.7.2" }, comments = "This class is generated by jOOQ" ) @SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class Existefactura extends AbstractRoutine<java.lang.Void> { private static final long serialVersionUID = 819195177; /** * The parameter <code>matera.existeFactura.id_tipoComp</code>. */ public static final Parameter<Integer> ID_TIPOCOMP = createParameter("id_tipoComp", org.jooq.impl.SQLDataType.INTEGER, false); /** * The parameter <code>matera.existeFactura.numComp</code>. */ public static final Parameter<String> NUMCOMP = createParameter("numComp", org.jooq.impl.SQLDataType.VARCHAR.length(12), false); /** * The parameter <code>matera.existeFactura.id_empresa</code>. */ public static final Parameter<Integer> ID_EMPRESA = createParameter("id_empresa", org.jooq.impl.SQLDataType.INTEGER, false); /** * Create a new routine call instance */ public Existefactura() { super("existeFactura", Matera.MATERA); addInParameter(ID_TIPOCOMP); addInParameter(NUMCOMP); addInParameter(ID_EMPRESA); } /** * Set the <code>id_tipoComp</code> parameter IN value to the routine */ public void setIdTipocomp(Integer value) { setValue(ID_TIPOCOMP, value); } /** * Set the <code>numComp</code> parameter IN value to the routine */ public void setNumcomp(String value) { setValue(NUMCOMP, value); } /** * Set the <code>id_empresa</code> parameter IN value to the routine */ public void setIdEmpresa(Integer value) { setValue(ID_EMPRESA, value); } }
[ "tinchogava@gmail.com" ]
tinchogava@gmail.com
2d07dff70e3429f6ab59b9e6d4ce89061e51e472
647ec12ce50f06e7380fdbfb5b71e9e2d1ac03b4
/com.tencent.mm/classes.jar/com/tencent/mm/pluginsdk/ui/applet/t.java
f9f35f3b30626c64ccc1b66ac77f2f8e4146e6f3
[]
no_license
tsuzcx/qq_apk
0d5e792c3c7351ab781957bac465c55c505caf61
afe46ef5640d0ba6850cdefd3c11badbd725a3f6
refs/heads/main
2022-07-02T10:32:11.651957
2022-02-01T12:41:38
2022-02-01T12:41:38
453,860,108
36
9
null
2022-01-31T09:46:26
2022-01-31T02:43:22
Java
UTF-8
Java
false
false
3,446
java
package com.tencent.mm.pluginsdk.ui.applet; import android.content.Context; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.ImageView; import android.widget.TextView; import com.tencent.matrix.trace.core.AppMethodBeat; import com.tencent.mm.R.f; import com.tencent.mm.R.h; import com.tencent.mm.R.i; import com.tencent.mm.kernel.h; import com.tencent.mm.pluginsdk.ui.a.b; import java.util.List; public final class t extends BaseAdapter { private List<String> GGS; private Context mContext; private List<String> pJZ; public t(Context paramContext, List<String> paramList1, List<String> paramList2) { this.mContext = paramContext; this.pJZ = paramList2; this.GGS = paramList1; } private static a kN(View paramView) { AppMethodBeat.i(31426); a locala = new a((byte)0); locala.lBC = ((ImageView)paramView.findViewById(R.h.chatroom_member_avatar)); locala.pUL = ((TextView)paramView.findViewById(R.h.chatroom_member_name)); paramView.setTag(locala); AppMethodBeat.o(31426); return locala; } public final int getCount() { AppMethodBeat.i(31423); int i = this.pJZ.size(); AppMethodBeat.o(31423); return i; } public final Object getItem(int paramInt) { AppMethodBeat.i(31424); Object localObject = this.pJZ.get(paramInt); AppMethodBeat.o(31424); return localObject; } public final long getItemId(int paramInt) { return paramInt; } public final View getView(int paramInt, View paramView, ViewGroup paramViewGroup) { AppMethodBeat.i(31425); if (paramView == null) { paramView = View.inflate(this.mContext, R.i.chatroom_avatar_item, null); paramView.findViewById(R.h.chatroom_member_avatar).setImportantForAccessibility(2); paramViewGroup = kN(paramView); } label259: label273: for (;;) { int i = this.pJZ.size(); if ((paramInt >= 0) && (paramInt < this.pJZ.size()) && (paramInt < this.GGS.size())) { paramViewGroup.lBC.setVisibility(0); paramViewGroup.pUL.setVisibility(0); a.b.g(paramViewGroup.lBC, (String)this.GGS.get(paramInt)); paramViewGroup.pUL.setText((CharSequence)this.pJZ.get(paramInt)); paramViewGroup.pUL.setText(((com.tencent.mm.plugin.emoji.c.a)h.ax(com.tencent.mm.plugin.emoji.c.a.class)).a(this.mContext, (CharSequence)this.pJZ.get(paramInt), paramViewGroup.pUL.getTextSize())); if ((this.pJZ.size() <= 12) || (paramInt < this.pJZ.size() - i % 4)) { break label259; } paramViewGroup.pUL.setPadding(0, 0, 0, com.tencent.mm.cd.a.br(this.mContext, R.f.DialogAvatarLinePadding)); } for (;;) { AppMethodBeat.o(31425); return paramView; paramViewGroup = (a)paramView.getTag(); if (paramViewGroup != null) { break label273; } paramViewGroup = kN(paramView); break; paramViewGroup.pUL.setPadding(0, 0, 0, 0); } } } static final class a { public ImageView lBC; public TextView pUL; } } /* Location: L:\local\mybackup\temp\qq_apk\com.tencent.mm\classes3.jar * Qualified Name: com.tencent.mm.pluginsdk.ui.applet.t * JD-Core Version: 0.7.0.1 */
[ "98632993+tsuzcx@users.noreply.github.com" ]
98632993+tsuzcx@users.noreply.github.com
9d5937d03fc3ceff8889876f90253e6cb4e7d2c4
8db6c140f2f2116e9aaaedbc989434ebd17ee9be
/src/main/java/com/liushu/serviceImpl/BrowseRecordServiceImpl.java
8be8c5ad91a80e748a81dc5a16c482ca32a08e31
[]
no_license
luozuyi/liushu-browser-history-server
81aded6117f00f2096b829d14b5f167e2a1feb84
336f018eb85ab4bd1e955697e69128418c49a3c9
refs/heads/master
2020-05-02T01:33:56.700383
2019-03-26T00:53:26
2019-03-26T00:53:26
177,688,254
0
0
null
null
null
null
UTF-8
Java
false
false
6,743
java
package com.liushu.serviceImpl; import com.github.pagehelper.PageInfo; import com.liushu.api.BookFlowApi; import com.liushu.entity.BrowseRecord; import com.liushu.mapper.BrowseRecordMapper; import com.liushu.service.BrowseRecordService; import com.liushu.utils.CommonUtil; import com.liushu.utils.Constants; import com.liushu.utils.PageHelperNew; import com.liushu.utils.Result; import org.apache.commons.lang.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.interceptor.TransactionAspectSupport; import java.util.Date; import java.util.List; import java.util.Map; /** * @author mayn */ @Service @Transactional(rollbackFor = Exception.class) public class BrowseRecordServiceImpl implements BrowseRecordService{ @Autowired private BrowseRecordMapper browseRecordMapper; @Autowired private BookFlowApi bookFlowApi; @Override public Result addBrowseRecord(BrowseRecord record,String liushuUserToken) { Result result = new Result(); String code = Constants.FAIL; String msg = "初始化"; try { String userId = CommonUtil.getUserId(liushuUserToken); String bookFlowId = record.getBookFlowId(); if(StringUtils.isBlank(bookFlowId)){ code = "-3"; msg = "流书id不能为空"; }else{ BrowseRecord params = new BrowseRecord(); params.setUserId(userId); params.setBookFlowId(record.getBookFlowId()); Result removteRes = bookFlowApi.cancel(userId,record.getBookFlowId()); if(Constants.SUCCESS.equals(removteRes.getCode())){ List<BrowseRecord> browseRecordList = browseRecordMapper.selectByUserIdAndBookFlowId(params); if(!browseRecordList.isEmpty()){ code = "-4"; msg = "已经添加过"; }else{ String uuid = CommonUtil.getUUID(); record.setId(uuid); record.setCreateTime(new Date()); record.setDelFlag("0"); record.setUserId(userId); browseRecordMapper.insertSelective(record); code = Constants.SUCCESS; msg = "成功"; } }else{ code = removteRes.getCode(); msg = removteRes.getMsg(); } } }catch (Exception e){ code = Constants.ERROR; msg = "后台出错"; e.printStackTrace(); TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); } result.setCode(code); result.setMsg(msg); return result; } @Override public Result recentBrowser(String liushuUserToken,Integer pageNum,Integer pageSize) { Result result = new Result(); String code = Constants.FAIL; String msg = "初始化"; try { String userId = CommonUtil.getUserId(liushuUserToken); PageHelperNew.startPage(pageNum,pageSize); List<Map<String,Object>> mapList = browseRecordMapper.selectAllByUserId(userId); for (Map<String,Object> mapDate:mapList) { String bookFlowId = mapDate.get("bookFlowId").toString(); Map<String,Object> remoteMap = bookFlowApi.getUserAndBookFlow(bookFlowId); if(remoteMap != null && remoteMap.size() > 0){ mapDate.putAll(remoteMap); } } PageInfo<Map<String,Object>> page = new PageInfo<>(mapList); result.setData(page); code = Constants.SUCCESS; msg = "成功"; }catch (Exception e){ code = Constants.ERROR; msg = "后台出错"; e.printStackTrace(); } result.setCode(code); result.setMsg(msg); return result; } @Override public Result deleteBrowser(String liushuUserToken, String id) { Result result = new Result(); String code = Constants.FAIL; String msg = "初始化"; try { String userId = CommonUtil.getUserId(liushuUserToken); BrowseRecord browseRecord = browseRecordMapper.selectByPrimaryKey(id); if(browseRecord == null){ code = "-3"; msg = "删除的对象不存在"; }else if(!userId.equals(browseRecord.getUserId())){ code = "-4"; msg = "不是当前用户的浏览记录,无法删除"; }else { browseRecordMapper.deleteByPrimaryKey(id); code = Constants.SUCCESS; msg = "删除成功"; } }catch (Exception e){ code = Constants.ERROR; msg = "后台出错"; e.printStackTrace(); TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); } result.setCode(code); result.setMsg(msg); return result; } @Override public Result deleteMeBrowser(String liushuUserToken) { Result result = new Result(); String code = Constants.FAIL; String msg = "初始化"; try { String userId = CommonUtil.getUserId(liushuUserToken); browseRecordMapper.deleteAllByUserId(userId); code = Constants.SUCCESS; msg = "删除成功"; }catch (Exception e){ code = Constants.ERROR; msg = "后台出错"; e.printStackTrace(); TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); } result.setCode(code); result.setMsg(msg); return result; } @Override public Result selectCountByUserIdToday(String userId) { Result result = new Result(); String code = Constants.FAIL; String msg = "初始化"; try { Integer count = browseRecordMapper.selectCountByUserIdToday(userId); result.setData(count); code = Constants.SUCCESS; msg = "成功"; }catch (Exception e){ code = Constants.ERROR; msg = "后台出错"; e.printStackTrace(); TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); } result.setCode(code); result.setMsg(msg); return result; } }
[ "m13164138097@163.com" ]
m13164138097@163.com
5189b5225fa52b02938bcc106ebe37f421f9a508
5765e78b85db0ec7094fd571c96a5cf6e0ebdaad
/src/main/java/friendster/MultiFileParallelImporter.java
50bcdb151df68536eb9c4bcc2e36504ff7154eb0
[]
no_license
jexp/neo4j-dataset-import
a8a5c0260a0eabedd42f6afa93dc98c3279e395f
64695a7d5ae82e3d9acb76830b70e039fa30884f
refs/heads/master
2016-09-07T18:48:26.933104
2016-02-13T22:16:46
2016-02-13T22:16:46
33,425,438
1
0
null
null
null
null
UTF-8
Java
false
false
5,587
java
package friendster; import org.neo4j.kernel.impl.logging.LogService; import org.neo4j.kernel.impl.logging.SimpleLogService; import org.neo4j.logging.FormattedLogProvider; import org.neo4j.unsafe.impl.batchimport.Configuration; import org.neo4j.unsafe.impl.batchimport.InputIterable; import org.neo4j.unsafe.impl.batchimport.InputIterator; import org.neo4j.unsafe.impl.batchimport.ParallelBatchImporter; import org.neo4j.unsafe.impl.batchimport.cache.idmapping.IdGenerator; import org.neo4j.unsafe.impl.batchimport.cache.idmapping.IdGenerators; import org.neo4j.unsafe.impl.batchimport.cache.idmapping.IdMapper; import org.neo4j.unsafe.impl.batchimport.input.*; import org.neo4j.unsafe.impl.batchimport.staging.ExecutionMonitor; import org.neo4j.unsafe.impl.batchimport.staging.ExecutionMonitors; import java.io.*; import java.util.Iterator; /** * @author mh * @since 03.04.15 */ public class MultiFileParallelImporter { public static final int MEGA_BYTE = 1024 * 1024; private final File store; public MultiFileParallelImporter(File store) { this.store = store; } public void run(final File[] files, final IdMapper idMapper, final int badRelsTolerance, final Generator generator) throws IOException { ParallelBatchImporter importer = new ParallelBatchImporter(store, createConfiguration(), createLogging(), createExecutionMonitors()); importer.doImport(new Input() { public InputIterable<InputNode> nodes() { final InputFileIterator nodes = new InputFileIterator(files,true, generator); return new InputIterable<InputNode>() { public InputIterator<InputNode> iterator() { return new InputIterator<InputNode>() { public boolean hasNext() { return nodes.hasNext(); } public InputNode next() { return nodes.next().first(); } public void remove() { } public void close() { } public String sourceDescription() { return nodes.currentName; } public long lineNumber() { return nodes.lineNo; } public long position() { return 0; } }; } @Override public boolean supportsMultiplePasses() { return false; } }; } @Override public InputIterable<InputRelationship> relationships() { final InputFileIterator rels = new InputFileIterator(files,false, generator); return new InputIterable<InputRelationship>() { public InputIterator<InputRelationship> iterator() { return new InputIterator<InputRelationship>() { Iterator<InputRelationship> current = rels.hasNext() ? rels.next().other().iterator() : null; public boolean hasNext() { while (current == null || !current.hasNext()) { if (rels.hasNext()) { current = rels.next().other().iterator(); } else { break; } } return current != null && current.hasNext(); } public InputRelationship next() { return nextRelationship(); } private InputRelationship nextRelationship() { if (current != null && current.hasNext()) return current.next(); throw new IllegalStateException("next called despite hasNext was false"); } public void remove() { } public void close() { } public String sourceDescription() { return rels.currentName; } public long lineNumber() { return rels.lineNo; } public long position() { return 0; } }; } @Override public boolean supportsMultiplePasses() { return false; } }; } @Override public IdMapper idMapper() { return idMapper; } @Override public IdGenerator idGenerator() { return IdGenerators.startingFromTheBeginning(); } @Override public boolean specificRelationshipIds() { return false; } @Override public Collector badCollector() { return Collectors.badCollector(System.err, badRelsTolerance); } }); } protected Configuration createConfiguration() { return Configuration.DEFAULT; } protected ExecutionMonitor createExecutionMonitors() { return ExecutionMonitors.defaultVisible(); } protected LogService createLogging() { return new SimpleLogService( FormattedLogProvider.toOutputStream(System.err), FormattedLogProvider.toOutputStream(System.err)); } }
[ "github@jexp.de" ]
github@jexp.de
8b0f31f86b5ce4e72a8d23a7eca19fd79a466c43
9f8aa8c1669bbb203e7207bb09acf41ddbb721c9
/src/test/java/io/vertx/ext/stomp/verticles/StompServerVerticle.java
f92de7796c62aa0e1808fdbe92bd7bb2c5092e28
[ "Apache-2.0" ]
permissive
astery/vertx-stomp
e49395006b8d05c405eb34a9bea86e6d0d22d337
e2188d8acf2c53bb2834ea22fd9e7824045f128b
refs/heads/master
2020-12-11T01:59:43.677205
2016-07-10T20:59:07
2016-07-10T20:59:07
64,779,684
0
0
null
2016-08-02T17:56:35
2016-08-02T17:56:34
null
UTF-8
Java
false
false
1,641
java
/* * Copyright (c) 2011-2015 The original author or authors * ------------------------------------------------------ * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * and Apache License v2.0 which accompanies this distribution. * * The Eclipse Public License is available at * http://www.eclipse.org/legal/epl-v10.html * * The Apache License v2.0 is available at * http://www.opensource.org/licenses/apache2.0.php * * You may elect to redistribute this code under either of these licenses. */ package io.vertx.ext.stomp.verticles; import io.vertx.core.AbstractVerticle; import io.vertx.core.Future; import io.vertx.ext.stomp.Destination; import io.vertx.ext.stomp.StompServer; import io.vertx.ext.stomp.StompServerHandler; /** * A verticle starting a STOMP server. * * @author <a href="http://escoffier.me">Clement Escoffier</a> */ public class StompServerVerticle extends AbstractVerticle { private StompServer server; @Override public void start(Future<Void> future) throws Exception { server = StompServer.create(vertx).handler(StompServerHandler.create(vertx).destinationFactory( (vertx, name) -> { if (config().getBoolean("useQueue", false)) { return Destination.queue(vertx, name); } else { return Destination.topic(vertx, name); } })) .listen(ar -> { if (ar.failed()) { future.fail(ar.cause()); } else { future.complete(null); } }); } }
[ "clement.escoffier@gmail.com" ]
clement.escoffier@gmail.com
289e01818e48535bc02bdee60ac753afb6eb0b37
30142c5ec5e176550f46c4920269ab230e7ebb41
/smart/src/main/java/yitgogo/smart/local/model/ModelLocalServiceClass.java
55e5c8ff89cbd65592e174c057c5dde2aa4aab6e
[]
no_license
KungFuBrother/yitgogo_smart
7454d4d93149ed4bef8cac8674b2a94984d8c9af
ece40ca26f365faadad48e0467ae02fb2ab43f24
refs/heads/master
2021-01-10T16:48:24.207637
2016-01-18T09:27:18
2016-01-18T09:27:18
47,446,354
0
0
null
null
null
null
UTF-8
Java
false
false
1,616
java
package yitgogo.smart.local.model; import org.json.JSONException; import org.json.JSONObject; /** * * @author Tiger * * @JsonObject "classValueBean": { "id": 4, "classValueName": "休闲", "classImg": * null, "organizationId": "1068" } * */ public class ModelLocalServiceClass { String id = "", classValueName = "", classImg = "", organizationId = ""; public ModelLocalServiceClass() { classValueName = "所有"; } public ModelLocalServiceClass(JSONObject object) throws JSONException { if (object != null) { if (object.has("id")) { if (!object.getString("id").equalsIgnoreCase("null")) { id = object.optString("id"); } } if (object.has("classValueName")) { if (!object.getString("classValueName") .equalsIgnoreCase("null")) { classValueName = object.optString("classValueName"); } } if (object.has("classImg")) { if (!object.getString("classImg").equalsIgnoreCase("null")) { classImg = object.optString("classImg"); } } if (object.has("organizationId")) { if (!object.getString("organizationId") .equalsIgnoreCase("null")) { organizationId = object.optString("organizationId"); } } } } public String getId() { return id; } public String getClassValueName() { return classValueName; } public String getClassImg() { return classImg; } public String getOrganizationId() { return organizationId; } @Override public String toString() { return "ModelServiceClass [id=" + id + ", classValueName=" + classValueName + ", organizationId=" + organizationId + "]"; } }
[ "1076192306@qq.com" ]
1076192306@qq.com
843dc7010fefd65a12d7ded29947b17e511fb96e
13ea5da0b7b8d4ba87d622a5f733dcf6b4c5f1e3
/crash-reproduction-ws/results/XRENDERING-481-38-17-Single_Objective_GGA-WeightedSum/com/xpn/xwiki/internal/security/authorization/DefaultAuthorExecutor_ESTest.java
8466feacd0e38e5c7f94d7706dc9aab2a2128b97
[ "MIT", "CC-BY-4.0" ]
permissive
STAMP-project/Botsing-basic-block-coverage-application
6c1095c6be945adc0be2b63bbec44f0014972793
80ea9e7a740bf4b1f9d2d06fe3dcc72323b848da
refs/heads/master
2022-07-28T23:05:55.253779
2022-04-20T13:54:11
2022-04-20T13:54:11
285,771,370
0
0
null
null
null
null
UTF-8
Java
false
false
594
java
/* * This file was automatically generated by EvoSuite * Tue Mar 31 17:26:42 UTC 2020 */ package com.xpn.xwiki.internal.security.authorization; 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 DefaultAuthorExecutor_ESTest extends DefaultAuthorExecutor_ESTest_scaffolding { @Test public void notGeneratedAnyTest() { // EvoSuite did not generate any tests } }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
1985d54c0ea05f76b96ba1cc80cc52b25f8436aa
11bf48297f82d0a34648155d3fa9a6f5d501f40d
/app/src/main/java/com/leer/ZhihuDailyEasyRead/activities/BaseActivity.java
38292258bda119646fc7def2d19de32282c5b530
[ "Apache-2.0" ]
permissive
BlueLeer/ZhihuDailyEasyRead
f80836350dc71b4146c89a945ce19af43a52ca9a
5701aafbe59b866c2c0714b169ea96474c33f3ea
refs/heads/master
2020-12-03T04:15:51.328307
2017-07-04T15:28:25
2017-07-04T15:28:25
95,840,574
0
0
null
null
null
null
UTF-8
Java
false
false
2,409
java
package com.leer.ZhihuDailyEasyRead.activities; import android.annotation.TargetApi; import android.os.Build; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.Window; import android.view.WindowManager; import com.leer.ZhihuDailyEasyRead.R; import com.leer.ZhihuDailyEasyRead.utils.ResUtils; public class BaseActivity extends AppCompatActivity { //true:日间模式 //false:夜间模式 protected boolean isDay = true; protected int mDayBackGroundTitleColor; protected int mDayTextColor; protected int mNightBackgroundColor; protected int mNightTextColor; protected int mDayBackgroundColor; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); initColor(); } private void initColor() { mDayBackGroundTitleColor = ResUtils.getColorRes(R.color.dayBackgroundTitle); mDayTextColor = ResUtils.getColorRes(R.color.dayTextcolor); mNightBackgroundColor = ResUtils.getColorRes(R.color.nightBackGround); mNightTextColor = ResUtils.getColorRes(R.color.nightTextColor); mDayBackgroundColor = ResUtils.getColorRes(R.color.dayBackGround); } //子类选择性的继承此方法,当有新的显示元素加入的时候,应该给view元素设置两种主题: //日间模式 夜间模式 protected void updateTheme() { updateStatusColor(); } @TargetApi(21) protected void updateStatusColor() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { Window window = getWindow(); //设置沉浸式状态栏 window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); window.setStatusBarColor(isDay ? mDayBackGroundTitleColor : mNightBackgroundColor); } } public boolean isDay() { return isDay; } public void setDay(boolean day) { isDay = day; } public int getDayBackGroundTitleColor() { return mDayBackGroundTitleColor; } public int getDayTextColor() { return mDayTextColor; } public int getNightBackgroundColor() { return mNightBackgroundColor; } public int getNightTextColor() { return mNightTextColor; } public int getDayBackgroundColor() { return mDayBackgroundColor; } }
[ "251668577@qq.com" ]
251668577@qq.com
0eccd9952235f309b2984fd00a51b205db710496
1bf992c1f207fd5bb5dc31cf4214389976e4dfbb
/src/test/java/com/bottega/demo/JavaNewTest.java
a9349e8318b79539c817979be8a8557e99ad0a3d
[]
no_license
Wtorek007/ej_107
c391d7a12a9fecac2aa572e9605fe5d02366f16b
ae094a6de920bb80fdd48250aefb87479f37913a
refs/heads/master
2022-11-14T01:33:52.022610
2020-07-03T14:59:09
2020-07-03T14:59:09
277,241,971
1
0
null
2020-07-05T06:08:31
2020-07-05T06:08:31
null
UTF-8
Java
false
false
1,501
java
package com.bottega.demo; import org.junit.Test; import java.util.List; import java.util.Optional; import java.util.function.Function; import java.util.stream.Stream; import static java.util.stream.Collectors.counting; import static java.util.stream.Collectors.summingInt; import static java.util.stream.Collectors.teeing; import static java.util.stream.Collectors.toList; public class JavaNewTest { // https://github.com/AdoptOpenJDK/jdk-api-diff @Test public void example_optional() throws Exception { String Optional<Integer> optional = Optional.empty(); Optional<Integer> or = optional.or(() -> Optional.of(42)); Optional<Integer> o2 = Optional.ofNullable(2); Integer integer = o2.orElseThrow(); } @Test public void example_stream() throws Exception { Stream<Object> objectStream = Stream.ofNullable(null); objectStream.forEach(System.out::println); Stream.iterate(0, i -> i + 1) .takeWhile(i -> i < 20) .forEach(System.out::println); } @Test public void example_teeing() throws Exception { Long collect = Stream.of(1, 2, 3) .collect(teeing(counting(), summingInt(i -> i), (count, sum) -> sum / count)); System.out.println(collect); } static Function<List<Optional<Integer>>, List<Integer>> L12_filterPresentJDK14() { return list -> list.stream() .flatMap(Optional::stream) .collect(toList()); } }
[ "gpiwowarek@gmail.com" ]
gpiwowarek@gmail.com
eeb59c4340b7705b363821e07e73822a54fbc71b
97ebce273043b4244721c826391053ea828af49c
/EasyBarrage/src/main/java/com/kd/easybarrage/DecelerateAccelerateInterpolator.java
ac8fa3b4aee127699cdafebe1ef4632c1b368f1a
[]
no_license
Joyounger/BulletComments
2e83ba33f3e6c2f128ed16f1bdf613fd8cf47acd
02f7980b420a391103cc4c4f034e662f7305aed5
refs/heads/master
2020-03-19T02:02:54.221057
2018-09-28T07:42:46
2018-09-28T07:42:46
135,593,739
1
0
null
null
null
null
UTF-8
Java
false
false
302
java
package com.kd.easybarrage; import android.view.animation.Interpolator; public class DecelerateAccelerateInterpolator implements Interpolator { @Override public float getInterpolation(float input) { return (float) (Math.tan((input * 2 - 1) / 4 * Math.PI)) / 2.0f + 0.5f; } }
[ "942510346@qq.com" ]
942510346@qq.com
0de966b732ec5fddad1c4bcd2c9d4e5a8358af29
7b82d70ba5fef677d83879dfeab859d17f4809aa
/tmp/sys/Naive13/naive-cxf-model/src/main/java/org/duomn/naive/cxf/model/restful/service/IRESTSample.java
38a9dae3d2a2aa3ea0ff2c83840613214c79df1a
[]
no_license
apollowesley/jun_test
fb962a28b6384c4097c7a8087a53878188db2ebc
c7a4600c3f0e1b045280eaf3464b64e908d2f0a2
refs/heads/main
2022-12-30T20:47:36.637165
2020-10-13T18:10:46
2020-10-13T18:10:46
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,541
java
package org.duomn.naive.cxf.model.restful.service; import java.io.IOException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.ws.rs.Consumes; import javax.ws.rs.DELETE; import javax.ws.rs.GET; import javax.ws.rs.POST; import javax.ws.rs.PUT; import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.Produces; import javax.ws.rs.core.Context; import javax.ws.rs.core.MediaType; import org.duomn.naive.cxf.model.restful.entity.MapBean; import org.duomn.naive.cxf.model.restful.entity.User; import org.duomn.naive.cxf.model.restful.entity.Users; @Path("/sample") public interface IRESTSample { @GET @Produces(MediaType.TEXT_PLAIN) String doGet(); @GET @Produces(MediaType.TEXT_PLAIN) String doRequest(@PathParam("param") String param, @Context HttpServletRequest reqeust, @Context HttpServletResponse response); @GET @Path("/bean/{id}") @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) User getBean(@PathParam("id") int id); @GET @Path("/list") @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) Users getList(); @GET @Path("/map") @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) MapBean getMap(); @POST @Path("/postData") User postData(User user) throws IOException; @PUT @Path("/putData/{id}") @Consumes(MediaType.APPLICATION_XML) User putData(@PathParam("id") int id, User user); @DELETE @Path("/removeData/{id}") void deleteData(@PathParam("id") int id); }
[ "wujun728@hotmail.com" ]
wujun728@hotmail.com
4c6edd59240af520dd8d70bf2ba6c6b794d102e6
64b47f83d313af33804b946d0613760b8ff23840
/tags/dev-3-1-9/weka/classifiers/j48/MakeDecList.java
11b934c3e4b597e1fcdee5a68ef6e38fd7bbc9df
[]
no_license
hackerastra/weka
afde1c7ab0fbf374e6d6ac6d07220bfaffb9488c
c8366c454e9718d0e1634ddf4a72319dac3ce559
refs/heads/master
2021-05-28T08:25:33.811203
2015-01-22T03:12:18
2015-01-22T03:12:18
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,485
java
/* * MakeDecList.java * Copyright (C) 1999 Eibe Frank * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 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, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ package weka.classifiers.j48; import java.util.*; import java.io.*; import weka.core.*; import weka.classifiers.*; /** * Class for handling a decision list. * * @author Eibe Frank (eibe@cs.waikato.ac.nz) * @version $Revision: 1.4 $ */ public class MakeDecList implements Serializable { /** Vector storing the rules. */ private Vector theRules; /** The confidence for C45-type pruning. */ private double CF = 0.25f; /** Minimum number of objects */ private int minNumObj; /** The model selection method. */ private ModelSelection toSelectModeL; /** How many subsets of equal size? One used for pruning, the rest for training. */ private int numSetS = 3; /** Use reduced error pruning? */ private boolean reducedErrorPruning = false; /** * Constructor for dec list pruned using C4.5 pruning. */ public MakeDecList(ModelSelection toSelectLocModel, double cf, int minNum){ toSelectModeL = toSelectLocModel; CF = cf; reducedErrorPruning = false; minNumObj = minNum; } /** * Constructor for dec list pruned using hold-out pruning. */ public MakeDecList(ModelSelection toSelectLocModel, int num, int minNum){ toSelectModeL = toSelectLocModel; numSetS = num; reducedErrorPruning = true; minNumObj = minNum; } /** * Builds dec list. * * @exception Exception if dec list can't be built successfully */ public void buildClassifier(Instances data) throws Exception{ ClassifierDecList currentRule; double currentWeight; Instances oldGrowData, newGrowData, oldPruneData, newPruneData; int numRules = 0; if (data.classAttribute().isNumeric()) throw new Exception("Class is numeric!"); if (data.checkForStringAttributes()) { throw new Exception("Can't handle string attributes!"); } theRules = new Vector(); data = new Instances(data); data.deleteWithMissingClass(); if (data.numInstances() == 0) throw new Exception("No training instances/Only instances with missing class!"); if (reducedErrorPruning) { data.stratify(numSetS); oldGrowData = data.trainCV(numSetS, numSetS - 1); oldPruneData = data.testCV(numSetS, numSetS - 1); } else { oldGrowData = data; oldPruneData = null; } while (Utils.gr(oldGrowData.numInstances(),0)){ // Create rule if (reducedErrorPruning) { currentRule = new PruneableDecList(toSelectModeL, minNumObj); ((PruneableDecList)currentRule).buildRule(oldGrowData, oldPruneData); } else { currentRule = new C45PruneableDecList(toSelectModeL, CF, minNumObj); ((C45PruneableDecList)currentRule).buildRule(oldGrowData); } numRules++; // Remove instances from growing data newGrowData = new Instances(oldGrowData, oldGrowData.numInstances()); Enumeration enum = oldGrowData.enumerateInstances(); while (enum.hasMoreElements()) { Instance instance = (Instance) enum.nextElement(); currentWeight = currentRule.weight(instance); if (Utils.sm(currentWeight,1)) { instance.setWeight(instance.weight()*(1-currentWeight)); newGrowData.add(instance); } } newGrowData.compactify(); oldGrowData = newGrowData; // Remove instances from pruning data if (reducedErrorPruning) { newPruneData = new Instances(oldPruneData, oldPruneData.numInstances()); enum = oldPruneData.enumerateInstances(); while (enum.hasMoreElements()) { Instance instance = (Instance) enum.nextElement(); currentWeight = currentRule.weight(instance); if (Utils.sm(currentWeight,1)) { instance.setWeight(instance.weight()*(1-currentWeight)); newPruneData.add(instance); } } newPruneData.compactify(); oldPruneData = newPruneData; } theRules.addElement(currentRule); } } /** * Outputs the classifier into a string. */ public String toString(){ StringBuffer text = new StringBuffer(); for (int i=0;i<theRules.size();i++) text.append((ClassifierDecList)theRules.elementAt(i)+"\n"); text.append("Number of Rules : \t"+theRules.size()+"\n"); return text.toString(); } /** * Classifies an instance. * * @exception Exception if instance can't be classified */ public double classifyInstance(Instance instance) throws Exception { double maxProb = -1; double [] sumProbs; int maxIndex = 0; sumProbs = distributionForInstance(instance); for (int j = 0; j < sumProbs.length; j++) { if (Utils.gr(sumProbs[j],maxProb)){ maxIndex = j; maxProb = sumProbs[j]; } } return (double)maxIndex; } /** * Returns the class distribution for an instance. * * @exception Exception if distribution can't be computed */ public double[] distributionForInstance(Instance instance) throws Exception { double [] currentProbs = null; double [] sumProbs; double currentWeight, weight = 1; int i,j; // Get probabilities. sumProbs = new double [instance.numClasses()]; i = 0; while (Utils.gr(weight,0)){ currentWeight = ((ClassifierDecList)theRules.elementAt(i)).weight(instance); if (Utils.gr(currentWeight,0)) { currentProbs = ((ClassifierDecList)theRules.elementAt(i)). distributionForInstance(instance); for (j = 0; j < sumProbs.length; j++) sumProbs[j] += weight*currentProbs[j]; weight = weight*(1-currentWeight); } i++; } return sumProbs; } /** * Outputs the number of rules in the classifier. */ public int numRules(){ return theRules.size(); } }
[ "(no author)@e0a1b77d-ad91-4216-81b1-defd5f83fa92" ]
(no author)@e0a1b77d-ad91-4216-81b1-defd5f83fa92
dad8672844e875b2738def2ad56f0cd996409cc9
0ec9946a46c6dafcb2440d7f6e3e8d897f950313
/Java_source/SecondStudyPartTwo/src/chapter13innerClass_Lambda_Stream/sub3Stream/Book.java
4883e3bf7bebd62a522336c83a9e3e833245178d
[]
no_license
hamilkarr/Java
14c8286f1ecc5edd41bb2956dfd108d7fa9de9d5
f0c209446d35fe2cf48b0d6244ae0a56ac0bf597
refs/heads/main
2023-09-05T17:08:30.344966
2021-11-24T09:13:03
2021-11-24T09:13:03
398,113,790
0
0
null
null
null
null
UTF-8
Java
false
false
590
java
package chapter13innerClass_Lambda_Stream.sub3Stream; public class Book { private String bookname; private int price; public Book(String bookname, int price) { this.bookname = bookname; this.price = price; } public String getBookname() { return bookname; } public void setBookname(String bookname) { this.bookname = bookname; } public int getPrice() { return price; } public void setPrice(int price) { this.price = price; } @Override public String toString() { return "책 이름: " + bookname + ", 판매가: " + price; } }
[ "12uclock@gmail.com" ]
12uclock@gmail.com
4baa5fbe050ffb5e399a42ca9d80c59a085dbcef
fce96c44f8915a4795d13c16f8267554901a7ca9
/edu.xjtu.cdl2bpel.designer/src/edu/xjtu/cdl2bpel/designer/editor/DelegatingCommandStack.java
f8fe15d42211c64ce605a089c3bc28306650f065
[]
no_license
lpwwpl/cdl2bpel
1d37b00a062f397257982222ca486f347f756560
de538a4eec0a8b1a64549cbe98e5cb53633a25eb
refs/heads/master
2021-04-27T00:23:26.552930
2018-03-04T16:04:34
2018-03-04T16:04:34
123,804,275
0
0
null
null
null
null
UTF-8
Java
false
false
2,857
java
package edu.xjtu.cdl2bpel.designer.editor; import java.util.EventObject; import org.eclipse.gef.commands.Command; import org.eclipse.gef.commands.CommandStack; import org.eclipse.gef.commands.CommandStackListener; import org.eclipse.gef.commands.UnexecutableCommand; public class DelegatingCommandStack extends CommandStack implements CommandStackListener { public CommandStack getCurrentCommandStack() { return currentCommandStack; } public void setCurrentCommandStack(CommandStack stack) { if (currentCommandStack == stack) { return; } if (null != currentCommandStack) { currentCommandStack.removeCommandStackListener(this); } currentCommandStack = stack; currentCommandStack.addCommandStackListener(this); notifyListeners(); } public boolean canRedo() { if (null == currentCommandStack) { return false; } return currentCommandStack.canRedo(); } public boolean canUndo() { if (null == currentCommandStack) { return false; } return currentCommandStack.canUndo(); } public void dispose() { if (null != currentCommandStack) { currentCommandStack.dispose(); } } public void execute(Command command) { if (null != currentCommandStack) { currentCommandStack.execute(command); } } public void flush() { if (null != currentCommandStack) { currentCommandStack.flush(); } } public Object[] getCommands() { if (null == currentCommandStack) { return EMPTY_OBJECT_ARRAY; } return currentCommandStack.getCommands(); } public Command getRedoCommand() { if (null == currentCommandStack) { return UnexecutableCommand.INSTANCE; } return currentCommandStack.getRedoCommand(); } public Command getUndoCommand() { if (null == currentCommandStack) { return UnexecutableCommand.INSTANCE; } return currentCommandStack.getUndoCommand(); } public int getUndoLimit() { if (null == currentCommandStack) { return -1; } return currentCommandStack.getUndoLimit(); } public boolean isDirty() { if (null == currentCommandStack) { return false; } return currentCommandStack.isDirty(); } public void markSaveLocation() { if (null != currentCommandStack) { currentCommandStack.markSaveLocation(); } } public void redo() { if (null != currentCommandStack) { currentCommandStack.redo(); } } public void setUndoLimit(int undoLimit) { if (null != currentCommandStack) { currentCommandStack.setUndoLimit(undoLimit); } } public void undo() { if (null != currentCommandStack) { currentCommandStack.undo(); } } public String toString() { return "DelegatingCommandStack(" + currentCommandStack + ")"; } public void commandStackChanged(EventObject event) { notifyListeners(); } private static final Object[] EMPTY_OBJECT_ARRAY = new Object[] {}; private CommandStack currentCommandStack; }
[ "linpeiwen@cmbc.com.cn" ]
linpeiwen@cmbc.com.cn
e173c4012624f0e4b1736cfa51751a245f5275e4
e74fe300c96ae1a93f0f508ce8480a8a453e07b7
/main/src/java/main/self/micromagic/eterna/model/impl/MapGetter.java
60e4b20bc282516b621d90fe22b9fd8c732ad162
[ "Apache-2.0" ]
permissive
vector-ding/eterna
53299fd9916f897533966eda9512b5cbea5f7220
7fc445405ed7cfa6ca4bfbfa243ae29f6bb50eb8
refs/heads/master
2021-01-22T17:39:10.202572
2015-01-06T11:14:29
2015-01-06T11:14:29
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,542
java
/* * Copyright 2009-2015 xinjunli (micromagic@sina.com). * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package self.micromagic.eterna.model.impl; import java.util.Map; import java.util.HashMap; import self.micromagic.eterna.model.AppData; import self.micromagic.util.container.ValueContainerMap; import self.micromagic.util.container.RequestHeaderContainer; import self.micromagic.util.container.CookieContainer; /** * 用于获取AppData中各类map的工具. */ public interface MapGetter { Map getMap(AppData data); /** * 在AppData中存放特殊的map的标签. */ String SPECIAL_MAP_FLAG = "appData.special.map"; } /** * 用于获取基本的param, attr, session, data这4个map. */ class BaseMapGetter implements MapGetter { private int mapIndex; public BaseMapGetter(int mapIndex) { this.mapIndex = mapIndex; } public Map getMap(AppData data) { return data.maps[this.mapIndex]; } } /** * 用于获取header. */ class HeaderGetter implements MapGetter { public Map getMap(AppData data) { Map r = (Map) data.getSpcialData(SPECIAL_MAP_FLAG, "header"); if (r == null) { if (data.getHttpServletRequest() == null) { r = new HashMap(); } else { r = ValueContainerMap.create( new RequestHeaderContainer(data.getHttpServletRequest(), data.getHttpServletResponse())); } data.addSpcialData(SPECIAL_MAP_FLAG, "header", r); } return r; } } /** * 用于获取cookie. */ class CookieGetter implements MapGetter { public Map getMap(AppData data) { Map r = (Map) data.getSpcialData(SPECIAL_MAP_FLAG, "cookie"); if (r == null) { if (data.getHttpServletRequest() == null) { r = new HashMap(); } else { r = ValueContainerMap.create( new CookieContainer(data.getHttpServletRequest(), data.getHttpServletResponse())); } data.addSpcialData(SPECIAL_MAP_FLAG, "cookie", r); } return r; } }
[ "micromagic@sina.com" ]
micromagic@sina.com
c67c800d2b82c5c3aeb746c6cf8f474e076a7a61
516fb367430d4c1393f4cd726242618eca862bda
/sources/com/google/android/gms/internal/measurement/zzrn.java
aa943cb101500d23c647a4b0e0e9700c30d07187
[]
no_license
cmFodWx5YWRhdjEyMTA5/Gaana2
75d6d6788e2dac9302cff206a093870e1602921d
8531673a5615bd9183c9a0466325d0270b8a8895
refs/heads/master
2020-07-22T15:46:54.149313
2019-06-19T16:11:11
2019-06-19T16:11:11
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,067
java
package com.google.android.gms.internal.measurement; import java.util.ArrayList; import java.util.List; public final class zzrn { private final List<zzri> zzboz; private final List<zzri> zzbpa; private final List<zzri> zzbpb; private final List<zzri> zzbpc; private final List<zzri> zzbqf; private final List<zzri> zzbqg; private final List<String> zzbqh; private final List<String> zzbqi; private final List<String> zzbqj; private final List<String> zzbqk; private zzrn() { this.zzboz = new ArrayList(); this.zzbpa = new ArrayList(); this.zzbpb = new ArrayList(); this.zzbpc = new ArrayList(); this.zzbqf = new ArrayList(); this.zzbqg = new ArrayList(); this.zzbqh = new ArrayList(); this.zzbqi = new ArrayList(); this.zzbqj = new ArrayList(); this.zzbqk = new ArrayList(); } public final zzrn zzd(zzri zzri) { this.zzboz.add(zzri); return this; } public final zzrn zze(zzri zzri) { this.zzbpa.add(zzri); return this; } public final zzrn zzf(zzri zzri) { this.zzbpb.add(zzri); return this; } public final zzrn zzfj(String str) { this.zzbqj.add(str); return this; } public final zzrn zzg(zzri zzri) { this.zzbpc.add(zzri); return this; } public final zzrn zzfk(String str) { this.zzbqk.add(str); return this; } public final zzrn zzh(zzri zzri) { this.zzbqf.add(zzri); return this; } public final zzrn zzfl(String str) { this.zzbqh.add(str); return this; } public final zzrn zzi(zzri zzri) { this.zzbqg.add(zzri); return this; } public final zzrn zzfm(String str) { this.zzbqi.add(str); return this; } public final zzrm zztg() { return new zzrm(this.zzboz, this.zzbpa, this.zzbpb, this.zzbpc, this.zzbqf, this.zzbqg, this.zzbqh, this.zzbqi, this.zzbqj, this.zzbqk); } }
[ "master@master.com" ]
master@master.com
e213c33d7d4c0a1d3cfe9385e387c087ae156cf1
f0568343ecd32379a6a2d598bda93fa419847584
/modules/adwords_appengine/src/main/java/com/google/api/ads/adwords/jaxws/v201309/cm/Location.java
a14b99715c110dfd9052880ad5a2c61c2db25837
[ "Apache-2.0" ]
permissive
frankzwang/googleads-java-lib
bd098b7b61622bd50352ccca815c4de15c45a545
0cf942d2558754589a12b4d9daa5902d7499e43f
refs/heads/master
2021-01-20T23:20:53.380875
2014-07-02T19:14:30
2014-07-02T19:14:30
21,526,492
1
0
null
null
null
null
UTF-8
Java
false
false
4,277
java
package com.google.api.ads.adwords.jaxws.v201309.cm; import java.util.ArrayList; import java.util.List; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlType; /** * * Represents Location criterion. * <p>A criterion of this type can only be created using an ID. A criterion of this type can be either targeted or excluded. * <span class="constraint AdxEnabled">This is enabled for AdX.</span> * * * <p>Java class for Location complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="Location"> * &lt;complexContent> * &lt;extension base="{https://adwords.google.com/api/adwords/cm/v201309}Criterion"> * &lt;sequence> * &lt;element name="locationName" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="displayType" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="targetingStatus" type="{https://adwords.google.com/api/adwords/cm/v201309}LocationTargetingStatus" minOccurs="0"/> * &lt;element name="parentLocations" type="{https://adwords.google.com/api/adwords/cm/v201309}Location" maxOccurs="unbounded" minOccurs="0"/> * &lt;/sequence> * &lt;/extension> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "Location", propOrder = { "locationName", "displayType", "targetingStatus", "parentLocations" }) public class Location extends Criterion { protected String locationName; protected String displayType; protected LocationTargetingStatus targetingStatus; protected List<Location> parentLocations; /** * Gets the value of the locationName property. * * @return * possible object is * {@link String } * */ public String getLocationName() { return locationName; } /** * Sets the value of the locationName property. * * @param value * allowed object is * {@link String } * */ public void setLocationName(String value) { this.locationName = value; } /** * Gets the value of the displayType property. * * @return * possible object is * {@link String } * */ public String getDisplayType() { return displayType; } /** * Sets the value of the displayType property. * * @param value * allowed object is * {@link String } * */ public void setDisplayType(String value) { this.displayType = value; } /** * Gets the value of the targetingStatus property. * * @return * possible object is * {@link LocationTargetingStatus } * */ public LocationTargetingStatus getTargetingStatus() { return targetingStatus; } /** * Sets the value of the targetingStatus property. * * @param value * allowed object is * {@link LocationTargetingStatus } * */ public void setTargetingStatus(LocationTargetingStatus value) { this.targetingStatus = value; } /** * Gets the value of the parentLocations property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the parentLocations property. * * <p> * For example, to add a new item, do as follows: * <pre> * getParentLocations().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link Location } * * */ public List<Location> getParentLocations() { if (parentLocations == null) { parentLocations = new ArrayList<Location>(); } return this.parentLocations; } }
[ "jradcliff@google.com" ]
jradcliff@google.com
2657a57a22f36f3a022f5d11a1af2b72f554d2e9
28dc3d526351dff4ca66ae1579cce77c6972b0fc
/src/test/java/com/berzenin/university/web/mvc/TimetableViewIntegrationTest.java
b7f873a65aa02f938555582d7910ac3aeb6b4bd5
[]
no_license
FilippBerzenin/WEB-Service_University
196512f1952c965df0322bf1818369ee4c6ef4d6
2d0a256e89213d52fda21ac1024918f4aabc63a8
refs/heads/master
2020-04-18T07:32:03.747260
2019-02-28T08:57:52
2019-02-28T08:57:52
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,733
java
package com.berzenin.university.web.mvc; import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertThat; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.forwardedUrl; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.model; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.view; import java.time.LocalDate; import java.time.LocalTime; import java.util.Arrays; import java.util.List; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.test.context.junit4.SpringRunner; import com.berzenin.university.model.university.Exercise; import com.berzenin.university.web.IntegrationTest; import com.berzenin.university.web.dto.TimetableRequest; @RunWith(SpringRunner.class) public class TimetableViewIntegrationTest extends IntegrationTest { private Exercise first; private Exercise second; @Before public void setUp() { // Given first = new Exercise(0L, "first", LocalDate.of(2019, 7, 15), LocalTime.of(12, 00), LocalTime.of(12, 00), null); second = new Exercise(1L, "second", LocalDate.of(2019, 7, 15), LocalTime.of(12, 00), LocalTime.of(12, 00), null); } @Test public void findAllExercisesBetweenDatesForStudentTest() throws Exception { // Given TimetableRequest timetableRequest = new TimetableRequest(0L, "Student", "Student", LocalDate.of(2019, 02, 20), LocalDate.of(2019, 02, 20)); when(timetableService.findAllExercisesBetweenDatesForStudent(timetableRequest)).thenReturn(Arrays.asList(first, second)); // Then subject.perform(post("/timetable/createRequest/student") .flashAttr("entityFor", timetableRequest)) .andDo(print()) .andExpect(status().isCreated()) .andExpect(forwardedUrl("timetable")) .andExpect(view().name("timetable")) .andExpect(model().attributeExists("listOfEntites")); // When verify(timetableService).findAllExercisesBetweenDatesForStudent(timetableRequest); List<Exercise> exercises = timetableService.findAllExercisesBetweenDatesForStudent(timetableRequest); assertThat(exercises.get(0).getId(), is(0L)); assertThat(exercises.get(1).getId(), is(1L)); assertThat(exercises.get(0).getName(), is("first")); assertThat(exercises.get(1).getName(), is("second")); assertThat(exercises.get(0).getDate(), is(LocalDate.of(2019, 7, 15))); assertThat(exercises.get(1).getDate(), is(LocalDate.of(2019, 7, 15))); assertThat(exercises.get(0).getTimeBegin(), is(LocalTime.of(12, 00))); assertThat(exercises.get(1).getTimeBegin(), is(LocalTime.of(12, 00))); assertThat(exercises.get(0).getTimeFinish(), is(LocalTime.of(12, 00))); assertThat(exercises.get(1).getTimeFinish(), is(LocalTime.of(12, 00))); } @Test public void findAllExercisesBetweenDatesForTeacherTest() throws Exception { // Given TimetableRequest timetableRequest = new TimetableRequest(0L, "Student", "Student", LocalDate.of(2019, 02, 20), LocalDate.of(2019, 02, 20)); when(timetableService.findAllExercisesBetweenDatesForTeacher(timetableRequest)).thenReturn(Arrays.asList(first, second)); // Then subject.perform(post("/timetable/createRequest/teacher") .flashAttr("entityFor", timetableRequest)) .andDo(print()) .andExpect(status().isCreated()) .andExpect(forwardedUrl("timetable")) .andExpect(view().name("timetable")) .andExpect(model().attributeExists("listOfEntites")); // When verify(timetableService).findAllExercisesBetweenDatesForTeacher(timetableRequest); List<Exercise> exercises = timetableService.findAllExercisesBetweenDatesForTeacher(timetableRequest); assertThat(exercises.get(0).getId(), is(0L)); assertThat(exercises.get(1).getId(), is(1L)); assertThat(exercises.get(0).getName(), is("first")); assertThat(exercises.get(1).getName(), is("second")); assertThat(exercises.get(0).getDate(), is(LocalDate.of(2019, 7, 15))); assertThat(exercises.get(1).getDate(), is(LocalDate.of(2019, 7, 15))); assertThat(exercises.get(0).getTimeBegin(), is(LocalTime.of(12, 00))); assertThat(exercises.get(1).getTimeBegin(), is(LocalTime.of(12, 00))); assertThat(exercises.get(0).getTimeFinish(), is(LocalTime.of(12, 00))); assertThat(exercises.get(1).getTimeFinish(), is(LocalTime.of(12, 00))); } }
[ "filipp.berzenin@gmail.com" ]
filipp.berzenin@gmail.com
20a8e2f1fdec6dcca2640b4cbe402983bbd57227
a4a51084cfb715c7076c810520542af38a854868
/src/main/java/com/salesforce/android/chat/ui/internal/view/ViewBinderBuilder.java
143df6879831528efb524315755d7ab77306ef8c
[]
no_license
BharathPalanivelu/repotest
ddaf56a94eb52867408e0e769f35bef2d815da72
f78ae38738d2ba6c9b9b4049f3092188fabb5b59
refs/heads/master
2020-09-30T18:55:04.802341
2019-12-02T10:52:08
2019-12-02T10:52:08
null
0
0
null
null
null
null
UTF-8
Java
false
false
447
java
package com.salesforce.android.chat.ui.internal.view; import com.salesforce.android.chat.ui.internal.presenter.Presenter; import com.salesforce.android.chat.ui.internal.util.SparseArrayEntry; import com.salesforce.android.chat.ui.internal.view.ViewBinder; public interface ViewBinderBuilder<V extends ViewBinder, P extends Presenter> extends SparseArrayEntry { V build(); int getKey(); ViewBinderBuilder<V, P> setPresenter(P p); }
[ "noiz354@gmail.com" ]
noiz354@gmail.com
79d56c9405ecd621a7b8f6407a11fd50ffbee897
e7ffffbc801386e79d2a92b1b7c7f524c933c345
/app/src/main/java/com/yiwo/friendscometogether/newpage/CreateFriendRememberActivityNew.java
e0420c8c0d12ff84bea2f2f8a500b02f24cb3bce
[]
no_license
aartisoft/FriendsComeTogether
b5848dc2c8241162e76c83da596dbc21d970ace2
215671762545ea79ab617bf0cd5156e5fe63d5a0
refs/heads/master
2020-06-12T00:43:53.717156
2019-06-27T08:56:32
2019-06-27T08:56:32
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,447
java
package com.yiwo.friendscometogether.newpage; import android.content.Context; import android.content.Intent; import android.graphics.Color; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.view.ViewPager; import android.os.Bundle; import android.util.Log; import android.view.View; import com.yatoooon.screenadaptation.ScreenAdapterTools; import com.yiwo.friendscometogether.R; import com.yiwo.friendscometogether.base.BaseActivity; import com.yiwo.friendscometogether.imagepreview.StatusBarUtils; import com.yiwo.friendscometogether.newadapter.AllRememberViewpagerAdapter; import com.yiwo.friendscometogether.newfragment.CreateFriendRememberNew_ChoosePicsFragment; import com.yiwo.friendscometogether.wangyiyunshipin.TakeVideoFragment_new; import net.lucode.hackware.magicindicator.MagicIndicator; import net.lucode.hackware.magicindicator.ViewPagerHelper; import net.lucode.hackware.magicindicator.buildins.commonnavigator.CommonNavigator; import net.lucode.hackware.magicindicator.buildins.commonnavigator.abs.CommonNavigatorAdapter; import net.lucode.hackware.magicindicator.buildins.commonnavigator.abs.IPagerIndicator; import net.lucode.hackware.magicindicator.buildins.commonnavigator.abs.IPagerTitleView; import net.lucode.hackware.magicindicator.buildins.commonnavigator.indicators.LinePagerIndicator; import net.lucode.hackware.magicindicator.buildins.commonnavigator.titles.ColorTransitionPagerTitleView; import net.lucode.hackware.magicindicator.buildins.commonnavigator.titles.SimplePagerTitleView; import java.util.ArrayList; import java.util.List; import butterknife.BindView; import butterknife.ButterKnife; public class CreateFriendRememberActivityNew extends BaseActivity { public static final String EXTRA_FROM_UPLOAD_NOTIFY = "extra_from_upload_notify"; //由上传通知启动 @BindView(R.id.magic_indicator) MagicIndicator magicIndicator; @BindView(R.id.vp) ViewPager mViewPager; private FragmentManager mFragmentManager; private AllRememberViewpagerAdapter mViewPagerFragmentAdapter; private List<Fragment> fragmentList; private ArrayList<String> mTitleDataList; private SimplePagerTitleView simplePagerTitleView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_create_friend_remeber); ScreenAdapterTools.getInstance().loadView(getWindow().getDecorView()); ButterKnife.bind(CreateFriendRememberActivityNew.this); StatusBarUtils.setStatusBarTransparent(CreateFriendRememberActivityNew.this); mFragmentManager = getSupportFragmentManager(); initData(); } @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); fragmentList.get(1).onActivityResult(requestCode, resultCode, data); Log.d("onActivityResulton___","requestCode:"+requestCode+"///"+"resultCode:"+resultCode); } private void initData() { fragmentList = new ArrayList<>(); fragmentList.add(new CreateFriendRememberNew_ChoosePicsFragment()); fragmentList.add(new TakeVideoFragment_new()); fragmentList.add(new CreateFriendRememberNew_ChoosePicsFragment()); mViewPagerFragmentAdapter = new AllRememberViewpagerAdapter(mFragmentManager, fragmentList); mViewPager.setAdapter(mViewPagerFragmentAdapter); mViewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() { @Override public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) { } @Override public void onPageSelected(int position) { if (position == 1){ StatusBarUtils.setStatusBar(CreateFriendRememberActivityNew.this,Color.TRANSPARENT); }else { StatusBarUtils.setStatusBar(CreateFriendRememberActivityNew.this,Color.parseColor("#d84c37")); } } @Override public void onPageScrollStateChanged(int state) { } }); mTitleDataList = new ArrayList<>(); mTitleDataList.add("相册"); mTitleDataList.add("视频"); mTitleDataList.add("拍照"); CommonNavigator commonNavigator = new CommonNavigator(this); commonNavigator.setAdjustMode(true); //ture 即标题平分屏幕宽度的模式 commonNavigator.setAdapter(new CommonNavigatorAdapter() { @Override public int getCount() { return mTitleDataList == null ? 0 : mTitleDataList.size(); } @Override public IPagerTitleView getTitleView(Context context, final int index) { simplePagerTitleView = new ColorTransitionPagerTitleView(context); simplePagerTitleView.setText(mTitleDataList.get(index)); //设置字体 simplePagerTitleView.setTextSize(18); // simplePagerTitleView.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); simplePagerTitleView.setNormalColor(Color.GRAY); simplePagerTitleView.setSelectedColor(Color.parseColor("#d84c37")); simplePagerTitleView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { mViewPager.setCurrentItem(index); } }); return simplePagerTitleView; } @Override public IPagerIndicator getIndicator(Context context) { LinePagerIndicator indicator = new LinePagerIndicator(context); indicator.setColors(Color.WHITE); return indicator; } }); magicIndicator.setNavigator(commonNavigator); // LinearLayout titleContainer = commonNavigator.getTitleContainer(); // must after setNavigator // titleContainer.setShowDividers(LinearLayout.SHOW_DIVIDER_MIDDLE); // titleContainer.setDividerPadding(UIUtil.dip2px(this, 15)); // titleContainer.setDividerDrawable(getResources().getDrawable(R.drawable.simple_splitter)); ViewPagerHelper.bind(magicIndicator, mViewPager); } }
[ "1391407358@qq.com" ]
1391407358@qq.com
f2d0ef1011e3af0b8341c2bfe88360cf91ea09ca
18237bc643deab327a4b49b16b49ed4154f5f99b
/ambit2-all/ambit2-db/src/main/java/ambit2/db/search/structure/QueryByIdentifierWithStructureFallback.java
e3aaf071337212060cacac0510e9906ecf9010e8
[]
no_license
ideaconsult/ambit-mirror
14ce076cd286ca4f5dc3465ed4105b03967c7cf0
21655a99791ef2f538786367f6dc779d3bff0200
refs/heads/master
2023-08-22T20:26:43.554464
2023-07-15T10:35:41
2023-07-15T10:35:41
133,390,762
5
3
null
2022-05-16T18:53:27
2018-05-14T16:28:03
Java
UTF-8
Java
false
false
5,472
java
package ambit2.db.search.structure; import java.sql.CallableStatement; import java.sql.SQLException; import java.util.ArrayList; import java.util.List; import net.idea.modbcum.i.IStoredProcStatement; import net.idea.modbcum.i.exceptions.AmbitException; import net.idea.modbcum.i.query.QueryParam; import net.idea.modbcum.q.conditions.StringCondition; import ambit2.base.data.Property; import ambit2.base.interfaces.IStructureRecord; import ambit2.core.processors.structure.key.CASKey; import ambit2.core.processors.structure.key.DSSToxCID; import ambit2.core.processors.structure.key.DSSToxGenericSID; import ambit2.core.processors.structure.key.DSSToxRID; import ambit2.core.processors.structure.key.EINECSKey; import ambit2.core.processors.structure.key.IStructureKey; import ambit2.core.processors.structure.key.InchiKey; import ambit2.core.processors.structure.key.PropertyKey; import ambit2.core.processors.structure.key.PropertyNameKey; import ambit2.core.processors.structure.key.PubchemCID; import ambit2.core.processors.structure.key.PubchemSID; import ambit2.core.processors.structure.key.SmilesKey; /** * Calls findByProperty stored procedure * * @author nina * */ public class QueryByIdentifierWithStructureFallback extends AbstractStructureQuery<IStructureKey, IStructureRecord, StringCondition> implements IStoredProcStatement { private enum storedproc_search_mode { name, alias, idproperty, any, inchi, inchikey } /** * */ private static final long serialVersionUID = -2227075383236154179L; protected final String sql = "{call findByProperty(?,?,?,?,?,?,?,?,?)}"; /* * IN chemical_id INT, //if >0 only retrieves the preferred structure IN * search_mode INT, -- 0 : name ; 1 : alias; 2: idproperty ; 3: any ; 4: * inchi ; 5: inchikey IN property_name VARCHAR(255), IN property_alias * VARCHAR(255), IN property_id INT, IN query_value TEXT, -- string value or * inchi IN query_value_num DOUBLE, IN query_inchi TEXT, IN maxrows INT) * * call findByProperty( 0, 3, "http://www.opentox.org/api/1.1#CASRN","",0, * "testid",0, * "InChI=1/C9H14N2O3/c1-4-9(5-2)6(12)10-8(14)11(3)7(9)13/h4-5H2,1-3H3,(H,10,12,14)" * , 0 ); */ public QueryByIdentifierWithStructureFallback() { super(); setFieldname(null); setCondition(StringCondition.getInstance("=")); } @Override public String getSQL() throws AmbitException { return sql; } protected storedproc_search_mode getSearchMode() { IStructureKey key = getFieldname(); if (key == null) return storedproc_search_mode.any; else if ((key instanceof InchiKey) || (key instanceof SmilesKey)) return storedproc_search_mode.inchi; else if (key instanceof CASKey) { return storedproc_search_mode.any; } else if (key instanceof EINECSKey) { return storedproc_search_mode.any; } else if (key instanceof DSSToxCID) { return storedproc_search_mode.name; } else if (key instanceof DSSToxRID) { return storedproc_search_mode.name; } else if (key instanceof DSSToxGenericSID) { return storedproc_search_mode.name; } else if (key instanceof PubchemCID) { return storedproc_search_mode.name; } else if (key instanceof PubchemSID) { return storedproc_search_mode.name; } else if (key instanceof PropertyNameKey) { return storedproc_search_mode.any; } else if (key instanceof PropertyKey) { return storedproc_search_mode.alias; } else return storedproc_search_mode.inchi; } protected int getSearchPropertyID() { return -1; } @Override public List<QueryParam> getParameters() throws AmbitException { storedproc_search_mode searchMode = getSearchMode(); Object identifier = null; try { identifier = getFieldname() == null ? null : getFieldname().process(getValue()); } catch (Exception x) { identifier = null; searchMode = storedproc_search_mode.inchi; } Property key = getFieldname() == null ? null : getFieldname().getQueryKey() instanceof Property ? (Property) getFieldname().getQueryKey() : null; List<QueryParam> params = new ArrayList<QueryParam>(); // idchemical params.add(new QueryParam<Integer>(Integer.class, getValue().getIdchemical())); // searchmode params.add(new QueryParam<Integer>(Integer.class, searchMode.ordinal())); params.add(new QueryParam<String>(String.class, key == null ? null : key.getName())); params.add(new QueryParam<String>(String.class, key == null ? null : key.getLabel())); params.add(new QueryParam<Integer>(Integer.class, getSearchPropertyID())); params.add(new QueryParam<String>(String.class, identifier instanceof String ? (String) identifier : null)); params.add(new QueryParam<Double>(Double.class, identifier instanceof Number ? ((Number) identifier) .doubleValue() : null)); params.add(new QueryParam<String>(String.class, getValue().getInchi())); params.add(new QueryParam<Integer>(Integer.class, (int) getPageSize())); return params; } @Override public void getStoredProcedureOutVars(CallableStatement statement) throws SQLException { } @Override protected boolean isPreferredStructure() { return getFieldname().useExactStructureID(); } @Override public void registerOutParameters(CallableStatement statement) throws SQLException { } }
[ "jeliazkova.nina@gmail.com" ]
jeliazkova.nina@gmail.com
0f99ea6660d05fa9f48c323c37130503ad481d11
372886fd341ccb3d4ae4c8992520d75baf777702
/shoppingPjt/src/shopping/backend/model/InsertEventExecute.java
ab9720926c4e6d6b5e03e80dff2c5e0ab195f5fa
[]
no_license
Lee-jaeyong/shoppingJspPjt
23f414007fe7f8f2830424e0c177433752d3bcab
6eb12d31c6ae20db72cdb14b365711da35b7ad86
refs/heads/master
2022-12-06T00:32:58.794309
2019-12-19T17:52:07
2019-12-19T17:52:07
223,929,522
0
0
null
2022-12-04T21:56:39
2019-11-25T11:10:55
HTML
UTF-8
Java
false
false
1,902
java
package shopping.backend.model; import java.io.File; import java.util.Enumeration; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import com.oreilly.servlet.MultipartRequest; import com.oreilly.servlet.multipart.DefaultFileRenamePolicy; import shopping.action.Action; import shopping.action.ActionForward; import shopping.database.dao.EventDAO; import shopping.database.dto.EventDTO; import shopping.filter.SecureString; public class InsertEventExecute implements Action { @Override public ActionForward execute(HttpServletRequest request, HttpServletResponse response) { ActionForward forward = new ActionForward(); forward.setRedirect(true); forward.setPath("./adminEvent.admin"); String savePath = request.getRealPath("uploadBest"); int maxSize = 20 * 1024 * 1024; File file; try { MultipartRequest multi = new MultipartRequest(request, savePath, maxSize, "utf-8", new DefaultFileRenamePolicy()); SecureString sqString = new SecureString(); EventDTO event = new EventDTO(); event.setEventItemIdx(Integer.parseInt(multi.getParameter("itemIdx"))); if(!multi.getParameter("datepicker1").equals("")) { event.setEventStart(multi.getParameter("datepicker1")); event.setEventEnd(multi.getParameter("datepicker2")); } else { event.setEventStart(""); event.setEventEnd(""); } event.setEventTitle(multi.getParameter("eventTitle")); Enumeration efiles = multi.getFileNames(); int i = 0; while (efiles.hasMoreElements()) { String name = (String) efiles.nextElement(); file = multi.getFile(name); String str = file.getName(); event.setEventImg(str); } EventDAO eventDAO = new EventDAO(); eventDAO.insertEvent(event); } catch (Exception e) { e.printStackTrace(); } return forward; } }
[ "wodyd202@naver.com" ]
wodyd202@naver.com
45bff4ecbd69573d54ff681446ae2c8898f2c917
cb24265f4c31ec1410809e312c65675c1839b345
/src/main/java/com/google/tagmanager/TypedNumber.java
7351fb24aa79c77837a1c5d43df13d41cfd2f42f
[]
no_license
TaintBench/save_me
16ac18ecf3753e82d103c620b7f4f07b2a6236d6
cb27d0e5e90ef7fc5666e08037a22c91b4e67357
refs/heads/master
2021-07-21T05:33:16.315128
2021-07-16T11:39:41
2021-07-16T11:39:41
234,355,355
0
0
null
null
null
null
UTF-8
Java
false
false
2,396
java
package com.google.tagmanager; class TypedNumber extends Number implements Comparable<TypedNumber> { private double mDouble; private long mInt64; private boolean mIsInt64 = false; private TypedNumber(double d) { this.mDouble = d; } private TypedNumber(long l) { this.mInt64 = l; } public static TypedNumber numberWithDouble(Double d) { return new TypedNumber(d.doubleValue()); } public static TypedNumber numberWithInt64(long l) { return new TypedNumber(l); } public static TypedNumber numberWithString(String s) throws NumberFormatException { try { return new TypedNumber(Long.parseLong(s)); } catch (NumberFormatException e) { try { return new TypedNumber(Double.parseDouble(s)); } catch (NumberFormatException e2) { throw new NumberFormatException(s + " is not a valid TypedNumber"); } } } public String toString() { return isInt64() ? Long.toString(this.mInt64) : Double.toString(this.mDouble); } public boolean equals(Object other) { return (other instanceof TypedNumber) && compareTo((TypedNumber) other) == 0; } public int hashCode() { return new Long(longValue()).hashCode(); } public int compareTo(TypedNumber other) { return (isInt64() && other.isInt64()) ? new Long(this.mInt64).compareTo(Long.valueOf(other.mInt64)) : Double.compare(doubleValue(), other.doubleValue()); } public boolean isDouble() { return !isInt64(); } public boolean isInt64() { return this.mIsInt64; } public double doubleValue() { return isInt64() ? (double) this.mInt64 : this.mDouble; } public float floatValue() { return (float) doubleValue(); } public long longValue() { return int64Value(); } public long int64Value() { return isInt64() ? this.mInt64 : (long) this.mDouble; } public int intValue() { return int32Value(); } public int int32Value() { return (int) longValue(); } public short shortValue() { return int16Value(); } public short int16Value() { return (short) ((int) longValue()); } public byte byteValue() { return (byte) ((int) longValue()); } }
[ "malwareanalyst1@gmail.com" ]
malwareanalyst1@gmail.com
5e5e1b25281ac1f62debfb1bf58bba4dee603820
15a04ddc490a2273f9516fb2f730b208c672a7bd
/officefloor/tutorials/JaxRsApp/src/test/java/net/officefloor/tutorial/jaxrsapp/JaxRsAppTest.java
13d984f00abc03166d6ea2f740069ba1f1cd5b26
[ "Apache-2.0" ]
permissive
officefloor/OfficeFloor
d50c4441e96773e3f33b6a154dcaf049088480a2
4bad837e3d71dbc49b161f9814d6b188937ca69d
refs/heads/master
2023-09-01T12:06:04.230609
2023-08-27T16:36:04
2023-08-27T16:36:04
76,112,580
60
7
Apache-2.0
2023-09-14T20:12:48
2016-12-10T12:56:50
Java
UTF-8
Java
false
false
712
java
package net.officefloor.tutorial.jaxrsapp; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.webapp.WebAppContext; import org.junit.AfterClass; import org.junit.BeforeClass; /** * Tests the JAX-RS App. * * @author Daniel Sagenschneider */ public class JaxRsAppTest extends JaxRsAppIT { private static Server server; @BeforeClass public static void startServer() throws Exception { // Start the server server = new Server(PORT); WebAppContext context = new WebAppContext(); context.setResourceBase("src/main/webapp"); server.setHandler(context); server.start(); } @AfterClass public static void stopServer() throws Exception { server.stop(); } // Tests inherited }
[ "daniel@officefloor.net" ]
daniel@officefloor.net
c15cc0019fb909b52f3326e58ce6d7cf66ea5d89
c83c8667564baebbb97edd3d76e09b2f44d65df0
/src/test/java/edu/emory/cs/graph/GraphTest.java
5ea0a3755de43b8c6c3fef94ffae4c3605e89d4c
[]
no_license
Krishnamurtyp/dsa-java
0207ddd2f8467772d8437aeb635542caa95432cd
9a7be8a942cf3af1fd3643f866b50da72c59b1de
refs/heads/master
2023-09-03T22:23:52.539464
2021-11-08T19:10:34
2021-11-08T19:10:34
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,849
java
/* * Copyright 2020 Emory University * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package edu.emory.cs.graph; import org.junit.Test; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; /** * @author Jinho D. Choi ({@code jinho.choi@emory.edu}) */ public class GraphTest { @Test public void testContainsCycle() { Graph graph = new Graph(5); graph.setDirectedEdge(0, 1, 1); graph.setDirectedEdge(0, 2, 1); graph.setDirectedEdge(2, 1, 1); graph.setDirectedEdge(2, 3, 1); graph.setDirectedEdge(3, 4, 1); graph.setDirectedEdge(4, 2, 1); System.out.println(graph.toString()); assertTrue(graph.containsCycle()); } @Test public void testTopologicalSort() { Graph graph = new Graph(8); graph.setDirectedEdge(0, 3, 1); graph.setDirectedEdge(0, 4, 1); graph.setDirectedEdge(1, 3, 1); graph.setDirectedEdge(2, 4, 1); graph.setDirectedEdge(3, 5, 1); graph.setDirectedEdge(3, 6, 1); graph.setDirectedEdge(3, 7, 1); graph.setDirectedEdge(4, 6, 1); graph.setDirectedEdge(2, 7, 1); assertEquals("[0, 1, 2, 3, 4, 5, 7, 6]", new Graph(graph).topological_sort(false).toString()); assertEquals("[0, 1, 3, 5, 2, 4, 6, 7]", new Graph(graph).topological_sort(true).toString()); } }
[ "jinho.choi@emory.edu" ]
jinho.choi@emory.edu
eb522a9907545374af61c8c1a7a0f373affd9ae5
38c93c221a74ee0a15f57d6467a3a7fe31235ff0
/demo-spring-boot-simple/src/main/java/com/capg/demo/repository/UserRepo.java
6b397edbb196085833146c09c7b41baea2158929
[]
no_license
salwaarjuman/capgemini-bvrit
5fefe4fe542891ab30c7b195e207ae69b7a6cedd
0b9f23d60db0a6dd35c5e2c9f7e42b6c9381c376
refs/heads/master
2021-05-17T00:15:25.272873
2020-03-27T12:30:46
2020-03-27T12:30:46
null
0
0
null
null
null
null
UTF-8
Java
false
false
634
java
package com.capg.demo.repository; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; import javax.persistence.Query; import javax.persistence.TypedQuery; import org.springframework.stereotype.Repository; import com.capg.demo.model.User; @Repository public class UserRepo { @PersistenceContext EntityManager em; public void saveUser(User user) { em.persist(user); } public User getUserByEmail(String email) { TypedQuery<User> q=em.createQuery("from User where email=:email",User.class); q.setParameter("email", email); User user=q.getSingleResult(); return user; } }
[ "ramanujds9@gmail.com" ]
ramanujds9@gmail.com
4b9ab173157b81d10c59dd483e0ab9c87cda04b8
27cda5e6fb5da7ae2dea91450ca1082bcaa55424
/Source/Java/PathologyFederationWebAppComponents/main/src/java/gov/va/med/imaging/federation/commands/pathology/FederationPathologyGetPatientInfoCommand.java
e7c53e7bc9874af44051e8ca39bcba49c74faf61
[ "Apache-2.0" ]
permissive
VHAINNOVATIONS/Telepathology
85552f179d58624e658b0b266ce83e905480acf2
989c06ccc602b0282c58c4af3455c5e0a33c8593
refs/heads/master
2021-01-01T19:15:40.693105
2015-11-16T22:39:23
2015-11-16T22:39:23
32,991,526
3
9
null
null
null
null
UTF-8
Java
false
false
3,167
java
package gov.va.med.imaging.federation.commands.pathology; import gov.va.med.URNFactory; import gov.va.med.imaging.core.interfaces.exceptions.ConnectionException; import gov.va.med.imaging.core.interfaces.exceptions.MethodException; import gov.va.med.imaging.exceptions.URNFormatException; import gov.va.med.imaging.exchange.translation.exceptions.TranslationException; import gov.va.med.imaging.federation.pathology.rest.translator.PathologyFederationRestTranslator; import gov.va.med.imaging.federation.pathology.rest.types.PathologyFederationPatientInfoItemType; import gov.va.med.imaging.pathology.PathologyCaseURN; import gov.va.med.imaging.pathology.PathologyPatientInfoItem; import gov.va.med.imaging.web.commands.WebserviceInputParameterTransactionContextField; import java.util.HashMap; import java.util.List; import java.util.Map; public class FederationPathologyGetPatientInfoCommand extends AbstractFederationPathologyCommand<List<PathologyPatientInfoItem>, PathologyFederationPatientInfoItemType[]> { private final String caseId; private final String interfaceVersion; public FederationPathologyGetPatientInfoCommand(String caseId, String interfaceVersion) { super("getPathologyPatientInfo"); this.caseId = caseId; this.interfaceVersion = interfaceVersion; } public String getCaseId() { return caseId; } public String getInterfaceVersion() { return interfaceVersion; } @Override protected List<PathologyPatientInfoItem> executeRouterCommand() throws MethodException, ConnectionException { try { PathologyCaseURN pathologyCaseUrn = URNFactory.create(getCaseId(), PathologyCaseURN.class); return getRouter().getPatientInfo(pathologyCaseUrn); } catch(URNFormatException urnfX) { throw new MethodException(urnfX); } } @Override protected String getMethodParameterValuesString() { return "for case '" + getCaseId() + "'."; } @Override protected PathologyFederationPatientInfoItemType[] translateRouterResult( List<PathologyPatientInfoItem> routerResult) throws TranslationException, MethodException { return PathologyFederationRestTranslator.translatePatientInfo(routerResult); } @Override protected Class<PathologyFederationPatientInfoItemType[]> getResultClass() { return PathologyFederationPatientInfoItemType[].class; } @Override protected Map<WebserviceInputParameterTransactionContextField, String> getTransactionContextFields() { Map<WebserviceInputParameterTransactionContextField, String> transactionContextFields = new HashMap<WebserviceInputParameterTransactionContextField, String>(); transactionContextFields.put(WebserviceInputParameterTransactionContextField.quality, transactionContextNaValue); transactionContextFields.put(WebserviceInputParameterTransactionContextField.urn, getCaseId()); transactionContextFields.put(WebserviceInputParameterTransactionContextField.queryFilter, transactionContextNaValue); return transactionContextFields; } @Override public Integer getEntriesReturned( PathologyFederationPatientInfoItemType[] translatedResult) { return translatedResult == null ? 0 : translatedResult.length; } }
[ "ctitton@vitelnet.com" ]
ctitton@vitelnet.com
88184cbdbf79c93feb6d554ea145cc3ec559fffe
78f7fd54a94c334ec56f27451688858662e1495e
/partyanalyst-service/trunk/src/test/java/com/itgrids/partyanalyst/dao/hibernate/ProblemFilesDAOHibernateTest.java
fffa614e78b6874a776228ce44bd14071eabce32
[]
no_license
hymanath/PA
2e8f2ef9e1d3ed99df496761a7b72ec50d25e7ef
d166bf434601f0fbe45af02064c94954f6326fd7
refs/heads/master
2021-09-12T09:06:37.814523
2018-04-13T20:13:59
2018-04-13T20:13:59
129,496,146
1
0
null
null
null
null
UTF-8
Java
false
false
1,812
java
package com.itgrids.partyanalyst.dao.hibernate; import java.text.SimpleDateFormat; import java.util.List; import org.appfuse.dao.BaseDaoTestCase; import com.itgrids.partyanalyst.dao.IProblemFilesDAO; import com.itgrids.partyanalyst.utils.IConstants; public class ProblemFilesDAOHibernateTest extends BaseDaoTestCase{ private IProblemFilesDAO problemFilesDAO; public void setProblemFilesDAO(IProblemFilesDAO problemFilesDAO) { this.problemFilesDAO = problemFilesDAO; } /*public void test() { problemFilesDAO.getAll(); } */ /*public void testfindUserApprovalStatusbetweendates()throws Exception { SimpleDateFormat sdf = new SimpleDateFormat(IConstants.DATE_PATTERN_YYYY_MM_DD); System.out.println("details"); List<Object[]> list = problemFilesDAO. getCurrentDateFiles(null,null,"false"); System.out.println("size"+list.size()); for(Object[] obj : list) { System.out.println("1"+obj[0]); System.out.println("2"+obj[1]); System.out.println("3"+obj[2]); System.out.println("4"+obj[3]); System.out.println("5"+obj[4]); System.out.println("6"+obj[5]); System.out.println("7"+obj[6]); System.out.println("8"+obj[7]); System.out.println("9"+obj[8]); } }*/ /*public void testGetCountOfNewlyPostedImagesByFreeUser() { Long newlyPostedImagesCount = problemFilesDAO.getCountOfNewlyPostedImagesByFreeUser(); System.out.println(newlyPostedImagesCount); }*/ public void testgetProblemFileDetailsByProblemFileId() { List<Object[]> list = problemFilesDAO.getProblemFileDetailsByProblemFileId(35l); if(list != null && list.size() > 0) { for(Object[] params : list) { System.out.println(params[0]+" "+params[1]+" "+params[2]+" "+params[3]); } } } }
[ "itgrids@b17b186f-d863-de11-8533-00e0815b4126" ]
itgrids@b17b186f-d863-de11-8533-00e0815b4126
0387352119bf868a7dc210f59b87044f0fabbde2
c8664fc194971e6e39ba8674b20d88ccfa7663b1
/com/tencent/mm/plugin/appbrand/p/d/d.java
d9cea0e17d525220b549b30447fe010cd5153954
[]
no_license
raochuan/wexin1120
b926bc8d4143c4b523ed43e265cd20ef0c89ad40
1eaa71e1e3e7c9f9b9f96db8de56db3dfc4fb4d3
refs/heads/master
2020-05-17T23:57:00.000696
2017-11-03T02:33:27
2017-11-03T02:33:27
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,019
java
package com.tencent.mm.plugin.appbrand.p.d; import com.tencent.gmtrace.GMTrace; import java.nio.ByteBuffer; public abstract interface d { public abstract ByteBuffer abl(); public abstract boolean abm(); public abstract boolean abn(); public abstract a abo(); public abstract void e(d paramd); public static enum a { static { GMTrace.i(10167395549184L, 75753); jxY = new a("CONTINUOUS", 0); jxZ = new a("TEXT", 1); jya = new a("BINARY", 2); jyb = new a("PING", 3); jyc = new a("PONG", 4); jyd = new a("CLOSING", 5); jye = new a[] { jxY, jxZ, jya, jyb, jyc, jyd }; GMTrace.o(10167395549184L, 75753); } private a() { GMTrace.i(10167261331456L, 75752); GMTrace.o(10167261331456L, 75752); } } } /* Location: /Users/xianghongyan/decompile/dex2jar/classes2-dex2jar.jar!/com/tencent/mm/plugin/appbrand/p/d/d.class * Java compiler version: 6 (50.0) * JD-Core Version: 0.7.1 */
[ "15223790237@139.com" ]
15223790237@139.com
11ad3a0a26f2a337949107957cbda89e330dffab
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/26/26_71f9d546a99b902775a63df0578758ad401e3d43/ShowAnnotationAction/26_71f9d546a99b902775a63df0578758ad401e3d43_ShowAnnotationAction_s.java
5ca0488d3f0ef2e13fdec95ed8c1746e871c8354
[]
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
7,467
java
/******************************************************************************* * Copyright (c) 2000, 2003 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Common Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/cpl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.eclipse.team.internal.ccvs.ui.actions; import java.lang.reflect.InvocationTargetException; import org.eclipse.core.resources.IContainer; import org.eclipse.core.resources.IResource; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.jface.action.IAction; import org.eclipse.jface.operation.IRunnableWithProgress; import org.eclipse.team.core.TeamException; import org.eclipse.team.internal.ccvs.core.CVSException; import org.eclipse.team.internal.ccvs.core.CVSProviderPlugin; import org.eclipse.team.internal.ccvs.core.CVSStatus; import org.eclipse.team.internal.ccvs.core.ICVSFolder; import org.eclipse.team.internal.ccvs.core.ICVSRemoteFile; import org.eclipse.team.internal.ccvs.core.ICVSRepositoryLocation; import org.eclipse.team.internal.ccvs.core.ICVSResource; import org.eclipse.team.internal.ccvs.core.client.Annotate; import org.eclipse.team.internal.ccvs.core.client.Command; import org.eclipse.team.internal.ccvs.core.client.Session; import org.eclipse.team.internal.ccvs.core.client.listeners.AnnotateListener; import org.eclipse.team.internal.ccvs.core.client.listeners.LogEntry; import org.eclipse.team.internal.ccvs.core.connection.CVSServerException; import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot; import org.eclipse.team.internal.ccvs.core.syncinfo.FolderSyncInfo; import org.eclipse.team.internal.ccvs.core.syncinfo.ResourceSyncInfo; import org.eclipse.team.internal.ccvs.ui.AnnotateView; import org.eclipse.team.internal.ccvs.ui.Policy; import org.eclipse.ui.IWorkbenchWindow; import org.eclipse.ui.PartInitException; import org.eclipse.ui.PlatformUI; import org.eclipse.ui.WorkbenchException; public class ShowAnnotationAction extends WorkspaceAction { /** * Action to open a CVS Annotate View */ public void execute(IAction action) throws InvocationTargetException, InterruptedException { // Get the selected resource. final ICVSResource cvsResource = getSingleSelectedCVSResource(); execute(cvsResource); } public void execute(final ICVSResource cvsResource) throws InvocationTargetException, InterruptedException { final AnnotateListener listener = new AnnotateListener(); if (cvsResource == null) { return; } // Get the selected revision final String revision; try { ResourceSyncInfo info = cvsResource.getSyncInfo(); if (info == null) { handle(new CVSException(Policy.bind("ShowAnnotationAction.noSyncInfo", cvsResource.getName()))); //$NON-NLS-1$ return; } revision = cvsResource.getSyncInfo().getRevision(); } catch (CVSException e) { throw new InvocationTargetException(e); } // Run the CVS Annotate action with a progress monitor run(new IRunnableWithProgress() { public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { fetchAnnotation(listener, cvsResource, revision, monitor); } }, true, PROGRESS_DIALOG); if (listener.hasError()) { throw new InvocationTargetException(new CVSException(Policy.bind("ShowAnnotationAction.1", listener.getError()))); //$NON-NLS-1$ } // Open the view IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); if (window != null) { try { PlatformUI.getWorkbench().showPerspective("org.eclipse.team.cvs.ui.cvsPerspective", window); //$NON-NLS-1$ } catch (WorkbenchException e1) { // If this does not work we will just open the view in the // curren perspective. } } try { AnnotateView view = AnnotateView.openInActivePerspective(); view.showAnnotations(cvsResource, listener.getCvsAnnotateBlocks(), listener.getContents()); } catch (PartInitException e1) { handle(e1); } } /** * Send the CVS annotate command * * @param listener * @param cvsResource * @param revision * @param monitor * @throws InvocationTargetException */ private void fetchAnnotation(final AnnotateListener listener, final ICVSResource cvsResource, final String revision, IProgressMonitor monitor) throws InvocationTargetException { try { monitor = Policy.monitorFor(monitor); monitor.beginTask(null, 100); ICVSFolder folder = cvsResource.getParent(); final FolderSyncInfo info = folder.getFolderSyncInfo(); ICVSRepositoryLocation location = CVSProviderPlugin.getPlugin().getRepository(info.getRoot()); Session session = new Session(location, folder, true /* * output to * console */); session.open(Policy.subMonitorFor(monitor, 10), false /* read-only */); try { Command.QuietOption quietness = CVSProviderPlugin.getPlugin().getQuietness(); try { CVSProviderPlugin.getPlugin().setQuietness(Command.VERBOSE); final Command.LocalOption[] localOption; if (revision == null) { localOption = Command.NO_LOCAL_OPTIONS; } else { localOption = new Command.LocalOption[1]; localOption[0] = Annotate.makeRevisionOption(revision); } IStatus status = Command.ANNOTATE.execute(session, Command.NO_GLOBAL_OPTIONS, localOption, new ICVSResource[]{cvsResource}, listener, Policy.subMonitorFor(monitor, 90)); if (status.getCode() == CVSStatus.SERVER_ERROR) { throw new CVSServerException(status); } } finally { CVSProviderPlugin.getPlugin().setQuietness(quietness); monitor.done(); } } finally { session.close(); } } catch (CVSException e) { throw new InvocationTargetException(e); } } /** * Ony enabled for single resource selection */ protected boolean isEnabled() throws TeamException { ICVSResource resource = getSingleSelectedCVSResource(); return (resource != null && ! resource.isFolder()); } /** * This action is called from one of a Resource Navigator a CVS Resource * Navigator or a History Log Viewer. Return the selected resource as an * ICVSResource * * @return ICVSResource */ protected ICVSResource getSingleSelectedCVSResource() { // Selected from a CVS Resource Navigator ICVSResource[] cvsResources = getSelectedCVSResources(); if (cvsResources.length == 1) { return cvsResources[0]; } // Selected from a History Viewer Object[] logEntries = getSelectedResources(LogEntry.class); if (logEntries.length == 1) { LogEntry aLogEntry = (LogEntry) logEntries[0]; ICVSRemoteFile cvsRemoteFile = aLogEntry.getRemoteFile(); return cvsRemoteFile; } // Selected from a Resource Navigator IResource[] resources = getSelectedResources(); if (resources.length == 1) { IContainer parent = resources[0].getParent(); ICVSFolder folder = CVSWorkspaceRoot.getCVSFolderFor(parent); return CVSWorkspaceRoot.getCVSResourceFor(resources[0]); } return null; } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
37e4a9242b945692c871d126265c3699e41be6ac
1d928c3f90d4a0a9a3919a804597aa0a4aab19a3
/java/j2objc/2015/8/TypePrivateDeclarationGenerator.java
1fc3d7e546321d8e5ba6815798c1e48c12f8056f
[]
no_license
rosoareslv/SED99
d8b2ff5811e7f0ffc59be066a5a0349a92cbb845
a062c118f12b93172e31e8ca115ce3f871b64461
refs/heads/main
2023-02-22T21:59:02.703005
2021-01-28T19:40:51
2021-01-28T19:40:51
306,497,459
1
1
null
2020-11-24T20:56:18
2020-10-23T01:18:07
null
UTF-8
Java
false
false
3,284
java
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.devtools.j2objc.gen; import com.google.common.collect.Iterables; import com.google.devtools.j2objc.ast.AbstractTypeDeclaration; import com.google.devtools.j2objc.ast.BodyDeclaration; import com.google.devtools.j2objc.ast.Expression; import com.google.devtools.j2objc.ast.FunctionDeclaration; import com.google.devtools.j2objc.ast.VariableDeclarationFragment; import org.eclipse.jdt.core.dom.Modifier; /** * Generates private type declarations within the source file. * * @author Tom Ball, Keith Stanger */ public class TypePrivateDeclarationGenerator extends TypeDeclarationGenerator { protected TypePrivateDeclarationGenerator(SourceBuilder builder, AbstractTypeDeclaration node) { super(builder, node); } public static void generate(SourceBuilder builder, AbstractTypeDeclaration node) { new TypePrivateDeclarationGenerator(builder, node).generate(); } @Override protected boolean printPrivateDeclarations() { return true; } private void generate() { if (typeNode.hasPrivateDeclaration()) { generateInitialDeclaration(); } else { generateDeclarationExtension(); } } private void generateDeclarationExtension() { printConstantDefines(); printClassExtension(); printCompanionClassDeclaration(); printFieldSetters(); printStaticFieldDeclarations(); printOuterDeclarations(); } private void printClassExtension() { if (isInterfaceType()) { return; } boolean hasPrivateFields = !Iterables.isEmpty(getInstanceFields()); Iterable<BodyDeclaration> privateDecls = getInnerDeclarations(); if (!Iterables.isEmpty(privateDecls) || hasPrivateFields) { newline(); printf("@interface %s ()", typeName); printInstanceVariables(); printDeclarations(privateDecls); println("\n@end"); } } @Override protected void printStaticAccessors() { // Static accessors are only needed by the public API. } @Override protected void printStaticFieldDeclaration( VariableDeclarationFragment fragment, String baseDeclaration) { Expression initializer = fragment.getInitializer(); print("static " + baseDeclaration); if (initializer != null) { print(" = " + generateExpression(initializer)); } println(";"); } @Override protected void printFunctionDeclaration(FunctionDeclaration function) { newline(); // We expect native functions to be defined externally. if (!Modifier.isNative(function.getModifiers())) { print("__attribute__((unused)) static "); } print(getFunctionSignature(function)); if (function.returnsRetained()) { print(" NS_RETURNS_RETAINED"); } println(";"); } }
[ "rodrigosoaresilva@gmail.com" ]
rodrigosoaresilva@gmail.com
90db46be6ee2a9865bf44e7046c5e145bc5cf28c
f6a646b4fb79f7f1021311e3e7e178e492c1ffcb
/crudClienteConta/src/dao/Conexao.java
fce3dab357d2778ae3b24582716bb123da3df568
[]
no_license
dvsilva/programacaoAplicacoes
f1816cb10731ec226f2080d4d2a2a90180a38c33
2d0a623ec975e36534127701d2be22a80efa8b52
refs/heads/master
2021-01-11T15:09:37.970434
2017-01-28T19:05:15
2017-01-28T19:05:15
80,304,099
0
0
null
null
null
null
UTF-8
Java
false
false
792
java
package dao; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; public class Conexao { private static final String URL_DE_CONEXAO = "jdbc:mysql://localhost:3307/bancopilares"; private static final String USUARIO = "root"; private static final String SENHA = "123456"; public Conexao() { } public static Connection conectar() { String urlDeConexao = "jdbc:mysql://localhost:3307/bancopilares"; String usuario = "root"; String senha = "123456"; Connection conexao = null; try { conexao = DriverManager.getConnection(urlDeConexao, usuario, senha); } catch (SQLException e) { e.printStackTrace(); } return conexao; } }
[ "danyllo.dvs@gmail.com" ]
danyllo.dvs@gmail.com
9ed625ae3027d19dd40b08011914c89c303add75
4da9097315831c8639a8491e881ec97fdf74c603
/src/StockIT-v1-release_source_from_JADX/sources/androidx/sqlite/p007db/framework/FrameworkSQLiteOpenHelper.java
dbf3c9cd5a0523d63143d33dc40b9424fea07e57
[ "Apache-2.0" ]
permissive
atul-vyshnav/2021_IBM_Code_Challenge_StockIT
5c3c11af285cf6f032b7c207e457f4c9a5b0c7e1
25c26a4cc59a3f3e575f617b59acc202ee6ee48a
refs/heads/main
2023-08-11T06:17:05.659651
2021-10-01T08:48:06
2021-10-01T08:48:06
410,595,708
1
1
null
null
null
null
UTF-8
Java
false
false
4,941
java
package androidx.sqlite.p007db.framework; import android.content.Context; import android.database.DatabaseErrorHandler; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteOpenHelper; import androidx.sqlite.p007db.SupportSQLiteDatabase; import androidx.sqlite.p007db.SupportSQLiteOpenHelper; /* renamed from: androidx.sqlite.db.framework.FrameworkSQLiteOpenHelper */ class FrameworkSQLiteOpenHelper implements SupportSQLiteOpenHelper { private final OpenHelper mDelegate; FrameworkSQLiteOpenHelper(Context context, String str, SupportSQLiteOpenHelper.Callback callback) { this.mDelegate = createDelegate(context, str, callback); } private OpenHelper createDelegate(Context context, String str, SupportSQLiteOpenHelper.Callback callback) { return new OpenHelper(context, str, new FrameworkSQLiteDatabase[1], callback); } public String getDatabaseName() { return this.mDelegate.getDatabaseName(); } public void setWriteAheadLoggingEnabled(boolean z) { this.mDelegate.setWriteAheadLoggingEnabled(z); } public SupportSQLiteDatabase getWritableDatabase() { return this.mDelegate.getWritableSupportDatabase(); } public SupportSQLiteDatabase getReadableDatabase() { return this.mDelegate.getReadableSupportDatabase(); } public void close() { this.mDelegate.close(); } /* renamed from: androidx.sqlite.db.framework.FrameworkSQLiteOpenHelper$OpenHelper */ static class OpenHelper extends SQLiteOpenHelper { final SupportSQLiteOpenHelper.Callback mCallback; final FrameworkSQLiteDatabase[] mDbRef; private boolean mMigrated; OpenHelper(Context context, String str, final FrameworkSQLiteDatabase[] frameworkSQLiteDatabaseArr, final SupportSQLiteOpenHelper.Callback callback) { super(context, str, (SQLiteDatabase.CursorFactory) null, callback.version, new DatabaseErrorHandler() { public void onCorruption(SQLiteDatabase sQLiteDatabase) { SupportSQLiteOpenHelper.Callback.this.onCorruption(OpenHelper.getWrappedDb(frameworkSQLiteDatabaseArr, sQLiteDatabase)); } }); this.mCallback = callback; this.mDbRef = frameworkSQLiteDatabaseArr; } /* access modifiers changed from: package-private */ public synchronized SupportSQLiteDatabase getWritableSupportDatabase() { this.mMigrated = false; SQLiteDatabase writableDatabase = super.getWritableDatabase(); if (this.mMigrated) { close(); return getWritableSupportDatabase(); } return getWrappedDb(writableDatabase); } /* access modifiers changed from: package-private */ public synchronized SupportSQLiteDatabase getReadableSupportDatabase() { this.mMigrated = false; SQLiteDatabase readableDatabase = super.getReadableDatabase(); if (this.mMigrated) { close(); return getReadableSupportDatabase(); } return getWrappedDb(readableDatabase); } /* access modifiers changed from: package-private */ public FrameworkSQLiteDatabase getWrappedDb(SQLiteDatabase sQLiteDatabase) { return getWrappedDb(this.mDbRef, sQLiteDatabase); } public void onCreate(SQLiteDatabase sQLiteDatabase) { this.mCallback.onCreate(getWrappedDb(sQLiteDatabase)); } public void onUpgrade(SQLiteDatabase sQLiteDatabase, int i, int i2) { this.mMigrated = true; this.mCallback.onUpgrade(getWrappedDb(sQLiteDatabase), i, i2); } public void onConfigure(SQLiteDatabase sQLiteDatabase) { this.mCallback.onConfigure(getWrappedDb(sQLiteDatabase)); } public void onDowngrade(SQLiteDatabase sQLiteDatabase, int i, int i2) { this.mMigrated = true; this.mCallback.onDowngrade(getWrappedDb(sQLiteDatabase), i, i2); } public void onOpen(SQLiteDatabase sQLiteDatabase) { if (!this.mMigrated) { this.mCallback.onOpen(getWrappedDb(sQLiteDatabase)); } } public synchronized void close() { super.close(); this.mDbRef[0] = null; } static FrameworkSQLiteDatabase getWrappedDb(FrameworkSQLiteDatabase[] frameworkSQLiteDatabaseArr, SQLiteDatabase sQLiteDatabase) { FrameworkSQLiteDatabase frameworkSQLiteDatabase = frameworkSQLiteDatabaseArr[0]; if (frameworkSQLiteDatabase == null || !frameworkSQLiteDatabase.isDelegate(sQLiteDatabase)) { frameworkSQLiteDatabaseArr[0] = new FrameworkSQLiteDatabase(sQLiteDatabase); } return frameworkSQLiteDatabaseArr[0]; } } }
[ "57108396+atul-vyshnav@users.noreply.github.com" ]
57108396+atul-vyshnav@users.noreply.github.com
44a64dfed2a684b319fe3234d2e50f02b6341cd9
7e1511cdceeec0c0aad2b9b916431fc39bc71d9b
/flakiness-predicter/input_data/original_tests/wildfly-wildfly/nonFlakyMethods/org.jboss.as.security.service.SimpleSecurityServiceManagerMockTest-testHandlingRunAs.java
24bd75044b3977947f2a972fc9f59c14b30e64a1
[ "BSD-3-Clause" ]
permissive
Taher-Ghaleb/FlakeFlagger
6fd7c95d2710632fd093346ce787fd70923a1435
45f3d4bc5b790a80daeb4d28ec84f5e46433e060
refs/heads/main
2023-07-14T16:57:24.507743
2021-08-26T14:50:16
2021-08-26T14:50:16
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,171
java
/** * Even if outgoing RunAs from previous state is empty, incoming RunAs has to be used for incomingRunAs for current state. * @param incomingRunAs Incoming RunAs for previous state. * @param outgoingRunAs Outgoung RunAs for previous state. */ private void testHandlingRunAs(RunAs incomingRunAs,RunAs outgoingRunAs){ SecurityContext context=mock(SecurityContext.class); if (outgoingRunAs != null) { when(context.getOutgoingRunAs()).thenReturn(outgoingRunAs); } if (incomingRunAs != null) { when(context.getIncomingRunAs()).thenReturn(incomingRunAs); } SecurityContextAssociation.setSecurityContext(context); simpleSecurityManager.push("test"); SecurityContext result=SecurityContextAssociation.getSecurityContext(); if (outgoingRunAs != null) { Assert.assertEquals("RunAs identity has to be same as previous outgoing RunAs.",outgoingRunAs,result.getIncomingRunAs()); } else if (incomingRunAs != null) { Assert.assertEquals("RunAs identity has to be same as previous incoming RunAs.",incomingRunAs,result.getIncomingRunAs()); } else { Assert.assertNull("RunAs identity has to be null.",result.getIncomingRunAs()); } }
[ "aalsha2@masonlive.gmu.edu" ]
aalsha2@masonlive.gmu.edu
f9c8253e9c1a5f5ef2feead7db761bee01b7d87b
c238f72675449d842a9533f975c22dc5f240427e
/src/main/java/org/kuali/kra/scheduling/expr/MonthlyWeekDayCronExpression.java
4ec1937037c65b1b11752f2fe2c2239d530ce990
[]
no_license
ua-eas/ksd-kc5.2.1-foundation
03df619bbffd24f822e13dd046e78ead2b6cbb8a
acf6bd1ef9cf976e7a93e31ad791b33a3c8e3a17
refs/heads/development
2022-06-09T09:11:24.777326
2020-07-06T18:21:17
2020-07-06T18:21:17
20,941,107
0
1
null
2020-06-15T19:07:36
2014-06-17T22:06:46
Java
UTF-8
Java
false
false
3,479
java
/* * Copyright 2005-2014 The Kuali Foundation * * Licensed under the Educational Community 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.opensource.org/licenses/ecl1.php * * 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.kuali.kra.scheduling.expr; import org.kuali.kra.scheduling.expr.util.CronSpecialChars; import org.kuali.kra.scheduling.util.Time24HrFmt; import java.text.ParseException; import java.util.Date; /** * This class extends CronExpression and provides MonthlyWeekDayCronExpression implementation. * <p> * This implementation generates expression for monthly scheduling dates using week of month, day of week and month. * * week of month: CronSpecialChars.FIRST, CronSpecialChars.SECOND, CronSpecialChars.THIRD, CronSpecialChars.FOURTH, * CronSpecialChars.FIFTH * * day of week: CronSpecialChars.SUN, CronSpecialChars.MON, CronSpecialChars.TUE, CronSpecialChars.WED, * CronSpecialChars.THU, CronSpecialChars.FRI, CronSpecialChars.SAT * * month: 1,2,3,4,5,6,7,8,9,10,11,12 * * Note: Start day is skipped, date boundary is handled by ScheduleSequence implementation during schedule generation. * * e.g. Start Date : 02/24/09, Time : 10:10 (hh:mm) Format (second minute hour day month year) Generated Expression :0 10 10 ? 2/1 TUE#2 * Explanation: Generate dates for every SECOND Tuesday of a month at 10:10 (hh:mm), starting from month of February. * * e.g. Start Date : 02/24/09, Time : 10:10 (hh:mm) Format (second minute hour day month year) Generated Expression :0 10 10 ? 2/2 TUE#2 * Explanation: Generate dates for every SECOND Tuesday of a every other month at 10:10 (hh:mm), starting from month of February. */ public class MonthlyWeekDayCronExpression extends CronExpression { private Integer frequencyInMonth; private CronSpecialChars dayOfWeek; private CronSpecialChars weekOfMonth; public MonthlyWeekDayCronExpression(Date startDate, Time24HrFmt time, CronSpecialChars dayOfWeek, CronSpecialChars weekOfMonth, Integer frequencyInMonth) throws ParseException { super(startDate, time); this.frequencyInMonth = frequencyInMonth; this.dayOfWeek = dayOfWeek; this.weekOfMonth = weekOfMonth; } @Override public String getExpression() { StringBuilder exp = new StringBuilder(); exp.append(SECONDS).append(CronSpecialChars.SPACE); exp.append(getTime().getMinutes()).append(CronSpecialChars.SPACE); exp.append(getTime().getHours()).append(CronSpecialChars.SPACE); exp.append(CronSpecialChars.QUESTION).append(CronSpecialChars.SPACE); exp.append(CronSpecialChars.FIRST).append(CronSpecialChars.SLASH).append(frequencyInMonth).append(CronSpecialChars.SPACE); if (!(weekOfMonth == CronSpecialChars.LAST)) exp.append(dayOfWeek).append(CronSpecialChars.HASH).append(weekOfMonth); else exp.append(dayOfWeek).append(CronSpecialChars.LAST); return exp.toString(); } }
[ "shaloo@email.arizona.edu" ]
shaloo@email.arizona.edu
4cc29f178c6e32706d24b4235cdd6997d4cb7e98
c131e2b20b44040d388b40835dee43ba47d5b367
/Java/SpringTest/src/main/java/algorithm/stackNQueue/MovingAverage.java
e1c84f3e00c92218d68e7b610a99fa6d56fc0e65
[]
no_license
kwanghyun/Showcases
9b37b94626e1e98390dc9798283bcfd66094ca43
778d65b1313919f0034e3612c3f53fc0b3f0b001
refs/heads/master
2020-05-21T23:34:03.876453
2017-01-26T18:19:51
2017-01-26T18:19:51
19,902,271
0
0
null
null
null
null
UTF-8
Java
false
false
816
java
package algorithm.stackNQueue; import java.util.LinkedList; /* * Given a stream of integers and a window size, calculate the moving * average of all integers in the sliding window. */ public class MovingAverage { LinkedList<Integer> queue; int size; double avg; /** Initialize your data structure here. */ public MovingAverage(int size) { this.queue = new LinkedList<Integer>(); this.size = size; } public double next(int val) { if (queue.size() < this.size) { queue.offer(val); int sum = 0; for (int i : queue) { sum += i; } avg = (double) sum / queue.size(); return avg; } else { int head = queue.poll(); double minus = (double) head / this.size; queue.offer(val); double add = (double) val / this.size; avg = avg + add - minus; return avg; } } }
[ "kwanghyun.jang@gmail.com" ]
kwanghyun.jang@gmail.com
ebb69620be599733196526c03027abf82405ad80
85cfc652459ca2f015aa8c8dc55240721632cee0
/bin/custom/cartridge/cartridgecore/src/com/hybris/cartridge/core/externaltax/impl/AcceleratorDetermineExternalTaxStrategy.java
dfd6485455c66327ea0b65dc16b8d8482164104e
[]
no_license
varshadhamal/Hybris-test
43e5479b9909e41e6276dfde6b4f4ff1cdae9b0e
a29c6090680110ab733e2077772c9c477d497df6
refs/heads/master
2020-03-18T06:31:01.940494
2018-05-22T11:58:12
2018-05-22T11:58:12
134,400,503
0
1
null
null
null
null
UTF-8
Java
false
false
1,392
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 com.hybris.cartridge.core.externaltax.impl; import de.hybris.platform.commerceservices.externaltax.DecideExternalTaxesStrategy; import de.hybris.platform.core.model.order.AbstractOrderModel; /** * Accelerator * */ public class AcceleratorDetermineExternalTaxStrategy implements DecideExternalTaxesStrategy { /** * Initially just to test if the delivery mode and address are set, than calculate the external taxes. * * Products in cart, delivery mode, delivery address and payment information to determine whether or not to calculate * taxes as tracked in https://jira.hybris.com/browse/ECP-845. */ @Override public boolean shouldCalculateExternalTaxes(final AbstractOrderModel abstractOrder) { if (abstractOrder == null) { throw new IllegalStateException("Order is null. Cannot apply external tax to it."); } return Boolean.TRUE.equals(abstractOrder.getNet()) && abstractOrder.getDeliveryMode() != null && abstractOrder .getDeliveryAddress() != null; } }
[ "varsha.d.saste@accenture.com" ]
varsha.d.saste@accenture.com
e8b5c5873fb7f705f2be6b8c08eeb3ff72031d7b
4fbbec1dce1f346cc9f70be37800cfc8a9196a14
/src/main/java/com/meat/controller/UserAddressController.java
d4a73ea3d4e90c1f38733496244e4c86e541201a
[]
no_license
jerryjazzz/BuyNonVeg
0946312f9f4b5e2ee839dd4952813e6100e7333e
3f7213aab32a69e876a4fcdb03de7b6945912f76
refs/heads/master
2021-06-01T11:32:40.985570
2016-08-20T12:55:54
2016-08-20T12:55:54
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,124
java
/** * */ package com.meat.controller; /** * @author arthvedi1 * */ /** * */ import com.google.code.siren4j.Siren4J; import com.meat.businessdelegate.domain.IKeyBuilder; import com.meat.businessdelegate.domain.SimpleIdKeyBuilder; import com.meat.businessdelegate.service.IBusinessDelegate; import com.meat.businessdelegate.service.UserAddressContext; import com.meat.model.UserAddressModel; import com.meat.util.CollectionModelWrapper; import com.meat.util.IModelWrapper; import java.util.Collection; import javax.annotation.Resource; import org.springframework.beans.factory.ObjectFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; /** * @author arthvedi * */ @RestController @RequestMapping(value = "/userAddress", produces = { MediaType.APPLICATION_JSON_VALUE, Siren4J.JSON_MEDIATYPE }, consumes = { MediaType.APPLICATION_JSON_VALUE, Siren4J.JSON_MEDIATYPE }) public class UserAddressController { private IBusinessDelegate<UserAddressModel, UserAddressContext, IKeyBuilder<String>, String> businessDelegate; private ObjectFactory<SimpleIdKeyBuilder> keyBuilderFactory; private ObjectFactory<UserAddressContext> userAddressContextFactory; @RequestMapping(method = RequestMethod.POST, value = "/create", consumes = { MediaType.ALL_VALUE }) @ResponseBody public ResponseEntity<UserAddressModel> create(@RequestBody final UserAddressModel userAddressModel) { businessDelegate.create(userAddressModel); return new ResponseEntity<UserAddressModel>(userAddressModel, HttpStatus.CREATED); } @RequestMapping(value = "/{id}/edit", method = RequestMethod.POST) @ResponseBody public ResponseEntity<UserAddressModel> edit(@PathVariable(value = "id") final String userAddressId, @RequestBody final UserAddressModel userAddressModel) { UserAddressContext userAddressContext = new UserAddressContext(); businessDelegate.edit(keyBuilderFactory.getObject().withId(userAddressId), userAddressModel); return new ResponseEntity<UserAddressModel>(userAddressModel, HttpStatus.CREATED); } @RequestMapping(method = RequestMethod.GET, value = "/all", consumes = { MediaType.ALL_VALUE }) @ResponseBody public ResponseEntity<IModelWrapper> getAllUserAddress() { UserAddressContext userAddressContext = userAddressContextFactory.getObject(); userAddressContext.setAll("all"); Collection<UserAddressModel> UserAddressModel = businessDelegate.getCollection(userAddressContext); IModelWrapper<Collection<UserAddressModel>> models = new CollectionModelWrapper<UserAddressModel>(UserAddressModel.class, UserAddressModel); return new ResponseEntity<IModelWrapper>(models, HttpStatus.OK); } @RequestMapping(method = RequestMethod.GET, value = "/{id}", consumes = { MediaType.ALL_VALUE }) @ResponseBody public ResponseEntity<UserAddressModel> getUserAddress(@PathVariable(value = "id") final String userAddressId) { UserAddressContext userAddressContext = userAddressContextFactory.getObject(); UserAddressModel model = businessDelegate.getByKey(keyBuilderFactory.getObject().withId(userAddressId), userAddressContext); return new ResponseEntity<UserAddressModel>(model, HttpStatus.OK); } /** * @param businessDelegate */ @Resource(name = "userAddressBusinessDelegate") public void setBusinessDelegate(final IBusinessDelegate businessDelegate) { this.businessDelegate = businessDelegate; } /** * @param factory */ @Resource public void setKeyBuilderFactory(final ObjectFactory<SimpleIdKeyBuilder> factory) { keyBuilderFactory = factory; } @Autowired public void setUserAddressObjectFactory(final ObjectFactory<UserAddressContext> userAddressContextFactory) { this.userAddressContextFactory = userAddressContextFactory; } }
[ "narendra.uppalapati@arthvedi.com" ]
narendra.uppalapati@arthvedi.com
6bc2a42cb1e64dd0b8c92de7ec2b5a2e9dbda4aa
7a50a54fdd62b41b653ffbb7253acd8e8ba4433d
/src/main/java/com/solr/handler/component/MySearchComponent.java
bc221c06d1fc76f96f8374789b25750969eca378
[]
no_license
mvphjx/solr_handler_extras
c1670367f8426fcfd17bc1e758871546934d057e
0fb04793881834b6d55894657f904bac8c2384e1
refs/heads/master
2020-03-22T01:40:09.073958
2018-07-01T14:47:02
2018-07-01T14:47:02
139,321,144
0
0
null
null
null
null
UTF-8
Java
false
false
779
java
package com.solr.handler.component; import org.apache.solr.handler.component.ResponseBuilder; import org.apache.solr.handler.component.SearchComponent; import org.apache.solr.search.DocIterator; import org.apache.solr.search.DocList; import org.apache.solr.search.DocListAndSet; import java.io.IOException; public class MySearchComponent extends SearchComponent { @Override public void prepare(ResponseBuilder rb) throws IOException { } @Override public void process(ResponseBuilder rb) throws IOException { DocListAndSet results = rb.getResults(); DocList docList = results.docList; DocIterator iterator = docList.iterator(); } @Override public String getDescription() { return null; } }
[ "511572653@qq.com" ]
511572653@qq.com
e08c0e6e2346688299b55909ac88ae4aac30a2a1
ea061388a30ab0fdfa79440b3baceb838c13599e
/desenvolvimento/backend/src/main/java/com/ramon/catchup/security/JWTUtil.java
7f419a6b5ecbf41408bd6b9df0644cc9317b2d67
[]
no_license
ramoncgusmao/catchup
dba577ade63609e955a661da2c120ed16e98b157
54bbd83236047d6bf1c519a752ed9c39cad20f24
refs/heads/master
2020-12-02T18:32:17.040628
2020-01-09T02:52:58
2020-01-09T02:52:58
231,079,941
0
0
null
null
null
null
UTF-8
Java
false
false
1,534
java
package com.ramon.catchup.security; import java.util.Date; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; import io.jsonwebtoken.Claims; import io.jsonwebtoken.Jwts; import io.jsonwebtoken.SignatureAlgorithm; @Component public class JWTUtil { @Value("${jwt.secret}") private String secret; @Value("${jwt.expiration}") private Long expiration; public String generateToken(String email) { return Jwts.builder() .setSubject(email) .setExpiration(new Date(System.currentTimeMillis() + expiration)) .signWith(SignatureAlgorithm.HS512, secret.getBytes()) .compact(); } public boolean tokenValido(String token) { // TODO Auto-generated method stub Claims claims = getClaims(token); if(claims != null) { String username = claims.getSubject(); Date expirationDate = claims.getExpiration(); Date now = new Date(System.currentTimeMillis()); if(username != null && expirationDate != null && now.before(expirationDate)) { return true; } } return false; } private Claims getClaims(String token) { // TODO Auto-generated method stub token = token.substring(7); try { return Jwts.parser().setSigningKey(secret.getBytes()).parseClaimsJws(token).getBody(); }catch (Exception e) { System.out.println(e.getMessage()); return null; } } public String getUsername(String token) { Claims claims = getClaims(token); if(claims != null) { return claims.getSubject(); } return null; } }
[ "ramoncgusmao@gmail.com" ]
ramoncgusmao@gmail.com
d953bc0e6dd3401018a24f2b91d6651a5272c393
9c4fcf0ed5c9a5921cb5c114866f90dcb8eb2360
/project_files/src/org/codehaus/jackson/node/LongNode.java
26330b30f4498ef24ff7979c2b91bd459d9aedde
[]
no_license
adv0r/yatc
9555ede6e403246c79cabcc42c0126279750532d
694bdc5d1ebd5bd02283534f122a58d347ec3e07
refs/heads/master
2021-01-10T20:04:19.601285
2012-02-10T17:23:47
2012-02-10T17:23:47
3,409,249
0
0
null
null
null
null
UTF-8
Java
false
false
3,002
java
/* */ package org.codehaus.jackson.node; /* */ /* */ import java.io.IOException; /* */ import java.math.BigDecimal; /* */ import java.math.BigInteger; /* */ import org.codehaus.jackson.JsonGenerator; /* */ import org.codehaus.jackson.JsonParser.NumberType; /* */ import org.codehaus.jackson.JsonProcessingException; /* */ import org.codehaus.jackson.JsonToken; /* */ import org.codehaus.jackson.io.NumberOutput; /* */ import org.codehaus.jackson.map.SerializerProvider; /* */ /* */ public final class LongNode extends NumericNode /* */ { /* */ final long _value; /* */ /* */ public LongNode(long v) /* */ { /* 25 */ this._value = v; /* */ } /* 27 */ public static LongNode valueOf(long l) { return new LongNode(l); /* */ } /* */ /* */ public JsonToken asToken() /* */ { /* 35 */ return JsonToken.VALUE_NUMBER_INT; /* */ } /* */ public JsonParser.NumberType getNumberType() { /* 38 */ return JsonParser.NumberType.LONG; /* */ } /* */ /* */ public boolean isIntegralNumber() { /* 42 */ return true; /* */ } /* */ public boolean isLong() { /* 45 */ return true; /* */ } /* */ /* */ public Number getNumberValue() { /* 49 */ return Long.valueOf(this._value); /* */ } /* */ /* */ public int getIntValue() { /* 53 */ return (int)this._value; /* */ } /* */ public long getLongValue() { /* 56 */ return this._value; /* */ } /* */ public double getDoubleValue() { /* 59 */ return this._value; /* */ } /* */ public BigDecimal getDecimalValue() { /* 62 */ return BigDecimal.valueOf(this._value); /* */ } /* */ public BigInteger getBigIntegerValue() { /* 65 */ return BigInteger.valueOf(this._value); /* */ } /* */ /* */ public String getValueAsText() { /* 69 */ return NumberOutput.toString(this._value); /* */ } /* */ /* */ public boolean getValueAsBoolean(boolean defaultValue) /* */ { /* 74 */ return this._value != 0L; /* */ } /* */ /* */ public final void serialize(JsonGenerator jg, SerializerProvider provider) /* */ throws IOException, JsonProcessingException /* */ { /* 81 */ jg.writeNumber(this._value); /* */ } /* */ /* */ public boolean equals(Object o) /* */ { /* 87 */ if (o == this) return true; /* 88 */ if (o == null) return false; /* 89 */ if (o.getClass() != getClass()) { /* 90 */ return false; /* */ } /* 92 */ return ((LongNode)o)._value == this._value; /* */ } /* */ /* */ public int hashCode() /* */ { /* 97 */ return (int)this._value ^ (int)(this._value >> 32); /* */ } /* */ } /* Location: /Users/Advanced/Desktop/EMSE/Year1/Semester2/Computer Networks/Assignment1_twitter/yatc/project_files/yatc.jar * Qualified Name: org.codehaus.jackson.node.LongNode * JD-Core Version: 0.6.0 */
[ "paternoster.nicolo@gmail.com" ]
paternoster.nicolo@gmail.com
dfb564d655eb2cb6f6471fe86190e2a662ce4e99
534758e3f67d9039abbc7835a9ef7d91f788a745
/src/main/java/uk/ac/open/kmi/discou/spotlight/SpotlightClient.java
9bebb364f5d93adf35c6855f1c24fa937e1e861d
[]
no_license
kmitd/discou-indexer
1f2d11998412e1b26389914398db1a6f7c65175a
e5bcc9c6516d9805e9e768faf17915472fb186af
refs/heads/master
2020-07-23T12:41:40.110388
2016-11-15T12:09:27
2016-11-15T12:09:27
73,809,569
0
0
null
2016-11-15T12:02:17
2016-11-15T12:02:17
null
UTF-8
Java
false
false
3,693
java
package uk.ac.open.kmi.discou.spotlight; import java.io.BufferedReader; import java.io.ByteArrayInputStream; import java.io.DataOutputStream; import java.io.IOException; import java.io.InputStreamReader; import java.net.HttpURLConnection; import java.net.URL; import java.net.URLEncoder; import java.util.ArrayList; import java.util.List; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import org.w3c.dom.Node; import org.w3c.dom.NodeList; public class SpotlightClient { private String spotlight; public SpotlightClient(String spotlight) { this.spotlight = spotlight; } public SpotlightResponse perform(String text, double confidence, int support) throws IOException { long sss; // URL connection channel. StringBuilder stringBuilder; try { HttpURLConnection urlConn; String querystring = new StringBuilder().append("text=").append(URLEncoder.encode(text, "UTF-8")).append("&confidence=").append(confidence).append("&support=").append(support).toString(); // 8192 bytes as max URL length boolean doPost = true; // XXX We always do a HTTP POST if (spotlight.getBytes().length + querystring.getBytes().length > 8192) { doPost = true; } if (doPost) { urlConn = (HttpURLConnection) new URL(spotlight).openConnection(); // Let the run-time system (RTS) know that we want input. urlConn.setDoInput(true); // Let the RTS know that we want to do output. urlConn.setDoOutput(true); // No caching, we want the real thing. urlConn.setUseCaches(false); // Request method urlConn.setRequestMethod("POST"); // Specify the content type. urlConn.setRequestProperty("Accept", "text/xml"); // Send POST output. DataOutputStream printout = new DataOutputStream(urlConn.getOutputStream()); printout.writeBytes(querystring); printout.flush(); printout.close(); } else { // Do GET urlConn = (HttpURLConnection) new URL(spotlight + '?' + querystring ).openConnection(); urlConn.setRequestProperty("Accept", "text/xml"); } sss = System.currentTimeMillis(); // Get response data. BufferedReader input = new BufferedReader(new InputStreamReader(urlConn.getInputStream())); sss = (System.currentTimeMillis() - sss); String line; String test = ""; // FIXME Can't we simply ask HttpURLConnection to not return // headers? boolean httpHeader = true; stringBuilder = new StringBuilder(); while ((line = input.readLine()) != null) { if (httpHeader) { if (line.length() > 5) { test = line.substring(0, 5); } if (test.equals("<?xml")) { httpHeader = false; stringBuilder.append(line); } } else { stringBuilder.append(line); } } input.close(); } catch (IOException e) { throw e; } return new SpotlightResponse(stringBuilder.toString(), sss); } public static final List<SpotlightAnnotation> toList(String xml) { List<SpotlightAnnotation> annotations; DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); try { DocumentBuilder db = dbf.newDocumentBuilder(); org.w3c.dom.Document dom = db.parse(new ByteArrayInputStream(xml.getBytes("UTF-8"))); // TODO Where to get the confidence parameter? double confidence = 0.2; NodeList nl = dom.getElementsByTagName("Resource"); annotations = new ArrayList<SpotlightAnnotation>(); for (int i = 0; i < nl.getLength(); ++i) { Node n = nl.item(i); SpotlightAnnotation annotation = new SpotlightAnnotation(n, confidence); annotations.add(annotation); } } catch (Exception e) { throw new RuntimeException(e); } return annotations; } }
[ "enricodaga@gmail.com" ]
enricodaga@gmail.com
849f0ab1b8ad52109abff1589d586e8b1a4c7462
31540ee24da4983238f22643e88b62cee73f32f9
/sd2021-tp1/src/tp1/impl/srv/soap/SoapUsersWebService.java
7ed02d6faeb3559a22ef322bd18e8a60d7f8471f
[]
no_license
smduarte/sd2021-tp1
789d766fcef73373fccf823773514b0515cc17bc
e7d6ed50a7d466c8fa6a3a9a8a797fa79deea55b
refs/heads/main
2023-04-24T07:58:49.932147
2021-05-13T13:28:55
2021-05-13T13:28:55
365,859,447
0
2
null
null
null
null
UTF-8
Java
false
false
2,184
java
package tp1.impl.srv.soap; import java.util.List; import java.util.logging.Logger; import jakarta.jws.WebService; import tp1.api.User; import tp1.api.service.java.Result; import tp1.api.service.java.Users; import tp1.api.service.soap.SoapUsers; import tp1.api.service.soap.UsersException; import tp1.impl.srv.common.JavaUsers; @WebService(serviceName=SoapUsers.NAME, targetNamespace=SoapUsers.NAMESPACE, endpointInterface=SoapUsers.INTERFACE) public class SoapUsersWebService implements SoapUsers { private static Logger Log = Logger.getLogger(SoapUsersWebService.class.getName()); final Users impl ; public SoapUsersWebService() { impl = new JavaUsers(); } private <T> T resultOrThrow(Result<T> result) throws UsersException { if (result.isOK()) return result.value(); else throw new UsersException(result.error().name()); } @Override public String createUser(User user) throws UsersException { Log.info(String.format("SOAP createUser: user = %s\n", user)); return resultOrThrow( impl.createUser( user )); } @Override public User getUser(String userId, String password) throws UsersException { Log.info(String.format("SOAP getUser: userId = %s password=%s\n", userId, password)); return resultOrThrow( impl.getUser(userId, password)); } @Override public User updateUser(String userId, String password, User user) throws UsersException { Log.info(String.format("SOAP updateUser: userId = %s, user = %s\n", userId, user)); return resultOrThrow( impl.updateUser(userId, password, user)); } @Override public User deleteUser(String userId, String password) throws UsersException { Log.info(String.format("SOAP deleteUser: userId = %s\n", userId)); return resultOrThrow( impl.deleteUser(userId, password)); } @Override public List<User> searchUsers(String pattern) throws UsersException { Log.info(String.format("SOAP searchUsers: pattern = %s", pattern)); return resultOrThrow( impl.searchUsers(pattern)); } @Override public User fetchUser(String userId) throws UsersException { Log.info(String.format("SOAP fetchUser: pattern = %s", userId)); return resultOrThrow( impl.fetchUser(userId)); } }
[ "smd@fct.unl.pt" ]
smd@fct.unl.pt
1e0482e2402764140e31bf04f954f5e7972fcef5
28782d17391ff43d9e23e43302969ea8f3a4f284
/java/com/tencent/android/tpush/XGPushClickedResult.java
1639bd8059baa00ba733a261fb54702c6c8fc101
[]
no_license
UltraSoundX/Fucking-AJN-APP
115f7c2782e089c48748516b77e37266438f998b
11354917502f442ab212e5cada168a8031b48436
refs/heads/master
2021-05-19T11:05:42.588930
2020-03-31T16:27:26
2020-03-31T16:27:26
251,662,642
0
0
null
null
null
null
UTF-8
Java
false
false
3,115
java
package com.tencent.android.tpush; import android.content.Intent; import com.tencent.android.tpush.common.Constants; import com.tencent.android.tpush.common.MessageKey; import com.tencent.android.tpush.encrypt.Rijndael; import java.io.Serializable; /* compiled from: ProGuard */ public class XGPushClickedResult implements XGIResult, Serializable { public static final int NOTIFACTION_CLICKED_TYPE = NotificationAction.clicked.getType(); public static final int NOTIFACTION_DELETED_TYPE = NotificationAction.delete.getType(); public static final int NOTIFACTION_DOWNLOAD_CANCEL_TYPE = NotificationAction.download_cancel.getType(); public static final int NOTIFACTION_DOWNLOAD_TYPE = NotificationAction.download.getType(); public static final int NOTIFACTION_OPEN_CANCEL_TYPE = NotificationAction.open_cancel.getType(); public static final int NOTIFACTION_OPEN_TYPE = NotificationAction.open.getType(); public static final int NOTIFICATION_ACTION_ACTIVITY = NotificationAction.activity.getType(); private static final long serialVersionUID = 5485267763104201539L; int actionType = NotificationAction.clicked.getType(); String activityName = ""; String content = ""; String customContent = ""; long msgId = 0; int notificationActionType = NotificationAction.activity.getType(); int pushChannel = 0; String title = ""; public int getPushChannel() { return this.pushChannel; } public long getMsgId() { return this.msgId; } public String getTitle() { return this.title; } public String getContent() { return this.content; } public String getCustomContent() { return this.customContent; } public String getActivityName() { return this.activityName; } public long getActionType() { return (long) this.actionType; } public int getNotificationActionType() { return this.notificationActionType; } public String toString() { StringBuilder sb = new StringBuilder(); sb.append("XGPushClickedResult [msgId=").append(this.msgId).append(", title=").append(this.title).append(", customContent=").append(this.customContent).append(", activityName=").append(this.activityName).append(", actionType=").append(this.actionType).append(", notificationActionType").append(this.notificationActionType).append("]"); return sb.toString(); } public void parseIntent(Intent intent) { this.msgId = intent.getLongExtra(MessageKey.MSG_ID, -1); this.activityName = intent.getStringExtra(Constants.FLAG_ACTIVITY_NAME); this.title = Rijndael.decrypt(intent.getStringExtra("title")); this.content = Rijndael.decrypt(intent.getStringExtra("content")); this.customContent = Rijndael.decrypt(intent.getStringExtra("custom_content")); this.actionType = intent.getIntExtra("action", NotificationAction.clicked.getType()); this.notificationActionType = intent.getIntExtra(Constants.FLAG_NOTIFICATION_ACTION_TYPE, NotificationAction.activity.getType()); } }
[ "haroldxin@foxmail.com" ]
haroldxin@foxmail.com
282c9654a7223440faa841c36795fefdc69ddea9
03f5a7f918ac141b54504bedc69db1c17666d6b7
/app/src/main/java/com/cxd/cxd4android/model/NoticeModel.java
028f4e8a04e7a4b6162afce4621cfc823fadb1bb
[]
no_license
zhangyizhangyiran/cxd4news
6481709473d2635d4263390f8c3e192f06d3614f
0e9ee10863f4a59f00385d6d8998c5ebc2d6e53c
refs/heads/master
2021-06-30T18:47:57.750377
2017-09-21T06:00:58
2017-09-21T06:00:58
104,296,800
1
0
null
null
null
null
UTF-8
Java
false
false
311
java
package com.cxd.cxd4android.model; import java.io.Serializable; /** * @version V1.0 * @ClassName: * @Description: * @Author:xiaofa * @Date:2016/3/15 17:10 */ public class NoticeModel implements Serializable { public String page=""; public String title=""; public String action=""; }
[ "1104745049@qq.com" ]
1104745049@qq.com
cba55b334af537a1bd63f90c15dfa86860c20cf4
564e9aff2cad3a4c6c48ee562008cb564628e8e8
/src/net/minecraft/CounterStatistic.java
e9c83197a78fc8f8f38303bd0d48d9eb28d49c7b
[]
no_license
BeYkeRYkt/MinecraftServerDec
efbafd774cf5c68bde0dd60b7511ac91d3f1bd8e
cfb5b989abb0e68112f7d731d0d79e0d0021c94f
refs/heads/master
2021-01-10T19:05:30.104737
2014-09-28T10:42:47
2014-09-28T10:42:47
23,732,504
1
0
null
2014-09-28T10:32:16
2014-09-06T10:46:05
Java
UTF-8
Java
false
false
375
java
package net.minecraft; public class CounterStatistic extends Statistic { public CounterStatistic(String var1, IChatBaseComponent var2, Counter var3) { super(var1, var2, var3); } public CounterStatistic(String var1, IChatBaseComponent var2) { super(var1, var2); } public Statistic register() { super.register(); StatisticList.c.add(this); return this; } }
[ "Shev4ik.den@gmail.com" ]
Shev4ik.den@gmail.com
10094930e8c6ae59de6c44405bb98b00cb80aad2
d90bc68346a2a786b01266e577dd23b0ff3387f2
/core/src/driver/org/jnode/driver/DeviceAlreadyConnectedException.java
595e43c0f8429cdd365af2453a91da0fd6569c23
[]
no_license
flesire/jnode.mirror
aa2930923e998e7fbd9a48564c40edadfddb8cc7
2fae7f6b392a8ace3840e09635d3cc0105e4f335
refs/heads/master
2021-01-23T03:48:46.788908
2013-09-06T14:23:31
2013-09-06T14:23:31
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,669
java
/* * $Id: DeviceAlreadyConnectedException.java 5956 2013-02-17 20:50:10Z lsantha $ * * Copyright (C) 2003-2013 JNode.org * * This library is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this library; If not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ package org.jnode.driver; /** * The device has already been connected to a driver exception. * * @author Ewout Prangsma (epr@users.sourceforge.net) */ public class DeviceAlreadyConnectedException extends DriverException { /** * */ public DeviceAlreadyConnectedException() { super(); } /** * @param message * @param cause */ public DeviceAlreadyConnectedException(String message, Throwable cause) { super(message, cause); } /** * @param cause */ public DeviceAlreadyConnectedException(Throwable cause) { super(cause); } /** * @param s */ public DeviceAlreadyConnectedException(String s) { super(s); } }
[ "galatnm@gmail.com" ]
galatnm@gmail.com
8d9da295fb087907eff8d51da480ff9178a159c5
80c9f4068e634fbd111f541b4b4909272bd592e2
/src/main/java/fr/uga/polytech/greenhouse/config/LocaleConfiguration.java
e2900d6a50093001b68e1cc982406b07c1c4b7a0
[]
no_license
MathildeAguiar/GreenhouseApp
8529327ddc521686351684ac65b58a847232924e
04918b4dcf367b27537b3ec3f56c67e60d9515e5
refs/heads/main
2023-03-27T05:01:40.242193
2021-03-29T13:49:29
2021-03-29T13:49:29
352,651,454
0
0
null
2021-03-29T13:49:29
2021-03-29T13:22:08
Java
UTF-8
Java
false
false
1,038
java
package fr.uga.polytech.greenhouse.config; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.LocaleResolver; import org.springframework.web.servlet.config.annotation.*; import org.springframework.web.servlet.i18n.LocaleChangeInterceptor; import tech.jhipster.config.locale.AngularCookieLocaleResolver; @Configuration public class LocaleConfiguration implements WebMvcConfigurer { @Bean public LocaleResolver localeResolver() { AngularCookieLocaleResolver cookieLocaleResolver = new AngularCookieLocaleResolver(); cookieLocaleResolver.setCookieName("NG_TRANSLATE_LANG_KEY"); return cookieLocaleResolver; } @Override public void addInterceptors(InterceptorRegistry registry) { LocaleChangeInterceptor localeChangeInterceptor = new LocaleChangeInterceptor(); localeChangeInterceptor.setParamName("language"); registry.addInterceptor(localeChangeInterceptor); } }
[ "jhipster-bot@jhipster.tech" ]
jhipster-bot@jhipster.tech
e4f6966224507d3cf328997e19a67e451ee5d910
6e949d17adc95460425f043d5b70cb14bd13ef95
/service-message/src/main/java/com/tongzhu/servicemessage/message/request/ChatRedTipRequestPacket.java
d0dbc4259f156e52bf1432dba8ed8028a3e33e01
[]
no_license
HuangRicher/tree
ca1397d6a74eb5d8e49697934c1077beb415d704
88d314cac28d3eea820addcd392ff2d01a74f320
refs/heads/master
2020-05-21T06:08:50.365919
2019-05-15T05:49:39
2019-05-15T05:49:39
185,935,338
0
0
null
null
null
null
UTF-8
Java
false
false
552
java
package com.tongzhu.servicemessage.message.request; import java.io.Serializable; public class ChatRedTipRequestPacket extends RequestPacket implements Serializable { // chat , mail private String requestType; private Integer code; public String getRequestType() { return requestType; } public void setRequestType(String requestType) { this.requestType = requestType; } public Integer getCode() { return code; } public void setCode(Integer code) { this.code = code; } }
[ "huangweibiao@instoms.cn" ]
huangweibiao@instoms.cn
f7b1e7dec8328aac166cb990ae09c485e40eab1c
a33aac97878b2cb15677be26e308cbc46e2862d2
/data/libgdx/JglfwGraphics_frameStart.java
37a5207b282f9e2cb4d03743573c58cf48b74dd2
[]
no_license
GabeOchieng/ggnn.tensorflow
f5d7d0bca52258336fc12c9de6ae38223f28f786
7c62c0e8427bea6c8bec2cebf157b6f1ea70a213
refs/heads/master
2022-05-30T11:17:42.278048
2020-05-02T11:33:31
2020-05-02T11:33:31
null
0
0
null
null
null
null
UTF-8
Java
false
false
299
java
void frameStart(long time) { if (lastTime == -1) lastTime = time; deltaTime = (time - lastTime) / 1000000000.0f; lastTime = time; if (time - frameStart >= 1000000000) { fps = frames; frames = 0; frameStart = time; } frames++; frameId++; }
[ "bdqnghi@gmail.com" ]
bdqnghi@gmail.com
594b35e0ce27eb8b7fc613071d7a42d710a86b17
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/8/8_28436896996ed4b90eb1c662f2dc7aef7ef6e5f3/XmlTag/8_28436896996ed4b90eb1c662f2dc7aef7ef6e5f3_XmlTag_t.java
e50ad1865d178d9b23bbb7d31f009f95e97ac182
[]
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
5,947
java
package rtay; import java.util.Vector; /** * @author Raymond Tay * @date 05 July 2012 * @version 1.0 * Class to manage functions and represent an actual xml tag * contains a cyclic reference to itself as link to child tags * manages conversion of object to string toString() */ public class XmlTag { private static final String LEVEL_DELIMITER = System.getProperty("line.separator"); // may require change depending on platform private String name; // compulsory attribute private Vector <XmlTag> childTags; private Vector <XmlAttribute> attributes; private String value = ""; // default to empty if not explicitly set private int level = 0; // default to 0 if not explicitly set // ctor /** * XmlTag constructor with compulsory name * @param name Name of tag */ public XmlTag(String name) { this.childTags = new Vector <XmlTag>(); this.attributes = new Vector <XmlAttribute>(); this.setName(name); } /** * XmlTag constructor with compulsory name, optional value * @param name Name of tag * @param value Value of specified tag */ public XmlTag(String name, String value) { this.childTags = new Vector <XmlTag>(); this.attributes = new Vector <XmlAttribute>(); this.setName(name); this.setValue(value); } // setters /** * Sets name of XmlTag * @param name Name of tag */ public void setName(String name) { this.name = name; } /** * Sets value of XmlTag * @param value Value of tag */ public void setValue(String value) { this.value = value; } /** * Sets value of Level * Defines the number of tabs before the tag * @param level level of the tag */ public void setLevel(int level) { this.level = level; } /** * Adds an attribute to tag * @param attribute XmlAttribute containing attribute name and value */ public void addAttribute(XmlAttribute attribute) { this.attributes.add(attribute); } /** * Adds a child tag to the current tag with lower level * @param childTag */ public void addChildTag(XmlTag childTag) { // Reset tag of child to current add one childTag.setLevel(this.getLevel() + 1); this.childTags.add(childTag); } // getters /** * Retrieves name of tag * @return name */ public String getName() { return this.name; } /** * Retrieves value of tag * @return value */ public String getValue() { return this.value; } /** * Retrieves level of tag in the tag hierarchy * @return level of tag */ public int getLevel() { return this.level; } // methods /** * Generates the open tag (including attributes if set) * @param tabs Adds tabs based on level before open tag if true * @return string representing open tag, eg. <FirstName> */ public String getOpenTagString(boolean tabs) { String xmlString = ""; // Generate tabs for opening tag if(tabs) { for(int i=0; i< level; i++) { xmlString += '\t'; } } // Generate Xml opening tag string xmlString += "<"; // Start opening tag xmlString += this.name; // Concatenate all attributes for(XmlAttribute xa : this.attributes) { xmlString += " "; xmlString += xa.toString(); } if(this.childTags.size()>0 && this.value.length() > 0) { // show value as attribute if set and contains child tags xmlString += " "; xmlString += "value="; xmlString += '\"'; xmlString += this.value; xmlString += '\"'; } xmlString += ">"; // End of opening tag return xmlString; } /** * Generates the body tag (including child tags if set) * @return string representing body within tag, eg. Raymond */ public String getBodyString() { String xmlString = ""; // Generate Xml body string if(this.childTags.size() == 0) { // show value in innerXML without delimiter (end of recursion) xmlString += this.value; } else { for(XmlTag childTag: this.childTags) { // there is another level below current tag xmlString += LEVEL_DELIMITER; // show lower level tag (recursively) xmlString += childTag.toString(); } xmlString += LEVEL_DELIMITER; } return xmlString; } /** * Generates the close tag * @param tabs Adds tabs based on level before close tag if true * @return string representing close tag, eg. </FirstName> */ public String getCloseTagString(boolean tabs) { String xmlString = ""; // Generate Xml closing tags // Generate tab for closing tags (only if newline) if(this.childTags.size() != 0 && tabs) { for(int i=0; i< level; i++) { xmlString += '\t'; } } xmlString += "</"; // start of closing tag xmlString += this.name; xmlString += ">"; // end of closing tag return xmlString; } /** * @brief Display Xmltag data as actual Xml string * @return Xml formatted tabbed string with open tag, body, and close tag */ public String toString() { String xmlString = ""; xmlString += this.getOpenTagString(true); xmlString += this.getBodyString(); xmlString += this.getCloseTagString(true); return xmlString; } // static methods /** * GEDCOM specific convenience method to create an XmlTag * @param tagOrId String containing GEDCOM tagOrID field * @param data String containing GEDCOM data field * @param tagOrIdRegex Regex string to distinguish Id in tagOrId * @return */ public static XmlTag createGEDCOMTag(String tagOrId, String data, String tagOrIdRegex) { XmlTag newObj; if(tagOrId.matches(tagOrIdRegex)) { // tagOrID is an ID, Data is the tagName newObj = new XmlTag(data); newObj.addAttribute(new XmlAttribute("id", tagOrId)); } else { // tagORID is a tag, Data is value newObj = new XmlTag(tagOrId, data); } return newObj; } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
b47803c02a5acdc4f9fc4aae9f1bf4f9a5f6f8f8
0118956ece52559399cd1805dd68ac21e83ae3d9
/fitnesse/lib/src/fitlibrarySrc/fitlibrary/utility/StringTablesPair.java
2fc0f751da2fa2344552f9c178062587dcb8b43b
[]
no_license
JavaQualitasCorpus/fitlibraryforfitnesse-20110301
6588290ca08deb254e76f67aa6936d2a6f24370f
ceb5abcce236ae380cc0745a7920f82cfba69a19
refs/heads/master
2023-08-12T08:37:17.890919
2019-03-12T23:27:44
2019-03-12T23:27:44
167,004,721
0
1
null
null
null
null
UTF-8
Java
false
false
475
java
/* * Copyright (c) 2010 Rick Mugridge, www.RimuResearch.com * Released under the terms of the GNU General Public License version 2 or later. */ package fitlibrary.utility; import fitlibrary.table.TableFactory; import fitlibrary.table.Tables; public class StringTablesPair extends Pair<String,Tables> { public StringTablesPair(String s) { super(s,TableFactory.tables()); } public StringTablesPair(String s, Tables tables) { super(s,tables); } }
[ "taibi@sonar-scheduler.rd.tut.fi" ]
taibi@sonar-scheduler.rd.tut.fi
72e5ef2621de8f378421527c3ade0696cf8c1767
96c48b375d20ba117b5952eb5ec6c2a24f57cd66
/src/main/java/io/renren/service/SyncService.java
f514e6e792806a50126ea0721777d77107c031a2
[]
no_license
zzzzata/school-admin
1cddfa7df9029e2ea3d34396162005a5f943ba0d
baea150018b085f45135b08957aa8027bb5f24e2
refs/heads/master
2022-12-21T23:45:01.185403
2019-09-20T06:16:31
2019-09-20T06:16:31
209,701,174
0
0
null
2022-12-16T08:07:45
2019-09-20T03:54:18
Java
UTF-8
Java
false
false
1,980
java
package io.renren.service; import java.util.List; import io.renren.entity.CourseLiveDetailsEntity; import io.renren.entity.CoursesEntity; /** * 同步课程和课时 * @class io.renren.service.SysSyncCourseTimeService.java * @Description: * @author shihongjie * @dete 2017年6月7日 */ public interface SyncService { /** * 同步自考1.0出勤数据 * @param request * @return */ public void syncKSLogMongodb(); /** * 同步课程和课时 * @param coursesEntity 课程 * @param courseLiveDetailsEntity 课时 */ public void syncSaveCourse(CoursesEntity coursesEntity , List<CourseLiveDetailsEntity> courseLiveDetailsEntitys); /** * 同步所有课程 * @param schoolId */ public void syncCourse(String schoolId); /** * 同步所有商品 */ public void syncCommodity(String schoolId); /** * 同步排课 * @param schoolId */ public void syncClassplan(String schoolId); /** * 同步学习计划 * @param schoolId */ public void syncCourseUserPlanClass(String schoolId); /** * 同步授课老师 * @param schoolId * @return */ public String syncTeacher(String schoolId); /** * 同步所有直播间 */ public void syncliveRoom(String schoolId); /** * 批量生成学员规划-订单未生成学员规划的 * @param schoolId 平台ID */ void saveUserplanBatch(String schoolId); /** * 同步学员 * @param schoolId 平台ID */ void syncUsers(String schoolId); /** * 更新排课信息 * @param schoolId 平台ID */ void updateCourseClassPlanLives(); /** * 同步直播信息 * @param schoolId 平台ID */ void syncLiveLog(Integer type,String schoolId); /** * 更新排课明细回放 * @param schoolId 平台ID */ void UpdatecourseClassplanLives(); /* * 同步客服 */ public void syncAgent(); /* * 同步客户 */ public void syncCustomers(Integer startOrderId, Integer endOrderId, String teacherMobile, String orderNos); }
[ "ouchujian@hqjy.com" ]
ouchujian@hqjy.com
84089365e84dd9fafe54717d04f287b3c5decf4b
aa424c208191a7bcd14a4248f74f9963a2dc2a1d
/src/main/java/vn/mog/ewallet/operation/web/thirdparty/system/integration/payment/contract/system/ChangeBlacklistReasonRequest.java
5471d4796a92032794cf941ce9961fff042ee73c
[]
no_license
duongvic/wallet-operation-web
50f85669461d337740a25d8f602e2865f1d3503e
11f0c5c10054f780ea45faa3b610cb1ab1b7818b
refs/heads/master
2023-07-02T17:49:59.324117
2021-08-18T04:59:36
2021-08-18T04:59:36
397,476,761
0
0
null
null
null
null
UTF-8
Java
false
false
181
java
package vn.mog.ewallet.operation.web.thirdparty.system.integration.payment.contract.system; public class ChangeBlacklistReasonRequest extends ChangeBlacklistReasonRequestType { }
[ "DuongNH43@fpt.com.vn" ]
DuongNH43@fpt.com.vn
00ea7384a79b535161eaf7cb6512ed94d9f607dd
75950d61f2e7517f3fe4c32f0109b203d41466bf
/modules/tags/fabric3-modules-parent-pom-1.9/kernel/impl/fabric3-fabric/src/test/java/org/fabric3/fabric/management/DelegatingManagementServiceTestCase.java
aeba2368360a4589fa02e56e71027519db781bfa
[]
no_license
codehaus/fabric3
3677d558dca066fb58845db5b0ad73d951acf880
491ff9ddaff6cb47cbb4452e4ddbf715314cd340
refs/heads/master
2023-07-20T00:34:33.992727
2012-10-31T16:32:19
2012-10-31T16:32:19
36,338,853
0
0
null
null
null
null
UTF-8
Java
false
false
6,540
java
/* * Fabric3 * Copyright (c) 2009-2011 Metaform Systems * * Fabric3 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, with the * following exception: * * Linking this software statically or dynamically with other * modules is making a combined work based on this software. * Thus, the terms and conditions of the GNU General Public * License cover the whole combination. * * As a special exception, the copyright holders of this software * give you permission to link this software with independent * modules to produce an executable, regardless of the license * terms of these independent modules, and to copy and distribute * the resulting executable under terms of your choice, provided * that you also meet, for each linked independent module, the * terms and conditions of the license of that module. An * independent module is a module which is not derived from or * based on this software. If you modify this software, you may * extend this exception to your version of the software, but * you are not obligated to do so. If you do not wish to do so, * delete this exception statement from your version. * * Fabric3 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 Fabric3. * If not, see <http://www.gnu.org/licenses/>. */ package org.fabric3.fabric.management; import java.net.URI; import java.util.Collections; import junit.framework.TestCase; import org.easymock.EasyMock; import org.fabric3.spi.management.ManagementExtension; import org.fabric3.spi.model.type.java.ManagementInfo; import org.fabric3.spi.objectfactory.SingletonObjectFactory; /** * @version $Rev: 9763 $ $Date: 2011-01-03 01:48:06 +0100 (Mon, 03 Jan 2011) $ */ public class DelegatingManagementServiceTestCase extends TestCase { private DelegatingManagementService managementService = new DelegatingManagementService(); public void testComponentRegistration() throws Exception { URI uri = URI.create("test"); SingletonObjectFactory<Object> factory = new SingletonObjectFactory<Object>(this); ClassLoader loader = getClass().getClassLoader(); ManagementExtension extension = EasyMock.createMock(ManagementExtension.class); EasyMock.expect(extension.getType()).andReturn("test.extension"); extension.export(uri, null, factory, loader); EasyMock.expectLastCall(); EasyMock.replay(extension); managementService.setExtensions(Collections.singletonList(extension)); managementService.export(uri, null, factory, loader); EasyMock.verify(extension); } public void testComponentRemove() throws Exception { URI uri = URI.create("test"); SingletonObjectFactory<Object> factory = new SingletonObjectFactory<Object>(this); ClassLoader loader = getClass().getClassLoader(); ManagementInfo info = new ManagementInfo(null, null, null, null, null, null, null); ManagementExtension extension = EasyMock.createMock(ManagementExtension.class); EasyMock.expect(extension.getType()).andReturn("test.extension"); extension.export(uri, info, factory, loader); EasyMock.expectLastCall(); extension.remove(uri, info); EasyMock.expectLastCall(); EasyMock.replay(extension); managementService.setExtensions(Collections.singletonList(extension)); managementService.export(uri, info, factory, loader); managementService.remove(uri, info); EasyMock.verify(extension); } public void testDelayedComponentRegistration() throws Exception { URI uri = URI.create("test"); SingletonObjectFactory<Object> factory = new SingletonObjectFactory<Object>(this); ClassLoader loader = getClass().getClassLoader(); ManagementExtension extension = EasyMock.createMock(ManagementExtension.class); EasyMock.expect(extension.getType()).andReturn("test.extension"); extension.export(uri, null, factory, loader); EasyMock.expectLastCall(); EasyMock.replay(extension); managementService.export(uri, null, factory, loader); managementService.setExtensions(Collections.singletonList(extension)); EasyMock.verify(extension); } public void testInstanceRegistration() throws Exception { Object instance = new Object(); ManagementExtension extension = EasyMock.createMock(ManagementExtension.class); EasyMock.expect(extension.getType()).andReturn("test.extension"); extension.export("name", "group", "desc", instance); EasyMock.expectLastCall(); EasyMock.replay(extension); managementService.setExtensions(Collections.singletonList(extension)); managementService.export("name", "group", "desc", instance); EasyMock.verify(extension); } public void testInstanceRemove() throws Exception { Object instance = new Object(); ManagementExtension extension = EasyMock.createMock(ManagementExtension.class); EasyMock.expect(extension.getType()).andReturn("test.extension"); extension.export("name", "group", "desc", instance); EasyMock.expectLastCall(); extension.remove("name", "group"); EasyMock.expectLastCall(); EasyMock.replay(extension); managementService.setExtensions(Collections.singletonList(extension)); managementService.export("name", "group", "desc", instance); managementService.remove("name", "group"); EasyMock.verify(extension); } public void testDelayedInstanceRegistration() throws Exception { Object instance = new Object(); ManagementExtension extension = EasyMock.createMock(ManagementExtension.class); EasyMock.expect(extension.getType()).andReturn("test.extension"); extension.export("name", "group", "desc", instance); EasyMock.expectLastCall(); EasyMock.replay(extension); managementService.export("name", "group", "desc", instance); managementService.setExtensions(Collections.singletonList(extension)); EasyMock.verify(extension); } }
[ "jmarino@83866bfc-822f-0410-aa35-bd5043b85eaf" ]
jmarino@83866bfc-822f-0410-aa35-bd5043b85eaf
dd26a63b14aba07f4ecc6d30e763a1f3ce043c97
09649412e12bdc15cf61607e881203735cfafa50
/proxies/com/microsoft/bingads/v10/campaignmanagement/GetNegativeKeywordsByEntityIdsResponse.java
7806681a063db4bf931d4e38bb4e7de3ee23bb46
[ "MIT" ]
permissive
yosefarr/BingAds-Java-SDK
cec603b74a921e71c6173ce112caccdf7c1fdbc8
d1c333d0ba5b7e434c85a92c7a80dad0add0d634
refs/heads/master
2021-01-18T15:02:53.945816
2016-03-06T13:18:32
2016-03-06T13:18:32
51,738,651
0
1
null
2016-02-15T07:38:14
2016-02-15T07:38:13
null
UTF-8
Java
false
false
2,670
java
package com.microsoft.bingads.v10.campaignmanagement; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; /** * <p>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="EntityNegativeKeywords" type="{https://bingads.microsoft.com/CampaignManagement/v10}ArrayOfEntityNegativeKeyword" minOccurs="0"/> * &lt;element name="PartialErrors" type="{https://bingads.microsoft.com/CampaignManagement/v10}ArrayOfBatchError" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "entityNegativeKeywords", "partialErrors" }) @XmlRootElement(name = "GetNegativeKeywordsByEntityIdsResponse") public class GetNegativeKeywordsByEntityIdsResponse { @XmlElement(name = "EntityNegativeKeywords", nillable = true) protected ArrayOfEntityNegativeKeyword entityNegativeKeywords; @XmlElement(name = "PartialErrors", nillable = true) protected ArrayOfBatchError partialErrors; /** * Gets the value of the entityNegativeKeywords property. * * @return * possible object is * {@link ArrayOfEntityNegativeKeyword } * */ public ArrayOfEntityNegativeKeyword getEntityNegativeKeywords() { return entityNegativeKeywords; } /** * Sets the value of the entityNegativeKeywords property. * * @param value * allowed object is * {@link ArrayOfEntityNegativeKeyword } * */ public void setEntityNegativeKeywords(ArrayOfEntityNegativeKeyword value) { this.entityNegativeKeywords = value; } /** * Gets the value of the partialErrors property. * * @return * possible object is * {@link ArrayOfBatchError } * */ public ArrayOfBatchError getPartialErrors() { return partialErrors; } /** * Sets the value of the partialErrors property. * * @param value * allowed object is * {@link ArrayOfBatchError } * */ public void setPartialErrors(ArrayOfBatchError value) { this.partialErrors = value; } }
[ "jiaj@microsoft.com" ]
jiaj@microsoft.com
9d87295e88917fb6043f4d31b6baa44637644afa
ca4ca5b7e090f1320b5265bde46fda11e2fde119
/app/src/androidTest/java/com/svafvel/software/production/mylistview/ExampleInstrumentedTest.java
d642d5fa0f70288a282ce39407f51cec8f51068e
[]
no_license
roindeyal/LatihanListViewAndroid
0643147913b6d58513a8de20c554bd44a37c7f6f
1701dc869d15110c7a5a376aa7b25ac1c98141fa
refs/heads/master
2020-09-09T06:01:42.645362
2019-11-15T02:49:15
2019-11-15T02:49:15
221,364,606
0
0
null
null
null
null
UTF-8
Java
false
false
800
java
package com.svafvel.software.production.mylistview; import android.content.Context; import androidx.test.platform.app.InstrumentationRegistry; import androidx.test.ext.junit.runners.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.*; /** * Instrumented test, which will execute on an Android device. * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test public void useAppContext() { // Context of the app under test. Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); assertEquals("com.svafvel.software.production.mylistview", appContext.getPackageName()); } }
[ "root@localhost.localdomain" ]
root@localhost.localdomain
dfda055d1eaf751afdb850670cbb8e17a4b4bc91
88aa50ea5d8f31600fa924d2c50b8432cfda38b8
/app/src/main/java/xyz/hanks/numberanimation/MainActivity.java
ef5843b9b4c5d2fdaff6bc93ecc7d6be5e13d047
[ "MIT" ]
permissive
mirshahbazi/NumberAnimation
d0f2e9a54e8511e092bdf6b00e1a1813cac917b7
6152994caac9532093a094782747c83c3bd44cd6
refs/heads/master
2020-09-15T20:35:18.106060
2016-09-01T16:20:43
2016-09-01T16:20:43
null
0
0
null
null
null
null
UTF-8
Java
false
false
535
java
package xyz.hanks.numberanimation; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.View; import xyz.hanks.library.NumberView; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } public void anim(View view) { if (view instanceof NumberView) { ((NumberView) view).play(); } } }
[ "zhangyuhan2014@gmail.com" ]
zhangyuhan2014@gmail.com
3d1b2d03867e2592338295d71c27e80130923db3
27d1110466fffc1b1df73c54f9a1d256445407dc
/[0389][Find the Difference]/src/Solution.java
b2fcd9ae5ba739d03bc2247be213c4008c1adf53
[]
no_license
zhaochao12321/leetcode
7927d159531399867ea7e279cf0efc92b2e254b9
8048dbcd64a62b551fdcb3877b4997933ef926d6
refs/heads/master
2020-06-14T00:44:09.407803
2019-08-07T06:53:48
2019-08-07T06:53:48
194,839,610
2
0
null
2019-07-02T10:11:45
2019-07-02T10:11:45
null
UTF-8
Java
false
false
1,212
java
import java.util.NoSuchElementException; /** * @author: wangjunchao(王俊超) * @time: 2019-06-30 13:53 **/ public class Solution { /** * <pre> * Given two strings s and t which consist of only lowercase letters. * * String t is generated by random shuffling string s and then add one * more letter at a random position. * * Find the letter that was added in t. * * Example: * * Input: * s = "abcd" * t = "abcde" * * Output: * e * * Explanation: * 'e' is the letter that was added. * </pre> * @param s * @param t * @return */ public char findTheDifference(String s, String t) { // 假设输入都是合法的 int[] chars = new int[26]; for (int i = 0; i < s.length(); i++) { chars[s.charAt(i) - 'a']++; } for (int i = 0; i < t.length(); i++) { chars[t.charAt(i) - 'a']--; } for (int i = 0; i < chars.length; i++) { if (chars[i] < 0) { return (char) ('a' + i); } } throw new NoSuchElementException("could not find the difference"); } }
[ "shining-glory@qq.com" ]
shining-glory@qq.com
4f28d367ac98c4e318208fcf2c8c06633f6697cb
48f3f62c0dcd97820e28729385ec8e467bb6f39d
/src/common/util/GridTreeUtil.java
6f3174153e3fbf08beb2bc950d832bbc2a41da98
[]
no_license
renjie120/rep
d78277628fb1c45ffbc20dde9a73edd6f6589ad1
d1c47353d60b0592229b7294c1283398e5934e0d
refs/heads/master
2021-01-23T18:11:41.311688
2014-06-17T10:46:00
2014-06-17T10:46:00
19,456,996
0
1
null
null
null
null
UTF-8
Java
false
false
7,641
java
package common.util; import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import javax.servlet.http.HttpServletRequest; import net.sf.json.JSONArray; import net.sf.json.JSONObject; import org.apache.commons.beanutils.BeanUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import querygridtree.data.TaskVO; /** * 表格树工具类. * connect me:419723443@qq.com */ public class GridTreeUtil { protected static Log log = LogFactory.getLog("GridTreeUtil"); /** * 取得起始行和终止行. * @param request 请求 * @param allCount 总行数 * @param pageSize 每页数目 * @return 整型数组 */ public static int[] getStartAndEndInfo(HttpServletRequest request, int allCount, int pageSize) { //默认当前的页数是1 int page = 1; //默认的分页行数就是传入的每页行数 int limit = pageSize; //新的起始位置 int newStart = 0; int newEnd = 0; //在点击翻页按钮的时候,会传递gtstart参数到后台. if (request.getParameter("gtpage") != null) { limit = Integer.parseInt(request.getParameter("gtlimit")); page = Integer.parseInt(request.getParameter("gtpage")); } //否则就说明是第一次进入页面进行的查询 else { if (request.getParameter("gtlimit") != null) limit = Integer.parseInt(request.getParameter("gtlimit")); } request.setAttribute("gtlimit", limit); request.setAttribute("gtpage", page); request.setAttribute("gtcount", allCount); //如果是第一次显示,而且要显示分页栏,就说明只显示第一页之间的数据 if (limit != -1) { return new int[] { (page - 1) * limit + 1, (page * limit + 1) > allCount + 1 ? allCount + 1 : (page * limit + 1) }; } //说明是第一次显示页面,而且不用显示分页栏,就是要返回全部的数据. else { return new int[] { 1, allCount + 1 }; } } public static void main(String[] a) { List list = new ArrayList(); getJsonStr(list); } public static String getJsonStr(List list) { JSONArray jsonArr = new JSONArray(); for (int i = 0; i < list.size(); i++) { jsonArr.add(list.get(i)); } String ans = jsonArr.toString(); return ans; } /** * 形成json字符串,返回到前台即可. * @param list * @param rowCount * @param pageSize */ public static String getJsonStr(List list, HttpServletRequest request) { StringBuffer buf = new StringBuffer(); String idColumn = request.getParameter("idColumn"); String parentColumn = request.getParameter("parentColumn"); String analyzeAtServer = request.getParameter("analyze"); if ("false".equals(analyzeAtServer)) { return "{total:" + request.getAttribute("gtcount") + ",page:" + request.getAttribute("gtpage") + ",data:" + getJsonStr(list) + "}"; } try { JSONObject jsonObj = new JSONObject(); JSONArray jsonArr = new JSONArray(); JSONObject idToNodeMap = new JSONObject(); //节点id到节点的映射 //Map idToNodeMap = new HashMap(); //节点的父亲节点映射 JSONObject idToParent = new JSONObject(); //父亲节点到孩子节点的映射 JSONObject parentToChildMap = new JSONObject(); JSONArray parents = new JSONArray(); //存储应该显示在第一级节点的节点id的集合 JSONArray firstLevelNodes = new JSONArray(); //用来存储那些不存在的父亲节点的id的集合 JSONArray notExistsParent = new JSONArray(); //循环对每个节点进行处理 for (int i = 0; i < list.size(); i++) { Object obj = list.get(i); jsonArr.add(obj); String nodeStr = JsonUtil.object2json(obj); String id; id = "_node" + BeanUtils.getProperty(obj, idColumn); String parent = "_node" + BeanUtils.getProperty(obj, parentColumn); //添加id到节点json串的映射 //idToNodeMap.put(id, nodeStr); idToNodeMap.put(id, nodeStr); idToParent.put(id, parent); if (!parents.contains(parent)) { parents.add(parent); } if (parentToChildMap.keySet().contains(parent)) { JSONArray childs = (JSONArray) parentToChildMap.get(parent); childs.add(id); parentToChildMap.put(parent, childs); } else { JSONArray childs = new JSONArray(); childs.add(id); parentToChildMap.put(parent, childs); } } for (int i = 0; i < parents.size(); i++) { Object aParent = parents.get(i); //如果父亲节点不是在id映射中存在的节点就说明应该显示在第一层位置的节点的父亲们!! if (!idToNodeMap.keySet().contains(aParent)) { JSONArray childs = (JSONArray) parentToChildMap .get(aParent); firstLevelNodes.addAll(childs); //如果不在节点中,就说明这个父亲节点是不存在的,应该从parents中删除 notExistsParent.add(aParent); } } //在父亲节点集合中删除不存在的那些节点 for (int i = 0; i < notExistsParent.size(); i++) { parents.remove(notExistsParent.get(i)); } long a = System.currentTimeMillis(); jsonObj.put("allCount", request.getAttribute("gtcount")); jsonObj.put("pageSize", request.getAttribute("gtlimit")); jsonObj.put("currentPage", request.getAttribute("gtpage")); jsonObj.put("parents", parents); jsonObj.put("idToParent", idToParent); jsonObj.put("idToNodeMap", idToNodeMap); jsonObj.put("parentToChildMap", parentToChildMap); jsonObj.put("firstLevelNodes", firstLevelNodes); jsonObj.put("data", jsonArr); buf.append(jsonObj.toString()); long b = System.currentTimeMillis(); } catch (IllegalAccessException e) { log.error("GridTreeUtil--getJsonStr--1:", e); } catch (InvocationTargetException e) { log.error("GridTreeUtil--getJsonStr--1:", e); } catch (Exception e) { log.error("GridTreeUtil--getJsonStr--1:", e); } return buf.toString(); } public static String getTaskJsonStr(List<TaskVO> list){ StringBuffer buf = new StringBuffer(512); buf.append("["); if(list.size()>0){ int flag = 0; Iterator<TaskVO> it = list.iterator(); while(it.hasNext()){ TaskVO vo = it.next(); buf.append("{").append("'taskid':'").append(vo.getTaskId()); //描述 buf.append("','description':'").append(vo.getDescription()); //项目名称 buf.append("','projname':'").append(vo.getProjectName()); //所处节点 buf.append("','nodename':'").append(vo.getNodeName()); //时间管理 buf.append("','encharge':'").append(vo.getEncharge()); //责任人 buf.append("','approved':'").append(vo.getApproved()); //关注焦点 buf.append("','focus':'").append(""); //备注 buf.append("','wremark':'").append(vo.getWremark()); //计划开始 buf.append("','palnstart':'").append(vo.getPalnstart()); //计划完成 buf.append("','planend':'").append(vo.getPlanend()); //完成标示 buf.append("','taskkeyword':'").append(vo.getTaskkeyword()); //工时估算 buf.append("','attention':'").append(vo.getAttention()); //费用估算 buf.append("','subjoincost':'").append(vo.getSubCost()); //父亲任务节点 buf.append("','parenttid':'").append(vo.getParenttid()); //路径 buf.append("','parentPath':'").append(vo.getTaskParentPath()); //部门 buf.append("','department':'").append(vo.getDepartment()); //父亲任务节点 buf.append("','isLeaf':'").append(vo.getIsParent()); buf.append("'},"); } //删除最后一个逗号 buf.deleteCharAt(buf.length()-1); } buf.append("]"); return buf.toString(); } }
[ "lishuiqing110@163.com" ]
lishuiqing110@163.com
aabf545cd02d491dc0700f4c60abf0dc999f6b6a
c9b10cd8d2e75dc60ad73923638478e0ce047215
/JAVA/Practice_Chapter08(오버로딩, 생성자)/src/sec04_exam_thismethod/Car.java
ca2b9ce8fd0c2ff38e88469adb0e0433610f12b3
[]
no_license
UmJaeJeong/JAVA
d320d4eeda696fe6386a4b1e6178c1eabf5e1436
57f841c8bfa4349c11461d4d147752799dbbcb64
refs/heads/master
2021-06-12T00:37:38.044653
2021-04-13T08:20:43
2021-04-13T08:20:43
162,420,043
0
0
null
null
null
null
UHC
Java
false
false
1,083
java
package sec04_exam_thismethod; public class Car { String color; String gearType; int door; //생성자 //아무런 생성자가 선언되어 있지 않다면, 컴파일러가 알아서 기본생성자를 //추가해준다는 것을 명심하자 public Car() { this("white","auto",4); System.out.println("기본생성자 호출"); } public Car(String color) { this(color,"auto",4); System.out.println("매개변수가 있는 생성자 호출"); } public Car(String color, String gearType) { this(color,gearType,4); System.out.println("매개변수가 있는 생성자 호출"); } //매개변수가 있는 생성자 public Car(String color, String gearType, int door) { this.color = color; this.gearType = gearType; this.door = door; System.out.println("매개변수가 있는 생성자 호출"); } //이노테이션(annotation) : 컴파일러에게 강하게 체크를하라는 뜻. @Override public String toString() { String str= "색깔 ="+this.color+" 기어타입="+this.gearType+" 문갯수="+this.door; return str; } }
[ "39511137+UmJaeJeong@users.noreply.github.com" ]
39511137+UmJaeJeong@users.noreply.github.com
192ff1da17a98af91de8ccd0d6160854fa55c5dc
7f9760c5526adb67b4b8df913aa836cf8b23ed56
/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/dev/valueset/SystemRestfulInteractionEnum.java
24113f4a80ed09ce8fefe5b3aa847d37c452bf4c
[]
no_license
sallenwilliams/hapi-fhir
4335ab64591b6ff858fcc740e318a88fc317d07b
8e7370500002049d019d64244dbc2a5edb4c511b
refs/heads/master
2021-01-22T15:04:11.238013
2015-01-09T21:15:55
2015-01-09T21:15:55
29,741,317
1
0
null
2015-01-23T16:26:30
2015-01-23T16:26:30
null
UTF-8
Java
false
false
2,771
java
package ca.uhn.fhir.model.dev.valueset; import ca.uhn.fhir.model.api.*; import java.util.HashMap; import java.util.Map; public enum SystemRestfulInteractionEnum { ; /** * Identifier for this Value Set: * http://hl7.org/fhir/vs/system-restful-interaction */ public static final String VALUESET_IDENTIFIER = "http://hl7.org/fhir/vs/system-restful-interaction"; /** * Name for this Value Set: * SystemRestfulInteraction */ public static final String VALUESET_NAME = "SystemRestfulInteraction"; private static Map<String, SystemRestfulInteractionEnum> CODE_TO_ENUM = new HashMap<String, SystemRestfulInteractionEnum>(); private static Map<String, Map<String, SystemRestfulInteractionEnum>> SYSTEM_TO_CODE_TO_ENUM = new HashMap<String, Map<String, SystemRestfulInteractionEnum>>(); private final String myCode; private final String mySystem; static { for (SystemRestfulInteractionEnum next : SystemRestfulInteractionEnum.values()) { CODE_TO_ENUM.put(next.getCode(), next); if (!SYSTEM_TO_CODE_TO_ENUM.containsKey(next.getSystem())) { SYSTEM_TO_CODE_TO_ENUM.put(next.getSystem(), new HashMap<String, SystemRestfulInteractionEnum>()); } SYSTEM_TO_CODE_TO_ENUM.get(next.getSystem()).put(next.getCode(), next); } } /** * Returns the code associated with this enumerated value */ public String getCode() { return myCode; } /** * Returns the code system associated with this enumerated value */ public String getSystem() { return mySystem; } /** * Returns the enumerated value associated with this code */ public SystemRestfulInteractionEnum forCode(String theCode) { SystemRestfulInteractionEnum retVal = CODE_TO_ENUM.get(theCode); return retVal; } /** * Converts codes to their respective enumerated values */ public static final IValueSetEnumBinder<SystemRestfulInteractionEnum> VALUESET_BINDER = new IValueSetEnumBinder<SystemRestfulInteractionEnum>() { @Override public String toCodeString(SystemRestfulInteractionEnum theEnum) { return theEnum.getCode(); } @Override public String toSystemString(SystemRestfulInteractionEnum theEnum) { return theEnum.getSystem(); } @Override public SystemRestfulInteractionEnum fromCodeString(String theCodeString) { return CODE_TO_ENUM.get(theCodeString); } @Override public SystemRestfulInteractionEnum fromCodeString(String theCodeString, String theSystemString) { Map<String, SystemRestfulInteractionEnum> map = SYSTEM_TO_CODE_TO_ENUM.get(theSystemString); if (map == null) { return null; } return map.get(theCodeString); } }; /** * Constructor */ SystemRestfulInteractionEnum(String theCode, String theSystem) { myCode = theCode; mySystem = theSystem; } }
[ "jamesagnew@gmail.com" ]
jamesagnew@gmail.com
db3e72618b8d7ab0a9071e3c4977ba39bc40a021
41f556d51b2ae751b76571648e57d767f9ab80d2
/Algorithms/Java/medium/1405_Longest_Happy_String_[Medium].java
c7e78e1a96782595287adc8eace9ab17de159b1e
[]
no_license
homurax/leetcode
fc8bfc0b5406c25de22fad2875d77328a395dee3
92f169dc46fff5cfccb79153eef2da8714af209d
refs/heads/master
2023-08-31T22:34:53.681488
2023-08-31T03:01:09
2023-08-31T03:01:09
174,257,716
2
0
null
null
null
null
UTF-8
Java
false
false
2,292
java
/** * 1405. Longest Happy String * * * A string is called happy if it does not have any of the strings 'aaa', 'bbb' or 'ccc' as a substring. * * Given three integers a, b and c, return any string s, which satisfies following conditions: * * s is happy and longest possible. * s contains at most a occurrences of the letter 'a', at most b occurrences of the letter 'b' and at most c occurrences of the letter 'c'. * s will only contain 'a', 'b' and 'c' letters. * If there is no such string s return the empty string "". * * * * Example 1: * * Input: a = 1, b = 1, c = 7 * Output: "ccaccbcc" * Explanation: "ccbccacc" would also be a correct answer. * * Example 2: * * Input: a = 2, b = 2, c = 1 * Output: "aabbc" * * Example 3: * * Input: a = 7, b = 1, c = 0 * Output: "aabaa" * Explanation: It's the only correct answer in this case. * * * Constraints: * * 1. 0 <= a, b, c <= 100 * 2. a + b + c > 0 */ public class LongestHappyString { /** * 优先放置剩余最多的 * 如果 prev 放置的两个和当前最多的相同,就放置次最多的 */ public String longestDiverseString(int a, int b, int c) { int[] count = new int[]{a, b, c}; char[] letters = new char[a + b + c]; int index = 0; while (count[0] != 0 || count[1] != 0 || count[2] != 0) { char letter; if (index < 2 || letters[index - 1] != letters[index - 2]) { letter = next(count, ' '); } else { letter = next(count, letters[index - 1]); } if (--count[letter - 'a'] < 0) { break; } letters[index++] = letter; } return new String(letters, 0, index); } private char next(int[] count, char exclude) { char next; if (exclude == 'a') { next = count[1] > count[2] ? 'b' : 'c'; } else if (exclude == 'b') { next = count[0] > count[2] ? 'a' : 'c'; } else if (exclude == 'c') { next = count[0] > count[1] ? 'a' : 'b'; } else { next = count[0] > count[1] ? 'a' : 'b'; next = count[next - 'a'] > count[2] ? next : 'c'; } return next; } }
[ "homuraxenoblade@gmail.com" ]
homuraxenoblade@gmail.com
d086477620d5a55b2a5adf7bbdd101e3df6ad0f7
f58896f88d2d6c35a673c364458aa4909868a5b3
/Java/nacos/nacos-jdk/src/main/java/com/example/nacos/discovery/Main.java
3b19f0578f9fd704bebc50364aced0eea70c9855
[]
permissive
ZQH123196/basic
6b332db5615056a0dd6b9fdbc27e776cce4cca67
32748827321c93eba6cb3c9c9b660037e3392402
refs/heads/master
2023-07-10T22:25:18.857952
2023-06-25T23:17:35
2023-06-25T23:17:35
224,331,045
0
0
MIT
2021-04-22T19:21:33
2019-11-27T02:54:07
Dart
UTF-8
Java
false
false
7,782
java
package com.example.nacos.discovery; import com.alibaba.nacos.api.exception.NacosException; import com.alibaba.nacos.api.naming.NamingFactory; import com.alibaba.nacos.api.naming.NamingService; import com.alibaba.nacos.api.naming.listener.Event; import com.alibaba.nacos.api.naming.listener.EventListener; import com.alibaba.nacos.api.naming.listener.NamingEvent; import com.alibaba.nacos.api.naming.pojo.Instance; import com.alibaba.nacos.client.naming.NacosNamingService; import org.junit.jupiter.api.Test; import java.util.HashMap; import java.util.Map; import java.util.concurrent.CompletionService; import java.util.concurrent.ExecutorCompletionService; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; /** * 注册微服务,serviceName 相当于域名,背后有多个 ip 进行负载均衡 * 注意:一个 naming service 代表一个微服务实例,因此要注册多个实例需要创建多个 name service */ public class Main { String serviceName = "nacos-jdk"; String namingServerAddr = "localhost:8848"; @Test public void basic() throws Exception { NamingService namingService1 = new NacosNamingService(namingServerAddr); namingService1.registerInstance(serviceName, "11.11.11.11", 8999); NamingService namingService2 = new NacosNamingService(namingServerAddr); namingService2.registerInstance(serviceName, "11.11.11.12", 8999); Thread.sleep(1 * 1000); NamingService discovery = new NacosNamingService(namingServerAddr); for (Instance instance : discovery.getAllInstances(serviceName)) { System.out.println(instance); } System.out.println("-------------------------"); /** * 要注销实例 **必须使用注册时使用的客户端进行注销**。 实例是有状态的数据,和客户端是有关联的。用不同的客户端去注销都无法成功删除。 * 就好比你服务运行的好好的,有个小天才来给你删了。那你该不该续回来? * 你调用接口,他会把实例删除掉, 但是心跳还在,还会恢复的。只能使用注册时的客户端进行注销,心跳才会停止。 */ namingService2.deregisterInstance(serviceName, "11.11.11.12", 8999); Thread.sleep(2 * 1000); for (Instance instance : discovery.getAllInstances(serviceName)) { System.out.println(instance); } System.in.read(); } @Test public void cluster() throws Exception { NamingService namingService1 = new NacosNamingService(namingServerAddr); String clusterGz = "gz"; String clusterBj = "bj"; namingService1.registerInstance(serviceName, "11.11.11.11", 8999, clusterGz); NamingService namingService2 = new NacosNamingService(namingServerAddr); namingService2.registerInstance(serviceName, "11.11.11.12", 8999, clusterBj); System.in.read(); } @Test public void meta() throws Exception { NamingService namingService = new NacosNamingService(namingServerAddr); Map<String, String> meta = new HashMap<>(); meta.put("name", "eor"); Instance instance = new Instance(); instance.setIp("11.11.11.11"); instance.setPort(8999); instance.setMetadata(meta); namingService.registerInstance(serviceName, instance); Thread.sleep(2*1000); NamingService discovery = new NacosNamingService(namingServerAddr); System.out.println(discovery.selectOneHealthyInstance(serviceName).getMetadata()); System.in.read(); } /** * 订阅微服务实例的变更 */ @Test public void subscribeServerAlter() throws Exception { NamingService discovery = new NacosNamingService(namingServerAddr); discovery.subscribe(serviceName, new EventListener() { @Override public void onEvent(Event event) { System.out.println(((NamingEvent) event).getServiceName()); for (Instance instance : ((NamingEvent) event).getInstances()) { System.out.println(instance); } System.out.println("-----------------"); } }); NamingService namingService1 = new NacosNamingService(namingServerAddr); namingService1.registerInstance(serviceName, "11.11.11.11", 8999); NamingService namingService2 = new NacosNamingService(namingServerAddr); namingService2.registerInstance(serviceName, "11.11.11.12", 8999); Thread.sleep(2 * 1000); namingService1.deregisterInstance(serviceName, "11.11.11.11", 8999); System.in.read(); } /** * 负载均衡要设置权重 * setWeight(),默认值就是 1,也就是机会均等 * 权重根据负载均衡算法有不同效果,但基本可视为权重越大命中概率越高 */ @Test public void loadBalance() throws Exception { NamingService namingServiceHealthy = new NacosNamingService(namingServerAddr); Instance instanceHealthy = new Instance(); instanceHealthy.setWeight(1); instanceHealthy.setHealthy(true); instanceHealthy.setIp("11.11.11.11"); instanceHealthy.setPort(8999); namingServiceHealthy.registerInstance(serviceName, instanceHealthy); NamingService namingServiceHealthy2 = new NacosNamingService(namingServerAddr); Instance instanceHealthy2 = new Instance(); instanceHealthy2.setWeight(1); instanceHealthy2.setHealthy(true); instanceHealthy2.setIp("11.11.11.12"); instanceHealthy2.setPort(8999); namingServiceHealthy2.registerInstance(serviceName, instanceHealthy2); NamingService namingServiceUnhealthy = new NacosNamingService(namingServerAddr); Instance instanceUnhealthy = new Instance(); instanceUnhealthy.setWeight(1); instanceUnhealthy.setHealthy(false); instanceUnhealthy.setIp("11.11.11.13"); instanceUnhealthy.setPort(8999); namingServiceUnhealthy.registerInstance(serviceName, instanceUnhealthy); // 要让注册中心完成自己的注册工作,模拟等待一下 // 上半部分是注册,下半部分是使用,本来应该是用不同类来实现的 Thread.sleep(2 * 1000); NamingService discoveryService = NamingFactory.createNamingService(namingServerAddr); System.out.println("------全部实例 start------"); for (Instance instance : discoveryService.getAllInstances(serviceName)) { System.out.println(instance); } System.out.println("------全部实例 end------"); System.out.println("------健康实例 start------"); for (Instance instance : discoveryService.selectInstances(serviceName, true)) { System.out.println(instance); } System.out.println("------健康实例 end------"); System.out.println("------负载均衡 start------"); ExecutorService executorService = Executors.newFixedThreadPool(5); CompletionService<?> cs = new ExecutorCompletionService(executorService); Runnable runnable = () -> { try { System.out.println(discoveryService.selectOneHealthyInstance(serviceName)); } catch (NacosException e) { throw new RuntimeException(e); } }; for (int i = 0; i < 10; i++) { cs.submit(runnable, null); } for (int i = 0; i < 10; i++) { cs.take(); } Thread.sleep(2 * 1000); System.out.println("------负载均衡 end------"); System.in.read(); } }
[ "zqh123196@gmail.com" ]
zqh123196@gmail.com
25d59acba1277a784671cd5a234b3307527724a6
9a9f21b2fef372d3d700c8ceb86878a3740fbf63
/src/main/java/alnGenerator/SampleReader.java
c321ce64b19eb63000d2143ceee9107feff89703
[]
no_license
rhnussen/Pipeline-1
b366f04982bc2ffd45e8ddda62519a3d228c944b
c83b03b3eba910c437ec8ac03569bf8f0c0234ba
refs/heads/master
2021-01-18T10:49:48.519536
2013-08-13T22:43:11
2013-08-13T22:43:11
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,298
java
package alnGenerator; import java.io.BufferedReader; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; /** * SampleReaders provide ordered access to the variants described in a VCF file. They're * meant to be used like iterators, but are associated with a VCFReader that stores additional * info regarding the VCF file * @author brendan * */ public class SampleReader { private VCFReader vcfReader; private BufferedReader reader; private String sampleName; private int phase; private int column; private String currentLine = null; public SampleReader(VCFReader vcfReader, String sampleName, int phase) throws IOException { this.vcfReader = vcfReader; this.sampleName = sampleName; if (phase != 0 && phase != 1) { throw new IllegalArgumentException("Invalid phase, must be zero or one (got " + phase + ")"); } this.phase = phase; reader = new BufferedReader(new FileReader(vcfReader.getSourceFile())); column = vcfReader.getColumnForSample(sampleName); advanceToFirstVariant(); } public int getPhase() { return phase; } public String getSampleName() { return sampleName; } /** * Advance current line to the first non-comment line in the vcf file * @throws IOException */ private void advanceToFirstVariant() throws IOException { currentLine = reader.readLine(); while(currentLine != null && currentLine.startsWith("#")) currentLine = reader.readLine(); } /** * Advances the current line until it contains the first variant in the given * contig after or equal to the given position * @param contig * @param pos * @throws IOException */ public void advanceTo(String contig, int pos) throws IOException { String[] toks = currentLine.split("\t"); String curContig = toks[0]; while (currentLine != null && (! curContig.equals(contig))) { currentLine = reader.readLine(); if (currentLine == null) { throw new IllegalArgumentException("Could not find contig " + contig); } toks = currentLine.split("\t"); curContig = toks[0]; } if (currentLine == null) { throw new IllegalArgumentException("Could not find contig " + contig); } String posStr = toks[1]; Integer curPos = Integer.parseInt(posStr); while(currentLine != null && curPos < pos) { currentLine = reader.readLine(); if (currentLine == null) { throw new IllegalArgumentException("Could not find position " + pos + " in contig " + curContig); } toks = currentLine.split("\t"); curContig = toks[0]; if (! curContig.equals(contig)) throw new IllegalArgumentException("Could not find position " + pos + " in contig " + curContig); curPos = Integer.parseInt(toks[1]); } } public Variant getVariant() { if (currentLine == null) return null; String[] toks = currentLine.split("\t"); if (toks.length < 8) throw new IllegalArgumentException("Fewer than 8 columns, this file does not seem to be formatted correctly"); if (toks.length < column) throw new IllegalArgumentException("Not enough columns at this line, only " + toks.length); String contig = toks[0].trim(); Integer pos = Integer.parseInt( toks[1].trim() ); String ref = toks[3]; String altStr = toks[4]; Double quality = Double.parseDouble(toks[5]); String[] altAlleles = altStr.split(","); String formatVals = toks[column]; String[] formatToks = formatVals.split(":"); String GTStr = formatToks[ vcfReader.getFormatCol("GT")]; char gt0 = GTStr.charAt(0); char gt1 = GTStr.charAt(2); String alt0; String alt1; Integer gt0Col = Integer.parseInt(gt0 + ""); Integer gt1Col = Integer.parseInt(gt1 + ""); String primaryAlt = altAlleles[0]; if (primaryAlt.length() != ref.length()) { //Remove initial characters if they are equal and add one to start position if (primaryAlt.charAt(0) == ref.charAt(0)) { primaryAlt = primaryAlt.substring(1); ref = ref.substring(1); if (primaryAlt.length()==0) primaryAlt = ProtoSequence.GAP; altAlleles[0] = primaryAlt; if (ref.length()==0) ref = ProtoSequence.GAP; pos++; } if (altAlleles.length > 1) { throw new IllegalArgumentException("OK, so there are multiple alts at this site, and one of them needs a reassigned position because it's in GaTK-style indel annotation. We can't handle this currently because there are really multiple variants at this position"); } } if (gt0Col == 0) alt0 = ref; else alt0 = altAlleles[gt0Col-1]; if (gt1Col == 0) alt1 = ref; else alt1 = altAlleles[gt1Col-1]; String depthStr = null; Integer depthCol = vcfReader.getFormatCol("AD"); Integer depth = 1; if (depthCol != null) { depthStr = formatToks[ depthCol ]; String[] depthVals = depthStr.split(","); int totDepth = 0; for(int i=0; i<depthVals.length; i++) { totDepth += Integer.parseInt( depthVals[i] ); } depth = totDepth; } Variant var = new Variant(contig, pos, ref, alt0, alt1, quality, depth); return var; } /** * Advance the current line to the next variant * @return True if there is another variant to be read * @throws IOException */ public boolean advance() throws IOException { currentLine = reader.readLine(); return currentLine != null; } }
[ "brendanofallon@fastmail.fm" ]
brendanofallon@fastmail.fm
60374bf6141d38be92ca1d94ec40744a2d563cb1
220ab422ee7e849e6aafbb96bdd017272b80fb5a
/shiro-web-bond/src/main/java/me/imniu/shiro/web/servlet/AuthenticatedServlet.java
5e5048e9aa02a6abce4e7c7d6077c37acf98e71c
[]
no_license
niumoo/frame_shiro
bd1e0c9db88826ffa258ffb82bb081449a9a43a8
79a1214bb7ef69e444221972c9451bde60163c76
refs/heads/master
2021-05-14T15:12:06.202889
2018-04-09T07:36:42
2018-04-09T07:36:42
115,987,042
0
0
null
null
null
null
UTF-8
Java
false
false
954
java
package me.imniu.shiro.web.servlet; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.shiro.SecurityUtils; import org.apache.shiro.subject.Subject; @WebServlet(name = "authenticatedServlet", urlPatterns = "/authenticated") public class AuthenticatedServlet extends HttpServlet { @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { Subject subject = SecurityUtils.getSubject(); if(subject.isAuthenticated()) { req.getRequestDispatcher("/WEB-INF/jsp/authenticated.jsp").forward(req, resp); } else { req.getRequestDispatcher("/WEB-INF/jsp/login.jsp").forward(req, resp); } } }
[ "niumoo@126.com" ]
niumoo@126.com
d7f6a093f029ab7858b397fe60eead02079d0be1
995f73d30450a6dce6bc7145d89344b4ad6e0622
/MATE-20_EMUI_11.0.0/src/main/java/ohos/javax/xml/transform/Transformer.java
9f5f4c6b3ed9e42023357424661680b122736205
[]
no_license
morningblu/HWFramework
0ceb02cbe42585d0169d9b6c4964a41b436039f5
672bb34094b8780806a10ba9b1d21036fd808b8e
refs/heads/master
2023-07-29T05:26:14.603817
2021-09-03T05:23:34
2021-09-03T05:23:34
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,317
java
package ohos.javax.xml.transform; import java.util.Properties; public abstract class Transformer { public abstract void clearParameters(); public abstract ErrorListener getErrorListener(); public abstract Properties getOutputProperties(); public abstract String getOutputProperty(String str) throws IllegalArgumentException; public abstract Object getParameter(String str); public abstract URIResolver getURIResolver(); public abstract void setErrorListener(ErrorListener errorListener) throws IllegalArgumentException; public abstract void setOutputProperties(Properties properties); public abstract void setOutputProperty(String str, String str2) throws IllegalArgumentException; public abstract void setParameter(String str, Object obj); public abstract void setURIResolver(URIResolver uRIResolver); public abstract void transform(Source source, Result result) throws TransformerException; protected Transformer() { } public void reset() { throw new UnsupportedOperationException("This Transformer, \"" + getClass().getName() + "\", does not support the reset functionality. Specification \"" + getClass().getPackage().getSpecificationTitle() + "\" version \"" + getClass().getPackage().getSpecificationVersion() + "\""); } }
[ "dstmath@163.com" ]
dstmath@163.com
ea969b4aa39fac86d4f03d7c79eda7a1370aa29b
d21495a096f18dbeac402e5d29ea5a5ff88d8ca9
/src/net/sourceforge/jrefactory/ast/ASTTryStatement.java
c254bf92f0e9c01917fc1565d6beaeaf055c0a68
[]
no_license
JavaQualitasCorpus/jrefactory-2.9.19
73195aa8c91b2fa6fa18f987c1d0ba586ff28582
b6bfd3921cd7d889ee351ebaca21d4de9b6acf31
refs/heads/master
2023-08-12T08:41:09.402764
2020-06-02T18:01:42
2020-06-02T18:01:42
167,004,945
1
2
null
null
null
null
UTF-8
Java
false
false
2,408
java
/* * Author: Mike Atkinson * * This software has been developed under the copyleft * rules of the GNU General Public License. Please * consult the GNU General Public License for more * details about use and distribution of this software. */ package net.sourceforge.jrefactory.ast; import net.sourceforge.jrefactory.parser.JavaParser; import net.sourceforge.jrefactory.parser.JavaParserVisitor; /** * Statement that catches exceptions * * @author Mike Atkinson * @since jRefactory 2.9.0, created October 16, 2003 */ public class ASTTryStatement extends SimpleNode { private boolean hasCatch; private boolean hasFinally; /** * Constructor for the ASTTryStatement node. * * @param identifier The id of this node (JJTTRYSTATEMENT). */ public ASTTryStatement(int identifier) { super(identifier); } /** * Constructor for the ASTTryStatement node. * * @param parser The JavaParser that created this ASTTryStatement node. * @param identifier The id of this node (JJTTRYSTATEMENT). */ public ASTTryStatement(JavaParser parser, int identifier) { super(parser, identifier); } /** This try statement has <code>catch</code> block. */ public void setHasCatch() { hasCatch = true; } /** This try statement has <code>finally</code> block. */ public void setHasFinally() { hasFinally = true; } /** * Accept the visitor. * * @param visitor An implementation of JavaParserVisitor that processes the ASTTryStatement node. * @param data Some data being passed between the visitor methods. * @return Usually the data parameter (possibly modified). */ public Object jjtAccept(JavaParserVisitor visitor, Object data) { return visitor.visit(this, data); } /** * Does the try statement have a <code>catch</code> block. * * @return <code>true</code> if the try statement has a <code>catch</code> block. */ public boolean hasCatch() { return hasCatch; } /** * Does the try statement have a <code>finally</code> block. * * @return <code>true</code> if the try statement has a <code>finally</code> block. */ public boolean hasFinally() { return hasFinally; } }
[ "taibi@sonar-scheduler.rd.tut.fi" ]
taibi@sonar-scheduler.rd.tut.fi
dee3322c097cc1514bf15af5a2a4ff44b1d5dfe8
3a8ec0c16ce1c613bd10ddcd2e033b112dfcaad1
/src/main/java/com/thetha/security/jwt/JWTFilter.java
d073a22683bde6b7a20651b9cfb3ebc2b6e1938d
[]
no_license
BulkSecurityGeneratorProject/Ruben
624962c2ff4bb8cba4287f3b39a74dcf44fe3838
92d37ba786920fef7b73436065746a032ec19100
refs/heads/master
2022-12-14T11:05:11.579214
2018-04-22T08:14:50
2018-04-22T08:14:50
296,612,853
0
0
null
2020-09-18T12:19:15
2020-09-18T12:19:15
null
UTF-8
Java
false
false
1,800
java
package com.thetha.security.jwt; import org.springframework.security.core.Authentication; import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.util.StringUtils; import org.springframework.web.filter.GenericFilterBean; import javax.servlet.FilterChain; import javax.servlet.ServletException; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import javax.servlet.http.HttpServletRequest; import java.io.IOException; /** * Filters incoming requests and installs a Spring Security principal if a header corresponding to a valid user is * found. */ public class JWTFilter extends GenericFilterBean { private TokenProvider tokenProvider; public JWTFilter(TokenProvider tokenProvider) { this.tokenProvider = tokenProvider; } @Override public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException { HttpServletRequest httpServletRequest = (HttpServletRequest) servletRequest; String jwt = resolveToken(httpServletRequest); if (StringUtils.hasText(jwt) && this.tokenProvider.validateToken(jwt)) { Authentication authentication = this.tokenProvider.getAuthentication(jwt); SecurityContextHolder.getContext().setAuthentication(authentication); } filterChain.doFilter(servletRequest, servletResponse); } private String resolveToken(HttpServletRequest request){ String bearerToken = request.getHeader(JWTConfigurer.AUTHORIZATION_HEADER); if (StringUtils.hasText(bearerToken) && bearerToken.startsWith("Bearer ")) { return bearerToken.substring(7, bearerToken.length()); } return null; } }
[ "jhipster-bot@users.noreply.github.com" ]
jhipster-bot@users.noreply.github.com
8492c60cc3de06373ac981c0069d8ad454c758cf
6dade73ce30f203862b17b87e237deed9a74bf19
/components/identity/org.wso2.carbon.identity.provisioning.connector.sample/src/main/java/org/wso2/carbon/identity/provisioning/connector/sample/SampleProvisioningConnectorFactory.java
382b78da8d1ee7946eec2369249df8d624a19918
[ "Apache-2.0" ]
permissive
dulichan/carbon-identity
296604bd4c1e62a7db02993bab845463d8065e61
f88aeab8b90d51dadb8fe1070bd514476a7f14c4
refs/heads/master
2020-04-05T19:02:41.969924
2015-01-27T04:19:13
2015-01-27T04:19:13
29,897,122
0
0
null
2015-01-27T04:23:28
2015-01-27T04:23:27
null
UTF-8
Java
false
false
2,514
java
/* * Copyright (c) 2005-2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. * * WSO2 Inc. 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.wso2.carbon.identity.provisioning.connector.sample; import java.util.ArrayList; import java.util.List; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.wso2.carbon.identity.application.common.model.Property; import org.wso2.carbon.identity.provisioning.AbstractOutboundProvisioningConnector; import org.wso2.carbon.identity.provisioning.AbstractProvisioningConnectorFactory; import org.wso2.carbon.identity.provisioning.IdentityProvisioningException; /** * * */ public class SampleProvisioningConnectorFactory extends AbstractProvisioningConnectorFactory { private static final Log log = LogFactory.getLog(SampleProvisioningConnectorFactory.class); private static final String SAMPLE = "sample"; @Override /** * */ protected AbstractOutboundProvisioningConnector buildConnector( Property[] provisioningProperties) throws IdentityProvisioningException { SampleProvisioningConnector salesforceConnector = new SampleProvisioningConnector(); salesforceConnector.init(provisioningProperties); if (log.isDebugEnabled()) { log.debug("Salesforce provisioning connector created successfully."); } return salesforceConnector; } @Override /** * */ public String getConnectorType() { return SAMPLE; } @Override public List<Property> getConfigurationProperties() { List<Property> configProperties = new ArrayList<Property>(); Property serverUrl = new Property(); serverUrl.setDisplayName("Server Url"); serverUrl.setName("server-url"); serverUrl .setDescription("Enter value corresponding to the authetication server."); //configProperties. configProperties.add(serverUrl); return configProperties; } }
[ "chamathg@gmail.com" ]
chamathg@gmail.com
31c1eb8001faeca754eaf3a0bb36d944d0f59a25
06ea1e1ec656bb145b3e05b7312aeed3ce9a0be9
/graduation-course/graduation-course-service/src/main/java/com/graduation/education/course/common/req/CourseCategoryViewREQ.java
de58bbc921b4d5e0f071f580c6be55e82b314bd5
[]
no_license
CATTechnology/graduation_parent
11473733372e196ba5390a857d88030faf340b35
be0229f28a56b390a66b8128b4ddd90dca7681aa
refs/heads/master
2023-06-22T09:45:11.603346
2020-04-01T08:18:57
2020-04-01T08:18:57
252,122,429
0
1
null
2023-03-27T22:19:41
2020-04-01T08:55:28
Java
UTF-8
Java
false
false
481
java
package com.graduation.education.course.common.req; import java.io.Serializable; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.experimental.Accessors; /** * 课程分类-查看 * * @author wujing */ @Data @Accessors(chain = true) public class CourseCategoryViewREQ implements Serializable { private static final long serialVersionUID = 1L; /** * 主键 */ @ApiModelProperty(value = "主键", required = true) private Long id; }
[ "2221734739@qq.com" ]
2221734739@qq.com
094e75c8290ae6110fd08d1920e197295676dc52
1c0df66bdc53d84aea6f7aa1f0183cf6f8392ab1
/temp/src/minecraft/net/minecraft/client/renderer/Vector3d.java
46c583bbb92a8796dd46ecc79a802437a118de88
[]
no_license
yuwenyong/Minecraft-1.9-MCP
9b7be179db0d7edeb74865b1a78d5203a5f75d08
bc89baf1fd0b5d422478619e7aba01c0b23bd405
refs/heads/master
2022-05-23T00:52:00.345068
2016-03-11T21:47:32
2016-03-11T21:47:32
null
0
0
null
null
null
null
UTF-8
Java
false
false
272
java
package net.minecraft.client.renderer; public class Vector3d { public double field_181059_a; public double field_181060_b; public double field_181061_c; public Vector3d() { this.field_181059_a = this.field_181060_b = this.field_181061_c = 0.0D; } }
[ "jholley373@yahoo.com" ]
jholley373@yahoo.com
99d31cc27102dcf70f04ee4d08198bb44fb39b88
5a959164902dad87f927d040cb4b243d39b8ebe3
/qafe-business/src/main/java/com/qualogy/qafe/business/integration/java/spring/SpringServiceProcessor.java
ade3805a14295eeda0dbf98f18bfdcd9f3836b0a
[ "Apache-2.0" ]
permissive
JustusM/qafe-platform
0c8bc824d1faaa6021bc0742f26733bf78408606
0ef3b3d1539bcab16ecd6bfe5485d727606fecf1
refs/heads/master
2021-01-15T11:38:04.044561
2014-09-25T09:20:38
2014-09-25T09:20:38
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,120
java
/** * Copyright 2008-2014 Qualogy Solutions B.V. * * 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.qualogy.qafe.business.integration.java.spring; import java.lang.reflect.InvocationTargetException; import java.util.List; import java.util.Map; import java.util.logging.Logger; import com.qualogy.qafe.bind.core.application.ApplicationContext; import com.qualogy.qafe.bind.core.messages.HasMessage; import com.qualogy.qafe.bind.integration.service.Method; import com.qualogy.qafe.bind.integration.service.Service; import com.qualogy.qafe.bind.resource.SpringBeanResource; import com.qualogy.qafe.business.integration.adapter.AdaptedToService; import com.qualogy.qafe.business.integration.filter.Filters; import com.qualogy.qafe.business.integration.java.JavaServiceProcessor; import com.qualogy.qafe.business.resource.ResourcePool; import com.qualogy.qafe.business.resource.java.spring.SpringContext; import com.qualogy.qafe.core.datastore.DataIdentifier; import com.qualogy.qafe.core.errorhandling.ExternalException; import com.qualogy.qafe.core.framework.business.UnableToProcessException; public class SpringServiceProcessor extends JavaServiceProcessor { public final static Logger logger = Logger.getLogger(SpringServiceProcessor.class.getName()); @Override protected Object execute(ApplicationContext context, Service service, Method method, Map paramsIn, Filters filters, DataIdentifier dataId) throws ExternalException { if (paramsIn == null) { throw new IllegalArgumentException("expecting a non-null paramsIn list"); } //1. get instance if ((service.getResourceRef() == null) || (service.getResourceRef().getRef() == null) || !(service.getResourceRef().getRef() instanceof SpringBeanResource)) { throw new IllegalArgumentException("resource 'spring' must be set"); } String beanRef = service.getResourceRef().getRef().getId(); String methodName = method.getName(); SpringContext resource = (SpringContext)ResourcePool.getInstance().get(context.getId(), service.getResourceRef().getRef().getId()); //2. determine param types and names AdaptedToService methodParams[] = filterMethodParams(paramsIn); Class[] parameterClasses = new Class[methodParams.length]; Object[] parameters = new Object[methodParams.length]; for (int i=0; i<methodParams.length; i++) { AdaptedToService adapted = methodParams[i]; if (adapted != null) { parameters[i] = adapted.getValue(); parameterClasses[i] = adapted.getClazz(); } } //3. execute method return executeMethod(resource, beanRef, methodName, parameterClasses, parameters, context); } private Object executeMethod(SpringContext resource, String beanRef, String methodName, Class[] parameterClasses, Object[] parameters, ApplicationContext context) throws ExternalException { Object result = null; try { Object instance = resource.getBean(beanRef); result = resource.getMethod(instance, methodName, parameterClasses).invoke(instance, parameters); if (instance instanceof HasMessage){ HasMessage hasMessage = (HasMessage)instance; List<String> messages = hasMessage.getMessages(); for(String message: messages){ context.getWarningMessages().add(message); } } } catch(NoSuchMethodException e) { throw new UnableToProcessException(e); } catch(InvocationTargetException e) { throw new ExternalException(e.getCause()); } catch(IllegalAccessException e) { throw new ExternalException(e.getCause()); } return result; } }
[ "rkha@f87ad13a-6d31-43dd-9311-282d20640c02" ]
rkha@f87ad13a-6d31-43dd-9311-282d20640c02
b67f3f1fc4c5f29e9e258b002188d8177477bf0b
710a44b582aae9cbc45ac605286be01533dedf37
/src/main/java/com/mycompany/myapp/web/rest/LibreriaResource.java
35dce95d446e28b1ce2127b3eac26e87eedb7e93
[]
no_license
JuanGimenez/libreria
7180da909b012be6da65f3a9f2f34e522b4962aa
c7baa2ecda7731edb289a099ac06f38be906751b
refs/heads/master
2022-12-16T12:04:54.512266
2017-12-19T12:27:45
2017-12-19T12:27:45
114,761,677
0
1
null
2020-09-18T15:58:40
2017-12-19T12:17:30
Java
UTF-8
Java
false
false
4,581
java
package com.mycompany.myapp.web.rest; import com.codahale.metrics.annotation.Timed; import com.mycompany.myapp.domain.Libreria; import com.mycompany.myapp.repository.LibreriaRepository; import com.mycompany.myapp.web.rest.errors.BadRequestAlertException; import com.mycompany.myapp.web.rest.util.HeaderUtil; import io.github.jhipster.web.util.ResponseUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; import javax.validation.Valid; import java.net.URI; import java.net.URISyntaxException; import java.util.List; import java.util.Optional; /** * REST controller for managing Libreria. */ @RestController @RequestMapping("/api") public class LibreriaResource { private final Logger log = LoggerFactory.getLogger(LibreriaResource.class); private static final String ENTITY_NAME = "libreria"; private final LibreriaRepository libreriaRepository; public LibreriaResource(LibreriaRepository libreriaRepository) { this.libreriaRepository = libreriaRepository; } /** * POST /librerias : Create a new libreria. * * @param libreria the libreria to create * @return the ResponseEntity with status 201 (Created) and with body the new libreria, or with status 400 (Bad Request) if the libreria has already an ID * @throws URISyntaxException if the Location URI syntax is incorrect */ @PostMapping("/librerias") @Timed public ResponseEntity<Libreria> createLibreria(@Valid @RequestBody Libreria libreria) throws URISyntaxException { log.debug("REST request to save Libreria : {}", libreria); if (libreria.getId() != null) { throw new BadRequestAlertException("A new libreria cannot already have an ID", ENTITY_NAME, "idexists"); } Libreria result = libreriaRepository.save(libreria); return ResponseEntity.created(new URI("/api/librerias/" + result.getId())) .headers(HeaderUtil.createEntityCreationAlert(ENTITY_NAME, result.getId().toString())) .body(result); } /** * PUT /librerias : Updates an existing libreria. * * @param libreria the libreria to update * @return the ResponseEntity with status 200 (OK) and with body the updated libreria, * or with status 400 (Bad Request) if the libreria is not valid, * or with status 500 (Internal Server Error) if the libreria couldn't be updated * @throws URISyntaxException if the Location URI syntax is incorrect */ @PutMapping("/librerias") @Timed public ResponseEntity<Libreria> updateLibreria(@Valid @RequestBody Libreria libreria) throws URISyntaxException { log.debug("REST request to update Libreria : {}", libreria); if (libreria.getId() == null) { return createLibreria(libreria); } Libreria result = libreriaRepository.save(libreria); return ResponseEntity.ok() .headers(HeaderUtil.createEntityUpdateAlert(ENTITY_NAME, libreria.getId().toString())) .body(result); } /** * GET /librerias : get all the librerias. * * @return the ResponseEntity with status 200 (OK) and the list of librerias in body */ @GetMapping("/librerias") @Timed public List<Libreria> getAllLibrerias() { log.debug("REST request to get all Librerias"); return libreriaRepository.findAll(); } /** * GET /librerias/:id : get the "id" libreria. * * @param id the id of the libreria to retrieve * @return the ResponseEntity with status 200 (OK) and with body the libreria, or with status 404 (Not Found) */ @GetMapping("/librerias/{id}") @Timed public ResponseEntity<Libreria> getLibreria(@PathVariable Long id) { log.debug("REST request to get Libreria : {}", id); Libreria libreria = libreriaRepository.findOne(id); return ResponseUtil.wrapOrNotFound(Optional.ofNullable(libreria)); } /** * DELETE /librerias/:id : delete the "id" libreria. * * @param id the id of the libreria to delete * @return the ResponseEntity with status 200 (OK) */ @DeleteMapping("/librerias/{id}") @Timed public ResponseEntity<Void> deleteLibreria(@PathVariable Long id) { log.debug("REST request to delete Libreria : {}", id); libreriaRepository.delete(id); return ResponseEntity.ok().headers(HeaderUtil.createEntityDeletionAlert(ENTITY_NAME, id.toString())).build(); } }
[ "jhipster-bot@users.noreply.github.com" ]
jhipster-bot@users.noreply.github.com
8b2e7a8623d226cbf40bbbab6945ecb2abe0b442
9e59323d4d79cfa2f07091fb4578ed416a4296c2
/ejbtest/v3/src/main/org/ejbtest/jpa/pack/cfgxmlpar/Morito.java
b3cd33e7d670e4d3730ad3551bf2912e743f6f2d
[]
no_license
devlanguage/JavaEE
57d5a29c6335cf3b2e4687ba159335d4dc757583
251fb4be5292a8171a29493256614b63ccae7581
refs/heads/master
2020-03-28T07:30:02.260551
2015-12-23T12:59:53
2015-12-23T12:59:53
null
0
0
null
null
null
null
UTF-8
Java
false
false
544
java
//$Id: Morito.java,v 1.1 2015/06/30 06:43:20 ygong Exp $ package org.ejbtest.jpa.pack.cfgxmlpar; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; /** * @author Emmanuel Bernard */ @Entity public class Morito { private Integer id; private String power; @Id @GeneratedValue public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getPower() { return power; } public void setPower(String power) { this.power = power; } }
[ "emerson_gong@hotmail.com" ]
emerson_gong@hotmail.com
81a246a69fba2b2ba760703f69b0d22f1908214e
48e835e6f176a8ac9ae3ca718e8922891f1e5a18
/benchmark/test/io/debezium/time/TemporalsTest.java
13cb938c57588eaaca1fa7e79bfaf8918e99cd3b
[]
no_license
STAMP-project/dspot-experiments
f2c7a639d6616ae0adfc491b4cb4eefcb83d04e5
121487e65cdce6988081b67f21bbc6731354a47f
refs/heads/master
2023-02-07T14:40:12.919811
2019-11-06T07:17:09
2019-11-06T07:17:09
75,710,758
14
19
null
2023-01-26T23:57:41
2016-12-06T08:27:42
null
UTF-8
Java
false
false
1,203
java
/** * Copyright Debezium Authors. * * Licensed under the Apache Software License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0 */ package io.debezium.time; import java.time.Duration; import org.junit.Test; /** * Unit test for {@code Temporals}. * * @author Gunnar Morling */ public class TemporalsTest { @Test public void maxHandlesSameUnit() { Duration hundredMillis = Duration.ofMillis(100); Duration thousandMillis = Duration.ofMillis(1000); assertThat(Temporals.max(hundredMillis, thousandMillis)).isEqualTo(thousandMillis); } @Test public void maxHandlesDifferentUnits() { Duration sixtyOneMinutes = Duration.ofMinutes(61); Duration oneHour = Duration.ofHours(1); assertThat(Temporals.max(sixtyOneMinutes, oneHour)).isEqualTo(sixtyOneMinutes); } @Test public void maxHandlesEqualValue() { Duration oneMilli = Duration.ofMillis(1); Duration oneMillionNanos = Duration.ofNanos(1000000); assertThat(Temporals.max(oneMilli, oneMillionNanos)).isEqualTo(oneMilli); assertThat(Temporals.max(oneMilli, oneMillionNanos)).isEqualTo(oneMillionNanos); } }
[ "benjamin.danglot@inria.fr" ]
benjamin.danglot@inria.fr
62dc6cad07b0c46c533e9b79ffb564d12ed9be5b
c885ef92397be9d54b87741f01557f61d3f794f3
/results/JacksonDatabind-111/com.fasterxml.jackson.databind.deser.impl.SetterlessProperty/BBC-F0-opt-90/tests/19/com/fasterxml/jackson/databind/deser/impl/SetterlessProperty_ESTest.java
b1c859f5dde0343dc85166d3c6957ed94bd39ed4
[ "CC-BY-4.0", "MIT" ]
permissive
pderakhshanfar/EMSE-BBC-experiment
f60ac5f7664dd9a85f755a00a57ec12c7551e8c6
fea1a92c2e7ba7080b8529e2052259c9b697bbda
refs/heads/main
2022-11-25T00:39:58.983828
2022-04-12T16:04:26
2022-04-12T16:04:26
309,335,889
0
1
null
2021-11-05T11:18:43
2020-11-02T10:30:38
null
UTF-8
Java
false
false
3,721
java
/* * This file was automatically generated by EvoSuite * Thu Oct 21 13:24:22 GMT 2021 */ package com.fasterxml.jackson.databind.deser.impl; import org.junit.Test; import static org.junit.Assert.*; import static org.evosuite.shaded.org.mockito.Mockito.*; import static org.evosuite.runtime.EvoAssertions.*; import com.fasterxml.jackson.core.JsonFactory; import com.fasterxml.jackson.databind.JavaType; import com.fasterxml.jackson.databind.JsonDeserializer; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectReader; import com.fasterxml.jackson.databind.PropertyName; import com.fasterxml.jackson.databind.cfg.MapperConfig; import com.fasterxml.jackson.databind.deser.impl.SetterlessProperty; import com.fasterxml.jackson.databind.introspect.AnnotatedClass; import com.fasterxml.jackson.databind.introspect.BasicBeanDescription; import com.fasterxml.jackson.databind.introspect.ObjectIdInfo; import com.fasterxml.jackson.databind.introspect.POJOPropertiesCollector; import com.fasterxml.jackson.databind.jsontype.TypeIdResolver; import org.evosuite.runtime.EvoRunner; import org.evosuite.runtime.EvoRunnerParameters; import org.evosuite.runtime.ViolatedAssumptionAnswer; import org.junit.runner.RunWith; @RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true) public class SetterlessProperty_ESTest extends SetterlessProperty_ESTest_scaffolding { @Test(timeout = 4000) public void test0() throws Throwable { JsonDeserializer<TypeIdResolver> jsonDeserializer0 = (JsonDeserializer<TypeIdResolver>) mock(JsonDeserializer.class, new ViolatedAssumptionAnswer()); SetterlessProperty setterlessProperty0 = null; try { setterlessProperty0 = new SetterlessProperty((SetterlessProperty) null, jsonDeserializer0, jsonDeserializer0); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // verifyException("com.fasterxml.jackson.databind.introspect.ConcreteBeanPropertyBase", e); } } @Test(timeout = 4000) public void test1() throws Throwable { PropertyName propertyName0 = PropertyName.construct("", "Y,,s\"l)2h0~N"); SetterlessProperty setterlessProperty0 = null; try { setterlessProperty0 = new SetterlessProperty((SetterlessProperty) null, propertyName0); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // verifyException("com.fasterxml.jackson.databind.introspect.ConcreteBeanPropertyBase", e); } } @Test(timeout = 4000) public void test2() throws Throwable { POJOPropertiesCollector pOJOPropertiesCollector0 = mock(POJOPropertiesCollector.class, new ViolatedAssumptionAnswer()); doReturn((AnnotatedClass) null).when(pOJOPropertiesCollector0).getClassDef(); doReturn((MapperConfig) null).when(pOJOPropertiesCollector0).getConfig(); doReturn((ObjectIdInfo) null).when(pOJOPropertiesCollector0).getObjectIdInfo(); doReturn((JavaType) null).when(pOJOPropertiesCollector0).getType(); BasicBeanDescription basicBeanDescription0 = BasicBeanDescription.forDeserialization(pOJOPropertiesCollector0); JsonFactory jsonFactory0 = new JsonFactory(); ObjectMapper objectMapper0 = new ObjectMapper(jsonFactory0); ObjectReader objectReader0 = objectMapper0.readerForUpdating(basicBeanDescription0); assertNotNull(objectReader0); } }
[ "pderakhshanfar@serg2.ewi.tudelft.nl" ]
pderakhshanfar@serg2.ewi.tudelft.nl
a8595532ff970b2d6d467c28a4e05b6a117eca2a
761cf931ffbc8cda7275beed5735bb8696b5e7ed
/src/main/java/org/g4studio/core/orm/xibatis/common/beans/GetFieldInvoker.java
6a1e988886361b663a6c52dca237afa4dfe78edd
[]
no_license
foreverget/zhyc
669422efb29b46c5255901c857de29aaef59fd05
29cd7bef6e8e56ce5fb47219cfb3d916d01d1cf2
refs/heads/master
2021-01-19T13:44:37.532488
2017-08-21T09:30:11
2017-08-21T09:30:11
100,860,907
0
0
null
null
null
null
UTF-8
Java
false
false
553
java
package org.g4studio.core.orm.xibatis.common.beans; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Field; public class GetFieldInvoker implements Invoker { private Field field; private String name; public GetFieldInvoker(Field field) { this.field = field; this.name = "(" + field.getName() + ")"; } public Object invoke(Object target, Object[] args) throws IllegalAccessException, InvocationTargetException { return field.get(target); } public String getName() { return name; } }
[ "zhangwei@zhang-wei" ]
zhangwei@zhang-wei
40be884d2199e11126d38462a742b3925813b411
ef23d9b833a84ad79a9df816bd3fd1321b09851e
/L2J_SunriseProject_Data/dist/game/data/scripts/handlers/effecthandlers/BlockResurrection.java
00fd7e3f4068020e9233283ebc5334f61c121187
[]
no_license
nascimentolh/JBlueHeart-Source
c05c07137a7a4baf5fe8a793375f1700618ef12c
4179e6a6dbd0f74d614d7cc1ab7eb90ff41af218
refs/heads/master
2022-05-28T22:05:06.858469
2020-04-26T15:22:17
2020-04-26T15:22:17
259,045,356
1
0
null
null
null
null
UTF-8
Java
false
false
1,222
java
/* * Copyright (C) 2004-2013 L2J DataPack * * This file is part of L2J DataPack. * * L2J DataPack 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. * * L2J DataPack 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 handlers.effecthandlers; import l2r.gameserver.model.effects.EffectFlag; import l2r.gameserver.model.effects.EffectTemplate; import l2r.gameserver.model.effects.L2Effect; import l2r.gameserver.model.stats.Env; /** * @author UnAfraid */ public class BlockResurrection extends L2Effect { public BlockResurrection(Env env, EffectTemplate template) { super(env, template); } @Override public int getEffectFlags() { return EffectFlag.BLOCK_RESURRECTION.getMask(); } }
[ "luizh.nnh@gmail.com" ]
luizh.nnh@gmail.com