blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
7
390
content_id
stringlengths
40
40
detected_licenses
sequencelengths
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
sequencelengths
1
1
author_id
stringlengths
1
79
3c3ac6516b1522a88b49899d864850065b1f874d
30472cec0dbe044d52b029530051ab404701687f
/src/main/java/com/nawforce/platform/SObjects/UserAppMenuCustomization.java
893201cff8894002a0dd7c3ba65a40b3870ae7cd
[ "BSD-3-Clause" ]
permissive
madmax983/ApexLink
f8e9dcf8f697ed4e34ddcac353c13bec707f3670
30c989ce2c0098097bfaf586b87b733853913155
refs/heads/master
2020-05-07T16:03:15.046972
2019-04-08T21:08:06
2019-04-08T21:08:06
180,655,963
1
0
null
2019-04-10T20:08:30
2019-04-10T20:08:30
null
UTF-8
Java
false
false
1,909
java
/* [The "BSD licence"] Copyright (c) 2019 Kevin Jones All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package com.nawforce.platform.SObjects; import com.nawforce.platform.System.Id; import com.nawforce.platform.System.Integer; import com.nawforce.platform.System.SObject; import com.nawforce.platform.System.String; @SuppressWarnings("unused") public class UserAppMenuCustomization extends SObject { public Id ApplicationId; public ConnectedApplication Application; public String CurrencyIsoCode; public Id OwnerId; public Group Owner; public Integer SortOrder; }
[ "nawforce@gmail.com" ]
nawforce@gmail.com
e3f6e61a1f8f802f25128a1cc552ee752d8fc5c2
11b26e42f4a95ad20f98d801c438029c3b546724
/framework-core2/src/main/java/cn/newcapec/framework/core/context/Keys.java
1b4feedac161cd1e9225b5eb6bf33aa5080cbbcd
[ "MIT" ]
permissive
3203317/ppp
48a81592feddc102c279affe7ed212b494bcada9
3d60ca71ac3ab4ccd3210fef42f535220cd79447
refs/heads/master
2021-01-17T10:42:47.761033
2016-03-25T14:57:07
2016-03-25T14:57:07
26,523,690
0
1
null
null
null
null
UTF-8
Java
false
false
1,578
java
package cn.newcapec.framework.core.context; public abstract interface Keys { public static final String CONTEXT_PAHT = "contextPath"; public static final String VERSION = "version"; public static final String WEBAPP = "webapp"; public static final String YYYY = "yyyy"; public static final String MM = "mm"; public static final String ID = "ID"; public static final String DEV_MODE = "devMode"; public static final String LANG = "lang"; public static final String USER_ID = "userId"; public static final String ORG_ID = "orgId"; public static final String DEPT_ID = "deptId"; public static final String CUR_DATE = "curDate"; public static final String CUR_DATE_10 = "curDate10"; public static final String CUR_YEAR = "curYear"; public static final String CUR_MONTH = "curMonth"; public static final String CUR_QUARTER = "curQuarter"; public static final String CURRENCY_BITS = "currencyBits"; public static final String CURRENCY_UNIT = "currencyUnit"; public static final String USER = "user"; public static final String USER_NAME = "userName"; public static final String DEPT_NAME = "deptName"; public static final String CORR_NAME = "corrName"; public static final String USER_TYPE = "userType"; public static final String TREE_ROOT_VALUE = "ROOT"; public static final String LOAD_CLAZZ = "loadClass"; public static final String CACHE_MINUTES = "cacheMinutes"; public static final String ORG_NAME = "orgName"; public static final String SEQ_NO = "_SEQ_NO"; public static final String DATA_SOURCE_URL = "dataSource"; }
[ "3203317@qq.com" ]
3203317@qq.com
4caef6f71c32bea1babb96f8bb24481b48e1d2fa
70d0ed72638cadbe19730a3f6b321221b425d872
/android/app/src/main/java/com/mogujie/tt/utils/DateUtil.java
310e2fb7a2beff242de98417ca02fdb69c00eff3
[ "Apache-2.0" ]
permissive
ccfish86/sctalk
0bb4edf5ad3407e8177827b4975a279248d72c88
0ec0cbbba3034c22ba65eca1bbcfa2181f93f296
refs/heads/master
2023-07-23T11:33:05.443159
2023-06-09T07:21:06
2023-06-09T07:21:06
90,029,031
177
102
Apache-2.0
2023-07-05T20:53:30
2017-05-02T12:06:14
Java
UTF-8
Java
false
false
8,527
java
package com.mogujie.tt.utils; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; /** * 主要终于页面时间的转化 * 日期工具类 * @yingmu * */ public class DateUtil { /** * 新版时间展示 聊天页面 * @param mTimeStamp * @return * 【备注】注意时间单位是毫秒 */ public static String getSessionTime(int mTimeStamp) { if (mTimeStamp <= 0) { return null; } String[] weekDays = { "星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六" }; String strDesc = null; SimpleDateFormat formatYear = new SimpleDateFormat("yy/MM/dd"); SimpleDateFormat formatToday = new SimpleDateFormat("HH:mm"); /**消息时间戳*/ long changeTime = (long) mTimeStamp; long messageTimeStamp = changeTime * 1000; /**当前的时间戳*/ long currentTimeStamp =System.currentTimeMillis(); /**获取今天的 0 点时间戳*/ long todayTimeStamp = getTimesmorning(); /**获取 上一周 0点时间戳*/ long rangeWeekStamp = todayTimeStamp - 86400000*6; /**今天的显示 hh:mm (今天星期三) * 昨天 * 星期一 * 星期日 、 星期六、 星期五、星期四 * yy-hh-mm * */ do{ long diff = currentTimeStamp - messageTimeStamp; long diffToday = currentTimeStamp - todayTimeStamp; /**今天之内的*/ if(diff < diffToday){ strDesc = formatToday.format(messageTimeStamp); break; } long diffWeek = currentTimeStamp - rangeWeekStamp; /**最近一周的判断*/ if(diff < diffWeek){ /**昨天零点的时间*/ long yesterday = todayTimeStamp - 86400000; long diffYesterday = currentTimeStamp - yesterday; if(diff < diffYesterday){ strDesc = "昨天"; }else{ Calendar weekCal = Calendar.getInstance(); weekCal.setTimeInMillis(messageTimeStamp); int w = weekCal.get(Calendar.DAY_OF_WEEK) -1; w = w<0?0:w; strDesc = weekDays[w]; } break; } /**年月日显示*/ strDesc = formatYear.format(messageTimeStamp); }while(false); return strDesc; } /** * 获取当天 零点的时间戳【linux】 * @return */ public static long getTimesmorning() { Calendar cal = Calendar.getInstance(); cal.set(Calendar.HOUR_OF_DAY, 0); cal.set(Calendar.SECOND, 0); cal.set(Calendar.MINUTE, 0); cal.set(Calendar.MILLISECOND, 0); return cal.getTimeInMillis(); } public static boolean needDisplayTime(int predateTime, int curdateTime) { long timediff = (curdateTime - predateTime); return (timediff >= 5 * 60 ); } public static String getTimeDiffDesc(Date date) { if (date == null) { return null; } String strDesc = null; Calendar curCalendar = Calendar.getInstance(); Date curDate = new Date(); curCalendar.setTime(curDate); Calendar thenCalendar = Calendar.getInstance(); thenCalendar.setTime(date); String[] weekDays = { "星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六" }; int w = thenCalendar.get(Calendar.DAY_OF_WEEK) - 1; if (w < 0) w = 0; // SimpleDateFormat format = new // SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); Calendar current = Calendar.getInstance(); Calendar today = Calendar.getInstance(); // 今天 today.set(Calendar.YEAR, current.get(Calendar.YEAR)); today.set(Calendar.MONTH, current.get(Calendar.MONTH)); today.set(Calendar.DAY_OF_MONTH, current.get(Calendar.DAY_OF_MONTH)); today.set(Calendar.HOUR_OF_DAY, 0); today.set(Calendar.MINUTE, 0); today.set(Calendar.SECOND, 0); // Date datetoday = today.getTime(); // System.out.println(format.format(datetoday)); Calendar yesterday = Calendar.getInstance(); // 昨天 yesterday.setTime(curDate); yesterday.add(Calendar.DATE, -1); yesterday.set(Calendar.HOUR_OF_DAY, 0); yesterday.set(Calendar.MINUTE, 0); yesterday.set(Calendar.SECOND, 0); // Date dateyestoday = yesterday.getTime(); // System.out.println(format.format(dateyestoday)); Calendar sevendaysago = Calendar.getInstance(); // 7天 sevendaysago.setTime(curDate); sevendaysago.add(Calendar.DATE, -7); sevendaysago.set(Calendar.HOUR_OF_DAY, 0); sevendaysago.set(Calendar.MINUTE, 0); sevendaysago.set(Calendar.SECOND, 0); // Date datesevenago = sevendaysago.getTime(); // System.out.println(format.format(datesevenago)); /* * Date tasktime = yesterday.getTime(); SimpleDateFormat df=new * SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); * System.out.println(df.format(tasktime)); */ int thenMonth = thenCalendar.get(Calendar.MONTH); int thenDay = thenCalendar.get(Calendar.DAY_OF_MONTH); int h = thenCalendar.get(Calendar.HOUR_OF_DAY); int m = thenCalendar.get(Calendar.MINUTE); String sh = "", sm = ""; if (h < 10) sh = "0"; if (m < 10) sm = "0"; if (thenCalendar.after(today))// today { if (h < 6) { strDesc = "凌晨 " + sh + h + ":" + sm + m; } else if (h < 12) { strDesc = "上午 " + sh + h + ":" + sm + m; } else if (h < 13) { strDesc = "下午 " + h + ":" + sm + m; } else if (h < 19) { strDesc = "下午 " + (h - 12) + ":" + sm + m; } else { strDesc = "晚上 " + (h - 12) + ":" + sm + m; } } else if (thenCalendar.before(today) && thenCalendar.after(yesterday)) {// yestoday // System.out.println("yestoday"); if (h < 6) { strDesc = "昨天凌晨 " + sh + h + ":" + sm + m; } else if (h < 12) { strDesc = "昨天上午 " + sh + h + ":" + sm + m; } else if (h < 13) { strDesc = "昨天下午 " + h + ":" + sm + m; } else if (h < 19) { strDesc = "昨天下午 " + (h - 12) + ":" + sm + m; } else { strDesc = "昨天晚上 " + (h - 12) + ":" + sm + m; } } else if (thenCalendar.before(yesterday) && thenCalendar.after(sevendaysago)) {// 2 ~ 7days ago // System.out.println("2~7"); if (h < 6) { strDesc = weekDays[w] + "凌晨 " + sh + h + ":" + sm + m; } else if (h < 12) { strDesc = weekDays[w] + "上午 " + sh + h + ":" + sm + m; } else if (h < 13) { strDesc = weekDays[w] + "下午 " + h + ":" + sm + m; } else if (h < 19) { strDesc = weekDays[w] + "下午 " + (h - 12) + ":" + sm + m; } else { strDesc = weekDays[w] + "晚上 " + (h - 12) + ":" + sm + m; } } else { // System.out.println("7~"); if (h < 6) { strDesc = (thenMonth + 1) + "月" + thenDay + "日" + "凌晨 " + sh + h + ":" + sm + m; } else if (h < 12) { strDesc = (thenMonth + 1) + "月" + thenDay + "日" + "上午 " + sh + h + ":" + sm + m; } else if (h < 13) { strDesc = (thenMonth + 1) + "月" + thenDay + "日" + "下午 " + h + ":" + sm + m; } else if (h < 19) { strDesc = (thenMonth + 1) + "月" + thenDay + "日" + "下午 " + (h - 12) + ":" + sm + m; } else { strDesc = (thenMonth + 1) + "月" + thenDay + "日" + "晚上 " + (h - 12) + ":" + sm + m; } } // System.out.println(strDesc); return strDesc; } }
[ "ccfish@ccfish.net" ]
ccfish@ccfish.net
7abd68c82d0b93572c3e86c4ab46d8d3d5f34d35
4c32f2e91f2c4a2199c09e97c6109a70b301e804
/src/main/java/org/iata/iata/edist/RenderingParameterType.java
05bd4b4b212df89e5894e089862c2bd78cdd016d
[]
no_license
ejohnsonw/ndc-xsd-162
47f7b130b88d5af550a093529fa13a573ec628e0
76d0099233aad0c3d8663cc6e1c2cbf2435986f6
refs/heads/master
2020-12-30T13:28:16.667965
2017-05-14T02:56:01
2017-05-14T02:56:01
91,215,700
0
0
null
2017-05-14T02:47:21
2017-05-14T02:47:21
null
UTF-8
Java
false
false
6,590
java
// // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.7 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2017.05.13 at 10:55:06 PM EDT // package org.iata.iata.edist; 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.XmlAttribute; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlIDREF; import javax.xml.bind.annotation.XmlSeeAlso; import javax.xml.bind.annotation.XmlType; /** * A data type for a Rendering Parameter, typically for XSLT. * * <p>Java class for RenderingParameterType complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="RenderingParameterType"> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="Parameter" maxOccurs="unbounded"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="Name" type="{http://www.iata.org/IATA/EDIST}ShortDescSimpleType"/> * &lt;element name="Value"> * &lt;simpleType> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string"> * &lt;minLength value="1"/> * &lt;/restriction> * &lt;/simpleType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;attGroup ref="{http://www.iata.org/IATA/EDIST}ObjAssociationAttrGroup"/> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "RenderingParameterType", propOrder = { "parameter" }) @XmlSeeAlso({ org.iata.iata.edist.RenderingInstructionsType.Parameters.class }) public class RenderingParameterType { @XmlElement(name = "Parameter", required = true) protected List<RenderingParameterType.Parameter> parameter; @XmlAttribute(name = "refs") @XmlIDREF protected List<Object> refs; /** * Gets the value of the parameter 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 parameter property. * * <p> * For example, to add a new item, do as follows: * <pre> * getParameter().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link RenderingParameterType.Parameter } * * */ public List<RenderingParameterType.Parameter> getParameter() { if (parameter == null) { parameter = new ArrayList<RenderingParameterType.Parameter>(); } return this.parameter; } /** * Gets the value of the refs 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 refs property. * * <p> * For example, to add a new item, do as follows: * <pre> * getRefs().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link Object } * * */ public List<Object> getRefs() { if (refs == null) { refs = new ArrayList<Object>(); } return this.refs; } /** * <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="Name" type="{http://www.iata.org/IATA/EDIST}ShortDescSimpleType"/> * &lt;element name="Value"> * &lt;simpleType> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string"> * &lt;minLength value="1"/> * &lt;/restriction> * &lt;/simpleType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "name", "value" }) public static class Parameter { @XmlElement(name = "Name", required = true) protected String name; @XmlElement(name = "Value", required = true) protected String value; /** * Gets the value of the name property. * * @return * possible object is * {@link String } * */ public String getName() { return name; } /** * Sets the value of the name property. * * @param value * allowed object is * {@link String } * */ public void setName(String value) { this.name = value; } /** * Gets the value of the value property. * * @return * possible object is * {@link String } * */ public String getValue() { return value; } /** * Sets the value of the value property. * * @param value * allowed object is * {@link String } * */ public void setValue(String value) { this.value = value; } } }
[ "ejohnson@ngeosone.com" ]
ejohnson@ngeosone.com
0ece1245b28e8b35c2d884033c241f57a50816bb
6c4025a9290525f6700adf37b811098eab85cba0
/app/src/main/java/com/jzbwlkj/travelletv/retrofit/RetrofitInterface.java
7e9f4811139856979d75b31899632fa1b3da9d62
[]
no_license
gaoyuan117/TravelLetv
5019ea4645f453f8099516383dffadad236c5ddd
b59c281657cc37d24ea32342e3731be5aed45295
refs/heads/master
2021-01-22T04:34:02.124459
2017-03-29T07:24:35
2017-03-29T07:24:35
81,556,148
0
0
null
null
null
null
UTF-8
Java
false
false
3,245
java
package com.jzbwlkj.travelletv.retrofit; import com.jzbwlkj.travelletv.base.HttpResult; import com.jzbwlkj.travelletv.bean.CommonBean; import com.jzbwlkj.travelletv.bean.OrderBean; import com.jzbwlkj.travelletv.bean.login.CashBondBean; import com.jzbwlkj.travelletv.bean.my.ApkBean; import com.jzbwlkj.travelletv.bean.my.BackMoneyBean; import com.jzbwlkj.travelletv.bean.my.BackStateBean; import com.jzbwlkj.travelletv.bean.my.MyWalletBean; import com.jzbwlkj.travelletv.bean.my.UnionBean; import com.jzbwlkj.travelletv.bean.my.WxBean; import java.util.List; import java.util.Map; import okhttp3.MultipartBody; import okhttp3.RequestBody; import okhttp3.ResponseBody; import retrofit2.http.Field; import retrofit2.http.FieldMap; import retrofit2.http.FormUrlEncoded; import retrofit2.http.GET; import retrofit2.http.Multipart; import retrofit2.http.POST; import retrofit2.http.Part; import retrofit2.http.Streaming; import retrofit2.http.Url; import rx.Observable; /** * Created by dn on 2017/2/19. */ public interface RetrofitInterface { @FormUrlEncoded @POST Observable<ResponseBody> post(@Url String url, @FieldMap Map<String, String> maps, @Field("token") String token); @Multipart @POST Observable<ResponseBody> postSingleImg(@Url String url, @Part MultipartBody.Part body, @Part("token") RequestBody tokenBody); @Multipart @POST Observable<ResponseBody> postMultiImg(@Url String url, @Part List<MultipartBody.Part> partList); @Streaming @GET Observable<ResponseBody> downloadFile(@Url String url); @FormUrlEncoded @POST Observable<OrderBean> getOrder(@Url String url, @FieldMap Map<String, String> maps); /** * 获取钱包信息 **/ @FormUrlEncoded @POST("api/User/Mywallet") Observable<HttpResult<MyWalletBean>> getWalletInfo(@FieldMap Map<String, String> maps); /** * 交纳保证金 **/ @FormUrlEncoded @POST("api/User/cashBond") Observable<CommonBean> cashBond(@FieldMap Map<String, String> maps); /** * 获取保证金金额 **/ @FormUrlEncoded @POST("api/User/getBond") Observable<CashBondBean> getBond(@FieldMap Map<String, String> maps); /** * 退还保证金 **/ @FormUrlEncoded @POST("api/User/returnBond") Observable<HttpResult<BackMoneyBean>> backMoney(@FieldMap Map<String, String> maps); /** * 退还保证金的状态 **/ @FormUrlEncoded @POST("api/User/returnBondstatus") Observable<BackStateBean> backState(@FieldMap Map<String, String> maps); /** * 退还保证金的状态 **/ @FormUrlEncoded @POST("api/Wechat/wechpay") Observable<HttpResult<WxBean>> wxpay(@FieldMap Map<String, String> maps); /** * 银联支付获取TN **/ @FormUrlEncoded @POST("api/Pay/achieveTN") Observable<UnionBean> unionPay(@FieldMap Map<String, String> maps); /** * 银联支付验签 **/ @FormUrlEncoded @POST("api/Pay/VerifyAppData") Observable<UnionBean> verifyUndion(@FieldMap Map<String, String> maps); @FormUrlEncoded @POST("api/Public/getUploadsurl") Observable<HttpResult<ApkBean>> getApkUrl(@FieldMap Map<String, String> maps); }
[ "970725917@qq.com" ]
970725917@qq.com
dfc50bc67496b62a1e42975a75e2261b446ca5ce
86ee6ef337545e2d9473b27ea917c1f80a66195e
/offer/src/main/java/leetCode/L10034_SearchRange.java
a211131784f8c35db6de8d7af905d606cc4875ad
[ "MIT" ]
permissive
seawindnick/javafamily
161eac4c34c64a71ebe6bc7e55bfc53897294918
d8a6cf8b185e98d6e60961e306a4bbeb4e7360dc
refs/heads/master
2022-11-06T06:55:00.822972
2022-02-25T03:05:07
2022-02-25T03:05:07
227,639,012
1
0
MIT
2022-10-12T20:38:24
2019-12-12T15:34:04
Java
UTF-8
Java
false
false
3,146
java
package leetCode;//给定一个按照升序排列的整数数组 nums,和一个目标值 target。找出给定目标值在数组中的开始位置和结束位置。 // // 如果数组中不存在目标值 target,返回 [-1, -1]。 // // 进阶: // // // 你可以设计并实现时间复杂度为 O(log n) 的算法解决此问题吗? // // // // // 示例 1: // // //输入:nums = [5,7,7,8,8,10], target = 8 //输出:[3,4] // // 示例 2: // // //输入:nums = [5,7,7,8,8,10], target = 6 //输出:[-1,-1] // // 示例 3: // // //输入:nums = [], target = 0 //输出:[-1,-1] // // // // 提示: // // // 0 <= nums.length <= 105 // -109 <= nums[i] <= 109 // nums 是一个非递减数组 // -109 <= target <= 109 // // Related Topics 数组 二分查找 // 👍 1137 👎 0 import com.alibaba.fastjson.JSONArray; //leetcode submit region begin(Prohibit modification and deletion) public class L10034_SearchRange { public static void main(String[] args) { int[] array = new int[]{5,7,7,8,8,10}; System.out.println(JSONArray.toJSONString(searchRange(array,8))); } public static int[] searchRange(int[] nums, int target) { if (nums == null || nums.length <= 0) { return new int[]{-1, -1}; } int leftIndex = searchLeftIndex(nums, target); int rightIndex = searchRightIndex(nums, target); return new int[]{leftIndex, rightIndex}; } private static int searchRightIndex(int[] nums, int target) { int leftIndex = 0; int rightIndex = nums.length - 1; Integer index = -1; while (leftIndex <= rightIndex) { int midIndex = (leftIndex + rightIndex) / 2; if (nums[midIndex] < target) { leftIndex = midIndex + 1; continue; } if (nums[midIndex] > target) { rightIndex = midIndex - 1; continue; } if (nums[midIndex] == target) { index = midIndex; if (midIndex != nums.length - 1 && nums[midIndex] == nums[midIndex + 1]) { leftIndex = leftIndex + 1; }else { break; } } } return index; } private static int searchLeftIndex(int[] nums, int target) { int leftIndex = 0; int rightIndex = nums.length - 1; Integer index = -1; while (leftIndex <= rightIndex) { int midIndex = (leftIndex + rightIndex) / 2; if (nums[midIndex] < target) { leftIndex = midIndex + 1; continue; } if (nums[midIndex] > target) { rightIndex = midIndex - 1; continue; } if (nums[midIndex] == target) { index = midIndex; if (midIndex != 0 && nums[midIndex] == nums[midIndex - 1]) { rightIndex = midIndex - 1; }else { break; } } } return index; } }
[ "hushiye001@ke.com" ]
hushiye001@ke.com
1e200753e60a78d03c34b58e5f7005fa6639e5cd
89723541f3a2cc7087d49dcee592694c5c0513c3
/hapi-fhir-structures-r4/src/main/java/org/hl7/fhir/r4/model/codesystems/ConsentPerformerEnumFactory.java
4627f0697be7aa0b37d2559a80b8ef88462eb477
[ "Apache-2.0", "LicenseRef-scancode-warranty-disclaimer" ]
permissive
rkorytkowski/hapi-fhir
7207ae68ff8ef6e876f53b51bbdbd0312ae0daa7
9f45c2bcfa00349ce17e191899581f4fc6e8c0d6
refs/heads/master
2021-07-13T01:06:12.674713
2020-06-16T09:11:38
2020-06-16T09:12:23
145,406,752
0
2
Apache-2.0
2018-08-20T11:08:35
2018-08-20T11:08:35
null
UTF-8
Java
false
false
3,018
java
package org.hl7.fhir.r4.model.codesystems; /* Copyright (c) 2011+, HL7, Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of HL7 nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ // Generated on Sun, May 6, 2018 17:51-0400 for FHIR v3.4.0 import org.hl7.fhir.r4.model.EnumFactory; public class ConsentPerformerEnumFactory implements EnumFactory<ConsentPerformer> { public ConsentPerformer fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("consenter".equals(codeString)) return ConsentPerformer.CONSENTER; if ("grantee".equals(codeString)) return ConsentPerformer.GRANTEE; if ("grantor".equals(codeString)) return ConsentPerformer.GRANTOR; if ("delegatee".equals(codeString)) return ConsentPerformer.DELEGATEE; if ("delegator".equals(codeString)) return ConsentPerformer.DELEGATOR; throw new IllegalArgumentException("Unknown ConsentPerformer code '"+codeString+"'"); } public String toCode(ConsentPerformer code) { if (code == ConsentPerformer.CONSENTER) return "consenter"; if (code == ConsentPerformer.GRANTEE) return "grantee"; if (code == ConsentPerformer.GRANTOR) return "grantor"; if (code == ConsentPerformer.DELEGATEE) return "delegatee"; if (code == ConsentPerformer.DELEGATOR) return "delegator"; return "?"; } public String toSystem(ConsentPerformer code) { return code.getSystem(); } }
[ "jamesagnew@gmail.com" ]
jamesagnew@gmail.com
fbf383e8e59ecee69b004ebba8ac24d4ff9aad9f
5f82aae041ab05a5e6c3d9ddd8319506191ab055
/Projects/JacksonDatabind/29/src/test/java/com/fasterxml/jackson/failing/ImplicitParamsForCreator806Test.java
031cc14a41610aa51f88092102c0b1acdaa6f51b
[ "LicenseRef-scancode-generic-cla", "Apache-2.0" ]
permissive
lingming/prapr_data
e9ddabdf971451d46f1ef2cdbee15ce342a6f9dc
be9ababc95df45fd66574c6af01122ed9df3db5d
refs/heads/master
2023-08-14T20:36:23.459190
2021-10-17T13:49:39
2021-10-17T13:49:39
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,829
java
package com.fasterxml.jackson.failing; import com.fasterxml.jackson.databind.*; import com.fasterxml.jackson.databind.introspect.AnnotatedMember; import com.fasterxml.jackson.databind.introspect.AnnotatedParameter; import com.fasterxml.jackson.databind.introspect.JacksonAnnotationIntrospector; public class ImplicitParamsForCreator806Test extends BaseMapTest { @SuppressWarnings("serial") static class MyParamIntrospector extends JacksonAnnotationIntrospector { @Override public String findImplicitPropertyName(AnnotatedMember param) { if (param instanceof AnnotatedParameter) { AnnotatedParameter ap = (AnnotatedParameter) param; return "paramName"+ap.getIndex(); } return super.findImplicitPropertyName(param); } } static class XY { protected int x, y; // annotation should NOT be needed with 2.6 any more (except for single-arg case) //@com.fasterxml.jackson.annotation.JsonCreator public XY(int x, int y) { this.x = x; this.y = y; } } /* /********************************************************** /* Test methods /********************************************************** */ // for [databind#806] public void testImplicitNameWithNamingStrategy() throws Exception { ObjectMapper mapper = new ObjectMapper() .setAnnotationIntrospector(new MyParamIntrospector()) .setPropertyNamingStrategy(PropertyNamingStrategy.CAMEL_CASE_TO_LOWER_CASE_WITH_UNDERSCORES) ; XY value = mapper.readValue(aposToQuotes("{'param_name0':1,'param_name1':2}"), XY.class); assertNotNull(value); assertEquals(1, value.x); assertEquals(2, value.y); } }
[ "2890268106@qq.com" ]
2890268106@qq.com
bf9bd6c6f0d310c6e7c38ea0d46f5768a2d2726f
e7411762b76a391ccbe1b960d64f8ca194209adf
/openapi-generator-utils/petstore/petstore-openapigen-jaxrs-spec-thorntail/src/gen/java/fr/jmini/openapi/openapitools/thorntail/model/Category.java
4a1c9d7a59a7c6930fa5743cd372a806e943fbd0
[ "Apache-2.0" ]
permissive
jmini/openapi-experiments
fe3e5c6a855716f9fc83f26638a3b5327183698f
941b125777977c52c1f1e7abd59f4fdf5863e5cb
refs/heads/master
2022-12-25T14:18:00.172453
2020-01-06T20:52:47
2020-01-06T20:52:47
121,434,627
1
1
Apache-2.0
2022-12-15T23:23:47
2018-02-13T20:45:45
Java
UTF-8
Java
false
false
1,843
java
package fr.jmini.openapi.openapitools.thorntail.model; import javax.validation.constraints.*; import javax.validation.Valid; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; public class Category { private @Valid Long id; private @Valid String name; /** **/ public Category id(Long id) { this.id = id; return this; } @JsonProperty("id") public Long getId() { return id; } public void setId(Long id) { this.id = id; } /** **/ public Category name(String name) { this.name = name; return this; } @JsonProperty("name") public String getName() { return name; } public void setName(String name) { this.name = name; } @Override public boolean equals(java.lang.Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Category category = (Category) o; return Objects.equals(this.id, category.id) && Objects.equals(this.name, category.name); } @Override public int hashCode() { return Objects.hash(id, name); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class Category {\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append("}"); return sb.toString(); } /** * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } }
[ "dev@jmini.fr" ]
dev@jmini.fr
1ec4b8a91ba4b65e99fde09d73d18f59fd300f28
d8ce8bfb6c2415479625dd220108d1b74ca7c5ac
/Backup/UIConstants.java
5e98fcc2cd365ede932891823c0a9887ecf556ad
[]
no_license
Bryce-Summers/Interpolators
519a231795669edd7ee89a97beed180dcd5318c3
655b2197988320ca566926fc89f694291393a9ac
refs/heads/master
2016-09-06T14:29:55.289889
2016-01-16T20:49:52
2016-01-16T20:49:52
31,114,044
2
1
null
null
null
null
UTF-8
Java
false
false
3,250
java
package template.tool; import processing.core.PFont; public class UIConstants { static PFont buttonFont; static gui_mainControls App; final static int NO_BUTTON_SELECTED = -1; final static int BUTTON_STATE_UNSELECTED = 0; final static int BUTTON_STATE_HOVERING = 1; final static int BUTTON_STATE_PRESSING = 2; final static int BUTTON_STATE_SELECTED = 3; final static int BUTTONGROUP_SINGLE_CHOICE = 1; final static int BUTTONGROUP_MULTIPLE_CHOICE = 2; static UIButtonGroup buttonGroupA; static UIButtonGroup buttonGroupB; static UIButton generateButton; static String[] namesA = { "All", "Sigmoid", "Ogee", "Ease-In", "Ease-Out", "Penner's", "Gaussian", "Bezier", "Staircase", "Window", "Other" }; static String[] imagesA = { null, "Sigmoid.png", "Ogee.png", "Ease-In.png", "Ease-Out.png", null, "Gaussian.png", null, "Staircase.png", "Window.png", null }; static String[] namesB = { "Flip X?", "Flip Y?", "Constrain Output?", "Comment Only?", "Use New Tab?" }; static String[] imagesB = { "check_24.png", "check_24.png", "check_24.png", "check_24.png", "check_24.png" }; // -- Initialize all of the constants. public static void init(gui_mainControls App_in) { App = App_in; buttonFont = App.loadFont("Roboto-Medium-16.vlw"); buttonGroupA = new UIButtonGroup (BUTTONGROUP_SINGLE_CHOICE, namesA, imagesA, 7, 7, 130, 42, 7); int output_controls_x = 970; buttonGroupB = new UIButtonGroup (BUTTONGROUP_MULTIPLE_CHOICE, namesB, imagesB, output_controls_x, 7, 192, 42, 7); generateButton = new UIButton("GENERATE!", output_controls_x, 350, 192, 72, false, false); generateButton.bCenteredText = true; generateButton.setIsMomentary(true); buttonGroupB.buttonArray[4].buttonState = BUTTON_STATE_SELECTED; } //---------------- static void draw() { // App.background(255); //drawButtonGroupHeadings(); buttonGroupA.update(); buttonGroupA.drawButtonGroup(); buttonGroupB.update(); buttonGroupB.drawButtonGroup(); boolean bDoGenerate = generateButton.handleMouse(); generateButton.drawButton(); if (bDoGenerate){ App.export(); } // -- Handle Output Settings. UIButton[] buttons = buttonGroupB.buttonArray; App.bool_flipX = buttons[0].isSelected(); App.bool_flipY = buttons[1].isSelected(); App.bool_clamp = buttons[2].isSelected(); App.bool_comment = buttons[3].isSelected(); App.bool_newTab = buttons[4].isSelected(); } //---------------- static void mousePressed() { buttonGroupA.handleMousePressed(); buttonGroupB.handleMousePressed(); generateButton.handleMousePressed(); // -- Handle Group index setting. UIButton[] buttons = buttonGroupA.buttonArray; int len = buttons.length; for(int i = 0; i < len; i++) { if(buttonGroupA.buttonArray[i].bClickHappenedInMe) { App.function_groups[i].mouseP(); App.println("Selected " + i); } } } //---------------- static void drawButtonGroupHeadings() { App.fill(100); App.textAlign (App.LEFT); App.text ("Family: " + buttonGroupA.getSelectedButtonString(), 7, 20); App.text ("Options: " + buttonGroupB.getSelectedButtonString(), 200, 20); } }
[ "bryce@funtheemental.com" ]
bryce@funtheemental.com
f506470aa7e323040832d2378b3a8d94ccb87b33
8ab3b581022a570e89b30de843d4cc5f671609f3
/src/main/java/com/ebay/soap/eBLBaseComponents/RefundFundingSourceType.java
a3d87d9cbcbdda548c9859fede75c70507abe92e
[]
no_license
lespaul361/eBaySDK1027
745198a748e47cf2e9f26719f3a03384e8210901
6c5e0de66b89dbfb859bc34376cd7e0616724358
refs/heads/master
2021-04-26T23:54:52.208637
2018-03-10T07:27:19
2018-03-10T07:27:19
124,628,809
0
1
null
2018-08-03T00:38:05
2018-03-10T06:24:24
Java
UTF-8
Java
false
false
6,958
java
package com.ebay.soap.eBLBaseComponents; import java.io.Serializable; import java.util.ArrayList; import java.util.List; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAnyElement; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; import org.w3c.dom.Element; /** * * This type is deprecated. * * * <p>Java class for RefundFundingSourceType complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="RefundFundingSourceType"> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="RefundingSourceType" type="{urn:ebay:apis:eBLBaseComponents}RefundingSourceTypeCodeType" minOccurs="0"/> * &lt;element name="AccountNumber" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="RefundAmount" type="{urn:ebay:apis:eBLBaseComponents}AmountType" minOccurs="0"/> * &lt;element name="SellerExternalTransactionID" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="BuyerExternalTransactionID" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;any/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "RefundFundingSourceType", propOrder = { "refundingSourceType", "accountNumber", "refundAmount", "sellerExternalTransactionID", "buyerExternalTransactionID", "any" }) public class RefundFundingSourceType implements Serializable { private final static long serialVersionUID = 12343L; @XmlElement(name = "RefundingSourceType") protected RefundingSourceTypeCodeType refundingSourceType; @XmlElement(name = "AccountNumber") protected String accountNumber; @XmlElement(name = "RefundAmount") protected AmountType refundAmount; @XmlElement(name = "SellerExternalTransactionID") protected String sellerExternalTransactionID; @XmlElement(name = "BuyerExternalTransactionID") protected String buyerExternalTransactionID; @XmlAnyElement(lax = true) protected List<Object> any; /** * Gets the value of the refundingSourceType property. * * @return * possible object is * {@link RefundingSourceTypeCodeType } * */ public RefundingSourceTypeCodeType getRefundingSourceType() { return refundingSourceType; } /** * Sets the value of the refundingSourceType property. * * @param value * allowed object is * {@link RefundingSourceTypeCodeType } * */ public void setRefundingSourceType(RefundingSourceTypeCodeType value) { this.refundingSourceType = value; } /** * Gets the value of the accountNumber property. * * @return * possible object is * {@link String } * */ public String getAccountNumber() { return accountNumber; } /** * Sets the value of the accountNumber property. * * @param value * allowed object is * {@link String } * */ public void setAccountNumber(String value) { this.accountNumber = value; } /** * Gets the value of the refundAmount property. * * @return * possible object is * {@link AmountType } * */ public AmountType getRefundAmount() { return refundAmount; } /** * Sets the value of the refundAmount property. * * @param value * allowed object is * {@link AmountType } * */ public void setRefundAmount(AmountType value) { this.refundAmount = value; } /** * Gets the value of the sellerExternalTransactionID property. * * @return * possible object is * {@link String } * */ public String getSellerExternalTransactionID() { return sellerExternalTransactionID; } /** * Sets the value of the sellerExternalTransactionID property. * * @param value * allowed object is * {@link String } * */ public void setSellerExternalTransactionID(String value) { this.sellerExternalTransactionID = value; } /** * Gets the value of the buyerExternalTransactionID property. * * @return * possible object is * {@link String } * */ public String getBuyerExternalTransactionID() { return buyerExternalTransactionID; } /** * Sets the value of the buyerExternalTransactionID property. * * @param value * allowed object is * {@link String } * */ public void setBuyerExternalTransactionID(String value) { this.buyerExternalTransactionID = value; } /** * * * @return * array of * {@link Element } * {@link Object } * */ public Object[] getAny() { if (this.any == null) { return new Object[ 0 ] ; } return ((Object[]) this.any.toArray(new Object[this.any.size()] )); } /** * * * @return * one of * {@link Element } * {@link Object } * */ public Object getAny(int idx) { if (this.any == null) { throw new IndexOutOfBoundsException(); } return this.any.get(idx); } public int getAnyLength() { if (this.any == null) { return 0; } return this.any.size(); } /** * * * @param values * allowed objects are * {@link Element } * {@link Object } * */ public void setAny(Object[] values) { this._getAny().clear(); int len = values.length; for (int i = 0; (i<len); i ++) { this.any.add(values[i]); } } protected List<Object> _getAny() { if (any == null) { any = new ArrayList<Object>(); } return any; } /** * * * @param value * allowed object is * {@link Element } * {@link Object } * */ public Object setAny(int idx, Object value) { return this.any.set(idx, value); } }
[ "lespaul36@gmail.com" ]
lespaul36@gmail.com
1713058c71c5f78e4d5eac4efd661b560834ab2b
0af8b92686a58eb0b64e319b22411432aca7a8f3
/large-multiproject/project2/src/main/java/org/gradle/test/performance2_4/Production2_315.java
913cf8b0f92c93f83765524f4508736efd5e0a2f
[]
no_license
gradle/performance-comparisons
b0d38db37c326e0ce271abebdb3c91769b860799
e53dc7182fafcf9fedf07920cbbea8b40ee4eef4
refs/heads/master
2023-08-14T19:24:39.164276
2022-11-24T05:18:33
2022-11-24T05:18:33
80,121,268
17
15
null
2022-09-30T08:04:35
2017-01-26T14:25:33
null
UTF-8
Java
false
false
300
java
package org.gradle.test.performance2_4; public class Production2_315 extends org.gradle.test.performance1_4.Production1_315 { private final String property; public Production2_315() { this.property = "foo"; } public String getProperty() { return property; } }
[ "cedric.champeau@gmail.com" ]
cedric.champeau@gmail.com
6ed62231f7fac86aa1d75eee37e8f4dfc089f865
18a0ec2e1d773787b26cd3f7005626b82ce22307
/util/SuSi2Joana/src/edu/kit/joana/SuSi2Joana/LatticeBuilder.java
1815cc0ffd0ffd602b65bad94324e1d28ef0d473
[ "LicenseRef-scancode-warranty-disclaimer" ]
no_license
joana-team/joana
97eac211aa4e22f63dd0a638601bae1bb3ce3a91
d49d82b5892f9331d37432d02d090f28feab56ea
refs/heads/master
2022-01-20T03:44:17.606135
2021-12-13T14:19:22
2021-12-13T14:19:22
6,942,297
69
29
null
2021-08-23T11:55:28
2012-11-30T16:47:16
Java
UTF-8
Java
false
false
1,933
java
package edu.kit.joana.SuSi2Joana; import edu.kit.joana.ifc.sdg.lattice.impl.EditableLatticeSimple; import java.util.List; import java.util.Set; import java.util.HashSet; import com.ibm.wala.util.MonitorUtil.IProgressMonitor; import com.ibm.wala.util.NullProgressMonitor; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.IOException; import java.io.PrintStream; import java.io.File; public class LatticeBuilder implements ILatticeBuilder { private static final Logger logger = LoggerFactory.getLogger(LatticeBuilder.class); private final Set<String> entries = new HashSet<String>(); private final EditableLatticeSimple<String> lattice; public LatticeBuilder() { this.lattice = new EditableLatticeSimple<String>(); this.lattice.addElement("secure"); this.lattice.addElement("insecure"); } public void extract(List<? extends SuSiFile.Entry> in) { for (final SuSiFile.Entry e : in) { if (this.entries.add(e.cathegory)) { this.lattice.addElement(e.cathegory); this.lattice.setImmediatelyGreater(e.cathegory, "secure"); this.lattice.setImmediatelyLower(e.cathegory, "insecure"); logger.debug("Added " + e.cathegory); } } } public String getSource(String cat) { return cat; } public String getSink(String cat) { return cat; } public void write(final File out) throws IOException { final PrintStream ps = new PrintStream(out); this.writeLower(ps, this.lattice.getTop()); logger.info("Written Lattice to " + out.getName()); ps.close(); } private void writeLower(final PrintStream out, String elem) { for (String lower : this.lattice.getImmediatelyLower(elem)) { out.println(lower + "<=" + elem); this.writeLower(out, lower); } } }
[ "juergen.graf@gmail.com" ]
juergen.graf@gmail.com
0576dbb90c7cd162354a231fa5e965f866eb1b99
9c7297b55c6e7c169e07ec679ed1cd4ea89088f2
/components-starter/camel-aws2-mq-starter/src/main/java/org/apache/camel/component/aws2/mq/springboot/MQ2ComponentConverter.java
3cbf734f6efd6c14a96df4a359a8543de9547df2
[ "Apache-2.0" ]
permissive
marcelloraffaele/camel-spring-boot
87d2a47c02ff0aa885107e9e5602879bf9bd4eb4
5238065b90dfdccf2baec2898ee349508c112d6b
refs/heads/master
2023-03-23T18:12:39.428912
2021-03-13T07:26:39
2021-03-13T07:26:39
339,543,544
0
2
Apache-2.0
2021-02-24T07:54:26
2021-02-16T22:04:07
null
UTF-8
Java
false
false
2,916
java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.camel.component.aws2.mq.springboot; import java.util.LinkedHashSet; import java.util.Set; import javax.annotation.Generated; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.context.properties.ConfigurationPropertiesBinding; import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.Configuration; import org.springframework.core.convert.TypeDescriptor; import org.springframework.core.convert.converter.GenericConverter; import org.springframework.stereotype.Component; /** * Generated by camel-package-maven-plugin - do not edit this file! */ @Generated("org.apache.camel.springboot.maven.SpringBootAutoConfigurationMojo") @Configuration(proxyBeanMethods = false) @ConfigurationPropertiesBinding @Component public class MQ2ComponentConverter implements GenericConverter { @Autowired private ApplicationContext applicationContext; public Set<ConvertiblePair> getConvertibleTypes() { Set<ConvertiblePair> answer = new LinkedHashSet<>(); answer.add(new ConvertiblePair(String.class, software.amazon.awssdk.services.mq.MqClient.class)); answer.add(new ConvertiblePair(String.class, org.apache.camel.component.aws2.mq.MQ2Configuration.class)); return answer; } public Object convert( Object source, TypeDescriptor sourceType, TypeDescriptor targetType) { if (source == null) { return null; } String ref = source.toString(); if (!ref.startsWith("#")) { return null; } ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1); switch (targetType.getName()) { case "software.amazon.awssdk.services.mq.MqClient": return applicationContext.getBean(ref, software.amazon.awssdk.services.mq.MqClient.class); case "org.apache.camel.component.aws2.mq.MQ2Configuration": return applicationContext.getBean(ref, org.apache.camel.component.aws2.mq.MQ2Configuration.class); } return null; } }
[ "claus.ibsen@gmail.com" ]
claus.ibsen@gmail.com
34ad95e00f460953d37df73096761f2023347f1c
688ee54f310d78c724efa9b0e5f258d6310d023b
/rb-server-master/rb-server-core/src/main/java/net/readybid/entities/agency/db/AgencyRepositoryImpl.java
8519b9a35bff8a8c5ce14e545d213af1d9b5f23c
[]
no_license
Ans123/ReadyBid
344e027839563922c338c6a3261cda5441111f81
50186b710b52048358005ce15d56ed783ed00607
refs/heads/master
2020-04-07T23:57:28.054043
2018-11-23T12:55:54
2018-11-23T12:55:54
158,831,718
0
0
null
null
null
null
UTF-8
Java
false
false
2,458
java
package net.readybid.entities.agency.db; import com.mongodb.client.AggregateIterable; import com.mongodb.client.MongoCollection; import com.mongodb.client.MongoDatabase; import net.readybid.entities.agency.core.Agency; import net.readybid.entities.agency.core.AgencyImpl; import net.readybid.entities.agency.logic.AgencyRepository; import net.readybid.mongodb.MongoRetry; import org.bson.Document; import org.bson.conversions.Bson; import org.bson.types.ObjectId; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.stereotype.Service; import static net.readybid.mongodb.RbMongoFilters.*; /** * Created by DejanK on 1/6/2017. * */ @Service public class AgencyRepositoryImpl implements AgencyRepository { private final MongoCollection<AgencyImpl> agencyCollection; private final MongoCollection<AgencyImpl> unvalidatedAgencyCollection; @Autowired public AgencyRepositoryImpl( @Qualifier("mongoDatabaseMain") MongoDatabase mongoDatabase ) { agencyCollection = mongoDatabase.getCollection("TravelAgency", AgencyImpl.class); unvalidatedAgencyCollection = mongoDatabase.getCollection("UnvalidatedTravelAgency", AgencyImpl.class); } @Override @MongoRetry public Agency findById(String id) { return getAgency(byId(id), null).first(); } @Override @MongoRetry public void saveForValidation(Agency agency) { unvalidatedAgencyCollection.insertOne((AgencyImpl) agency); } @Override @MongoRetry public AgencyImpl findByIdIncludingUnverified(ObjectId id, String... fields) { final Document projection = fields == null ? null : include(fields); final AgencyImpl hc = getAgency(byId(id), projection).first(); return hc == null ? getUnvalidatedAgency(byId(id), projection).first() : hc; } @Override public AgencyImpl findByIdIncludingUnverified(String id, String... fields) { return findByIdIncludingUnverified(oid(id), fields); } private AggregateIterable<AgencyImpl> getAgency(Bson query, Bson projection){ return agencyCollection.aggregate(joinCreatedAndStatus(query, projection)); } private AggregateIterable<AgencyImpl> getUnvalidatedAgency(Bson query, Bson projection){ return unvalidatedAgencyCollection.aggregate(joinCreatedAndStatus(query, projection)); } }
[ "kiplnet13@konstantinfosolutions.com" ]
kiplnet13@konstantinfosolutions.com
aae875b73deedbc9f3c738e4bc76811cb6480a1e
45e899862afb72ee52f1afa4ac8d7d3c7ea9f30a
/src/test/java/com/ddf/myapp/service/mapper/UserMapperTest.java
3948cf11a9010fe1f8138144e0ebe65e74a6ea50
[]
no_license
KoudjaDany/jhipster-sample-application
20c7bc6e1ff604b2e0f592692d42b00e4cae43b8
93741698e56831d4f076578e4a0371843a1119bf
refs/heads/master
2022-12-21T04:00:41.872910
2020-02-05T14:38:37
2020-02-05T14:38:37
238,471,752
0
0
null
2022-12-16T04:43:50
2020-02-05T14:38:22
Java
UTF-8
Java
false
false
4,311
java
package com.ddf.myapp.service.mapper; import com.ddf.myapp.domain.User; import com.ddf.myapp.service.dto.UserDTO; import org.apache.commons.lang3.RandomStringUtils; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Set; import static org.assertj.core.api.Assertions.assertThat; /** * Unit tests for {@link UserMapper}. */ public class UserMapperTest { private static final String DEFAULT_LOGIN = "johndoe"; private static final Long DEFAULT_ID = 1L; private UserMapper userMapper; private User user; private UserDTO userDto; @BeforeEach public void init() { userMapper = new UserMapper(); user = new User(); user.setLogin(DEFAULT_LOGIN); user.setPassword(RandomStringUtils.random(60)); user.setActivated(true); user.setEmail("johndoe@localhost"); user.setFirstName("john"); user.setLastName("doe"); user.setImageUrl("image_url"); user.setLangKey("en"); userDto = new UserDTO(user); } @Test public void usersToUserDTOsShouldMapOnlyNonNullUsers() { List<User> users = new ArrayList<>(); users.add(user); users.add(null); List<UserDTO> userDTOS = userMapper.usersToUserDTOs(users); assertThat(userDTOS).isNotEmpty(); assertThat(userDTOS).size().isEqualTo(1); } @Test public void userDTOsToUsersShouldMapOnlyNonNullUsers() { List<UserDTO> usersDto = new ArrayList<>(); usersDto.add(userDto); usersDto.add(null); List<User> users = userMapper.userDTOsToUsers(usersDto); assertThat(users).isNotEmpty(); assertThat(users).size().isEqualTo(1); } @Test public void userDTOsToUsersWithAuthoritiesStringShouldMapToUsersWithAuthoritiesDomain() { Set<String> authoritiesAsString = new HashSet<>(); authoritiesAsString.add("ADMIN"); userDto.setAuthorities(authoritiesAsString); List<UserDTO> usersDto = new ArrayList<>(); usersDto.add(userDto); List<User> users = userMapper.userDTOsToUsers(usersDto); assertThat(users).isNotEmpty(); assertThat(users).size().isEqualTo(1); assertThat(users.get(0).getAuthorities()).isNotNull(); assertThat(users.get(0).getAuthorities()).isNotEmpty(); assertThat(users.get(0).getAuthorities().iterator().next().getName()).isEqualTo("ADMIN"); } @Test public void userDTOsToUsersMapWithNullAuthoritiesStringShouldReturnUserWithEmptyAuthorities() { userDto.setAuthorities(null); List<UserDTO> usersDto = new ArrayList<>(); usersDto.add(userDto); List<User> users = userMapper.userDTOsToUsers(usersDto); assertThat(users).isNotEmpty(); assertThat(users).size().isEqualTo(1); assertThat(users.get(0).getAuthorities()).isNotNull(); assertThat(users.get(0).getAuthorities()).isEmpty(); } @Test public void userDTOToUserMapWithAuthoritiesStringShouldReturnUserWithAuthorities() { Set<String> authoritiesAsString = new HashSet<>(); authoritiesAsString.add("ADMIN"); userDto.setAuthorities(authoritiesAsString); User user = userMapper.userDTOToUser(userDto); assertThat(user).isNotNull(); assertThat(user.getAuthorities()).isNotNull(); assertThat(user.getAuthorities()).isNotEmpty(); assertThat(user.getAuthorities().iterator().next().getName()).isEqualTo("ADMIN"); } @Test public void userDTOToUserMapWithNullAuthoritiesStringShouldReturnUserWithEmptyAuthorities() { userDto.setAuthorities(null); User user = userMapper.userDTOToUser(userDto); assertThat(user).isNotNull(); assertThat(user.getAuthorities()).isNotNull(); assertThat(user.getAuthorities()).isEmpty(); } @Test public void userDTOToUserMapWithNullUserShouldReturnNull() { assertThat(userMapper.userDTOToUser(null)).isNull(); } @Test public void testUserFromId() { assertThat(userMapper.userFromId(DEFAULT_ID).getId()).isEqualTo(DEFAULT_ID); assertThat(userMapper.userFromId(null)).isNull(); } }
[ "jhipster-bot@jhipster.tech" ]
jhipster-bot@jhipster.tech
52826432258e9ec1debe108b05aa6ce45a9388fe
0721305fd9b1c643a7687b6382dccc56a82a2dad
/src/app.zenly.locator_4.8.0_base_source_from_JADX/sources/com/crashlytics/android/answers/C9275h.java
a907b444dddc2363539cb6e4836b7ee3fc5b1c7a
[]
no_license
a2en/Zenly_re
09c635ad886c8285f70a8292ae4f74167a4ad620
f87af0c2dd0bc14fd772c69d5bc70cd8aa727516
refs/heads/master
2020-12-13T17:07:11.442473
2020-01-17T04:32:44
2020-01-17T04:32:44
234,470,083
1
0
null
null
null
null
UTF-8
Java
false
false
1,385
java
package com.crashlytics.android.answers; import android.app.Activity; import android.os.Bundle; import p389io.fabric.sdk.android.C12149a.C12152b; /* renamed from: com.crashlytics.android.answers.h */ class C9275h extends C12152b { /* renamed from: a */ private final C9298z f24102a; /* renamed from: b */ private final BackgroundManager f24103b; public C9275h(C9298z zVar, BackgroundManager backgroundManager) { this.f24102a = zVar; this.f24103b = backgroundManager; } /* renamed from: a */ public void mo24999a(Activity activity) { } /* renamed from: a */ public void mo25000a(Activity activity, Bundle bundle) { } /* renamed from: b */ public void mo25001b(Activity activity) { this.f24102a.mo25035a(activity, C9260c.PAUSE); this.f24103b.mo24946a(); } /* renamed from: b */ public void mo25002b(Activity activity, Bundle bundle) { } /* renamed from: c */ public void mo25003c(Activity activity) { this.f24102a.mo25035a(activity, C9260c.RESUME); this.f24103b.mo24949b(); } /* renamed from: d */ public void mo25004d(Activity activity) { this.f24102a.mo25035a(activity, C9260c.START); } /* renamed from: e */ public void mo25005e(Activity activity) { this.f24102a.mo25035a(activity, C9260c.STOP); } }
[ "developer@appzoc.com" ]
developer@appzoc.com
f0a758ce4ff7005f61e5312d4e43514a5c1dea09
43cfdd7b41d26063b185fa74fa6565bb85efc98d
/project-springmvc2/src/main/java/com/saick/base/tag/RefererURLTag.java
599e6980e84d0ed0ab11b494b32f3db7c8941306
[]
no_license
liubao19860416/project-springmvc2
6cdd8a74cf054e3072bff04c9b082a16b0c4f2f2
e2444d0c1e1e00fe05b6e273ba3b0eeded948046
refs/heads/master
2021-01-10T08:12:11.931126
2015-10-25T04:55:55
2015-10-25T04:55:55
44,896,987
0
0
null
null
null
null
UTF-8
Java
false
false
2,436
java
package com.saick.base.tag; import java.io.IOException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.jsp.JspException; import javax.servlet.jsp.PageContext; import javax.servlet.jsp.SkipPageException; import javax.servlet.jsp.tagext.SimpleTagSupport; /** * 防盗链接的自定义标签:必须通过指定页面,才能访问指定资源; site="http://localhost":表示可以访问的网站地址 * page="/index.jsp":表示不可以访问的连接主页 * */ public class RefererURLTag extends SimpleTagSupport { private String site;// 防盗链规则(开始网站地址) private String page;// 默认跳转主页 public void setSite(String site) { this.site = site; } public void setPage(String page) { this.page = page; } @Override public void doTag() throws JspException, IOException { PageContext pageContext = (PageContext) getJspContext(); HttpServletRequest request = (HttpServletRequest) pageContext .getRequest(); HttpServletResponse response = (HttpServletResponse) pageContext .getResponse(); String referer = request.getHeader("Referer"); System.out.println("设置的防盗链网址开头[site]的格式为1:" + site); if (referer == null || !referer.startsWith(site)) { System.out.println("您的referer地址是:[" + referer + "],不能够直接访问!自动跳转到指定的" + page + "页面"); if (page.startsWith(request.getContextPath())) { System.out.println("page的格式为1:" + page); response.sendRedirect(page); // return; } else if (page.startsWith("/")) { System.out.println("page的格式为2:" + page); response.sendRedirect(request.getContextPath() + page); // return; } else { System.out.println("page的格式为3:" + page); response.sendRedirect(request.getContextPath() + "/" + page); // return; } // System.out.println("您的referer地址是:[" + referer // + "],符合规则,自动跳转到指定资源!"); throw new SkipPageException(); } } }
[ "18611478781@163.com" ]
18611478781@163.com
d2ba31702dcf8f969bb558f24d855c999d27baf9
1b94f6b80b13586e6d228e75019e004958519425
/src/main/java/org/web3d/x3d/sai/MFNode.java
bbfbc7861a703bda9a820563b6831883cf99655a
[]
no_license
linghushaoxia/X3DJSAIL
65a4c3fe384e56ef8c161f6e52c9bf400083c6ba
e34bde3957fd3173c52a032b9907502dd4a0971f
refs/heads/master
2021-01-23T12:21:24.328704
2017-06-02T10:58:35
2017-06-02T10:58:35
93,152,265
0
0
null
null
null
null
UTF-8
Java
false
false
5,039
java
/* Copyright (c) 1995-2017 held by the author(s). All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the Web3D Consortium (http://www.web3D.org) nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.web3d.x3d.sai; import org.web3d.x3d.sai.Core.X3DNode; import org.web3d.x3d.sai.Core.*; // making sure #0 /** * The MFNode field specifies zero or more nodes; the default value of an MFNode field is the empty list. * * <br><br> * <br> * <i>Package hint:</i> This interface is defined by the X3D Java Language Binding Specification for the Scene Authoring Interface (SAI). * * @author Don Brutzman and Roy Walmsley * @see <a href="http://www.web3d.org/documents/specifications/19777-2/V3.0/Part2/abstracts.html#MFNode" target="_blank">SAI Java Specification: B.4.30</a> * @see <a href="http://www.web3d.org/documents/specifications/19775-2/V3.3/Part02/dataRef.html#SAINode" target="blank">SAI Abstract Specification: 5.2.22 SAINode</a> * @see <a href="http://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/fieldsDef.html#SFNodeAndMFNode" target="blank">X3D Abstract Specification: 5.3.12 SFNode and MFNode</a> * @see <a href="http://www.web3d.org/x3d/tooltips/X3dTooltips.html" target="_blank">X3D Tooltips</a> * @see <a href="http://www.web3d.org/x3d/tooltips/X3dTooltips.html#field" target="_blank">X3D Tooltips: field</a> * @see <a href="http://www.web3d.org/x3d/tooltips/X3dTooltips.html#fieldValue" target="_blank">X3D Tooltips: fieldValue</a> * @see <a href="http://www.web3d.org/x3d/content/examples/X3dSceneAuthoringHints.html" target="_blank">X3D Scene Authoring Hints</a> */ public interface MFNode extends MField { /** * Write the current value of the field out to the provided copiedNodes array. * * @param copiedNodes The array to be filled in with current field values. * @throws ArrayIndexOutOfBoundsException The provided copiedNodes array was too small */ public void getValue(X3DNode[] copiedNodes); /** * <p> * Get an individual value from the existing field array. * </p> * <p> * If the index is outside the bounds of the current array of data values, * an ArrayIndexOutOfBoundsException is thrown. * </p> * @param index is position of selected value in current array * @return The selected value * @throws ArrayIndexOutOfBoundsException The index was outside of the bounds of the current array. */ public X3DNode get1Value(int index); /** * Assign an array subset to this field. * @param size indicates size of result to copy (i.e. the number of typed singleton values) from beginning of newValue array. * @param newValue The replacement value array to (potentially) slice and then assign. */ public void setValue(int size, X3DNode[] newValue); /** * Replace a single value at the appropriate location in the existing value array. * Size of the current underlying value array does not change. * @param imageIndex the index of the selected image * @param newValue provides new value to apply */ public void set1Value(int imageIndex, X3DNode newValue); /** * Places a new value at the end of the existing value array, increasing the field length accordingly. * @param newValue The newValue to append */ public void append(X3DNode newValue); /** * Insert a new value prior to the imageIndex location in the existing value array, increasing the field length accordingly. * @param imageIndex the index of the selected image * @param newValue The newValue to insert */ public void insertValue(int imageIndex, X3DNode newValue); }
[ "linghushaoxialove@163.com" ]
linghushaoxialove@163.com
169c75b7185ef487f2ceec753229a9b8f108b28f
f393be3b18ac2a87ea859cac5a5a07f2a9525c16
/test/com/facebook/buck/core/model/targetgraph/raw/UnconfiguredTargetNodeWithDepsPackageTest.java
72ae0ddf3697f87e936d87d02b280a93a396aad2
[ "Apache-2.0" ]
permissive
blubfoo/buck
976890da6ae3b4850b149213badaea9cc24fc5ed
45955d18b4155c4e87be3a89707fcfb1411c806a
refs/heads/master
2023-01-13T02:06:23.501307
2019-10-22T04:18:52
2019-10-22T05:39:25
216,879,969
0
1
Apache-2.0
2022-12-24T05:44:05
2019-10-22T18:12:41
null
UTF-8
Java
false
false
5,194
java
/* * Copyright 2018-present Facebook, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. You may obtain * a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations * under the License. */ package com.facebook.buck.core.model.targetgraph.raw; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import com.facebook.buck.core.model.CanonicalCellName; import com.facebook.buck.core.model.ImmutableUnconfiguredBuildTarget; import com.facebook.buck.core.model.RuleType; import com.facebook.buck.core.model.UnconfiguredBuildTarget; import com.facebook.buck.core.model.targetgraph.impl.ImmutableUnconfiguredTargetNode; import com.facebook.buck.parser.exceptions.ImmutableParsingError; import com.facebook.buck.parser.exceptions.ParsingError; import com.facebook.buck.util.json.ObjectMappers; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import java.io.IOException; import java.nio.file.Paths; import org.junit.Test; public class UnconfiguredTargetNodeWithDepsPackageTest { private UnconfiguredTargetNodeWithDepsPackage getData() { ImmutableMap<String, Object> rawAttributes1 = ImmutableMap.of( "name", "target1", "buck.type", "java_library", "buck.base_path", "base", "deps", ImmutableSet.of(":target2")); UnconfiguredBuildTarget unconfiguredBuildTarget1 = ImmutableUnconfiguredBuildTarget.of( CanonicalCellName.rootCell(), "//base", "target1", UnconfiguredBuildTarget.NO_FLAVORS); UnconfiguredTargetNode unconfiguredTargetNode1 = ImmutableUnconfiguredTargetNode.of( unconfiguredBuildTarget1, RuleType.of("java_library", RuleType.Kind.BUILD), rawAttributes1, ImmutableSet.of(), ImmutableSet.of()); ImmutableMap<String, Object> rawAttributes2 = ImmutableMap.of("name", "target2", "buck.type", "java_library", "buck.base_path", "base"); UnconfiguredBuildTarget unconfiguredBuildTarget2 = ImmutableUnconfiguredBuildTarget.of( CanonicalCellName.rootCell(), "//base", "target2", UnconfiguredBuildTarget.NO_FLAVORS); UnconfiguredTargetNode unconfiguredTargetNode2 = ImmutableUnconfiguredTargetNode.of( unconfiguredBuildTarget2, RuleType.of("java_library", RuleType.Kind.BUILD), rawAttributes2, ImmutableSet.of(), ImmutableSet.of()); UnconfiguredTargetNodeWithDeps unconfiguredTargetNodeWithDeps1 = ImmutableUnconfiguredTargetNodeWithDeps.of( unconfiguredTargetNode1, ImmutableSet.of(unconfiguredBuildTarget2)); UnconfiguredTargetNodeWithDeps unconfiguredTargetNodeWithDeps2 = ImmutableUnconfiguredTargetNodeWithDeps.of(unconfiguredTargetNode2, ImmutableSet.of()); ParsingError error = ImmutableParsingError.of("error1", ImmutableList.of("stacktrace1")); return new ImmutableUnconfiguredTargetNodeWithDepsPackage( Paths.get("base"), ImmutableMap.of( "target1", unconfiguredTargetNodeWithDeps1, "target2", unconfiguredTargetNodeWithDeps2), ImmutableList.of(error), ImmutableSet.of(Paths.get("test1.bzl"), Paths.get("test2.bzl"))); } @Test public void canSerializeAndDeserializeJson() throws IOException { UnconfiguredTargetNodeWithDepsPackage unconfiguredTargetNodeWithDepsPackage = getData(); byte[] data = ObjectMappers.WRITER_WITH_TYPE.writeValueAsBytes(unconfiguredTargetNodeWithDepsPackage); UnconfiguredTargetNodeWithDepsPackage unconfiguredTargetNodeWithDepsPackageDeserialized = ObjectMappers.READER_WITH_TYPE .forType(ImmutableUnconfiguredTargetNodeWithDepsPackage.class) .readValue(data); assertEquals( unconfiguredTargetNodeWithDepsPackage, unconfiguredTargetNodeWithDepsPackageDeserialized); } @Test public void canSerializeWithoutTypeAndFlatten() throws IOException { UnconfiguredTargetNodeWithDepsPackage unconfiguredTargetNodeWithDepsPackage = getData(); String data = ObjectMappers.WRITER.writeValueAsString(unconfiguredTargetNodeWithDepsPackage); ObjectMapper mapper = new ObjectMapper(); JsonNode node = mapper.readTree(data); // Validate property from UnconfiguredTargetNode ("buildTarget") is flattened so it is at the // same level // as non-flattened property ("deps") assertNotNull(node.get("nodes").get("target1").get("buildTarget")); assertNotNull(node.get("nodes").get("target1").get("deps")); } }
[ "facebook-github-bot@users.noreply.github.com" ]
facebook-github-bot@users.noreply.github.com
bfa5f962e19af25ad1544cf225b5cc51cbfb5f10
a981e015dbb2ce0ea246d5fd931e30368ddf1d24
/streamx-console/streamx-console-service/src/main/java/com/streamxhub/streamx/console/core/task/MetricsTask.java
37cdab50b0e9ac5ef356bd8d4a99ceb85960232e
[ "Apache-2.0" ]
permissive
IOTdailinwei/streamx
ced3a74470d31dc2db8ec23edc28e561026e322f
16fee3a9d4e66530b533d2ab612bb5310b6fa15b
refs/heads/main
2023-07-14T20:42:11.750298
2021-08-09T02:43:38
2021-08-09T02:43:38
399,316,543
1
0
Apache-2.0
2021-08-24T02:59:13
2021-08-24T02:59:12
null
UTF-8
Java
false
false
2,260
java
/* * Copyright (c) 2019 The StreamX Project * <p> * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * <p> * http://www.apache.org/licenses/LICENSE-2.0 * <p> * 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.streamxhub.streamx.console.core.task; import com.streamxhub.streamx.console.base.util.WebUtils; import com.streamxhub.streamx.console.core.service.FlameGraphService; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; import java.io.File; import java.util.*; /** * @author benjobs */ @Slf4j @Component public class MetricsTask { @Autowired private FlameGraphService flameGraphService; private final String FLAMEGRAPH_FILE_REGEXP = "\\d+_\\d+\\.json|\\d+_\\d+\\.folded|\\d+_\\d+\\.svg"; /** * hour. */ @Scheduled(cron = "0 0 * * * ?") public void cleanFlameGraph() { // 1) clean file String tempPath = WebUtils.getAppDir("temp"); File temp = new File(tempPath); Arrays.stream(Objects.requireNonNull(temp.listFiles())) .filter(x -> x.getName().matches(FLAMEGRAPH_FILE_REGEXP)) .forEach(File::delete); // 2 clean date Date start = new Date(); Calendar calendar = Calendar.getInstance(); calendar.setTimeZone(TimeZone.getDefault()); calendar.setTime(start); calendar.add(Calendar.HOUR_OF_DAY, -24); Date end = calendar.getTime(); flameGraphService.clean(end); } }
[ "benjobs@qq.com" ]
benjobs@qq.com
f35f601408f45936eec022619201b8735ed512b2
4abd603f82fdfa5f5503c212605f35979b77c406
/html/Programs/hw6-1-diff/r03849033-55-0/Diff.java
d66d007598a7d252979f2655b159fed2ee478cdd
[]
no_license
dn070017/1042-PDSA
b23070f51946c8ac708d3ab9f447ab8185bd2a34
5e7d7b1b2c9d751a93de9725316aa3b8f59652e6
refs/heads/master
2020-03-20T12:13:43.229042
2018-06-15T01:00:48
2018-06-15T01:00:48
137,424,305
0
0
null
null
null
null
UTF-8
Java
false
false
1,459
java
import java.util.Arrays; import java.util.Comparator; public class MyConvexHull { public static void main(String[] args) { Point2D[] a = new Point2D[10]; Point2D[] A = a; int N = a.length; for (int i = 0; i < N; i++) { double x = StdRandom.uniform(10); double y = StdRandom.uniform(10); a[i] = new Point2D(x, y); } Arrays.sort(a); Point2D p = new Point2D(a[0].x(), a[0].y()); Arrays.sort(a, p.POLAR_ORDER); String[] v = new String[N]; v[0]="""" + 0; v[1]="""" + 1; int num = 2; for (int i = 2; i < N; i++) { Point2D aa = a[Integer.parseInt(v[num-2])]; Point2D b = a[Integer.parseInt(v[num-1])]; Point2D c = a[i]; double ccw = (b.x()-aa.x())*(c.y()-aa.y()) - (b.y()-aa.y())*(c.x()-aa.x()); if(ccw > 0){ v[num]="""" + i; num++; } } String[] ConvexHullVertex = new String[num]; int x = 0; for(int i = 0; i < N; i++) { for(int j = 0; j < num; j++) { if (A[i].distanceTo(a[Integer.parseInt(v[j])])==0){ ConvexHullVertex[x]="""" + i; x++; break; } } } } }
[ "dn070017@gmail.com" ]
dn070017@gmail.com
833e8212d874df575d8e0d5148bae614917114f5
1b6ecad3272337928f5819bfc8683eeee1f19d89
/tags/ehcache-core-2.0.0/src/main/java/net/sf/ehcache/hibernate/AbstractEhcacheRegionFactory.java
4c2f1329d50981bb9e70cbc37b9b489de2fd3c8d
[]
no_license
MatthewRBruce/ehcache
77540643da5ca20b6fd5638221f4410a1baefe02
4365fc6cc87516344e95688c368d6a3d2cebbe5a
refs/heads/master
2020-12-27T18:55:00.785157
2015-01-21T07:11:38
2015-01-21T07:11:38
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,251
java
/** * Copyright 2003-2009 Terracotta, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package net.sf.ehcache.hibernate; import java.net.URL; import java.util.Properties; import net.sf.ehcache.CacheManager; import net.sf.ehcache.Ehcache; import net.sf.ehcache.hibernate.management.impl.ProviderMBeanRegistrationHelper; import net.sf.ehcache.hibernate.regions.EhcacheQueryResultsRegion; import net.sf.ehcache.hibernate.regions.EhcacheTimestampsRegion; import net.sf.ehcache.hibernate.regions.EhcacheEntityRegion; import net.sf.ehcache.hibernate.regions.EhcacheCollectionRegion; import net.sf.ehcache.util.ClassLoaderUtil; import org.hibernate.cache.CacheDataDescription; import org.hibernate.cache.CacheException; import org.hibernate.cache.CollectionRegion; import org.hibernate.cache.EntityRegion; import org.hibernate.cache.QueryResultsRegion; import org.hibernate.cache.RegionFactory; import org.hibernate.cache.Timestamper; import org.hibernate.cache.TimestampsRegion; import org.hibernate.cache.access.AccessType; import org.hibernate.cfg.Settings; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * Abstract implementation of an Ehcache specific RegionFactory. * * @author Chris Dennis * @author Greg Luck * @author Emmanuel Bernard */ abstract class AbstractEhcacheRegionFactory implements RegionFactory { /** * The Hibernate system property specifying the location of the ehcache configuration file name. * <p/> * If not set, ehcache.xml will be looked for in the root of the classpath. * <p/> * If set to say ehcache-1.xml, ehcache-1.xml will be looked for in the root of the classpath. */ public static final String NET_SF_EHCACHE_CONFIGURATION_RESOURCE_NAME = "net.sf.ehcache.configurationResourceName"; private static final Logger LOG = LoggerFactory.getLogger(AbstractEhcacheRegionFactory.class); /** * MBean registration helper class instance for Ehcache Hibernate MBeans. */ protected final ProviderMBeanRegistrationHelper mbeanRegistrationHelper = new ProviderMBeanRegistrationHelper(); /** * Ehcache CacheManager that supplied Ehcache instances for this Hibernate RegionFactory. */ protected volatile CacheManager manager; /** * Settings object for the Hibernate persistence unit. */ protected Settings settings; /** * {@inheritDoc} */ public boolean isMinimalPutsEnabledByDefault() { return false; } /** * {@inheritDoc} */ public long nextTimestamp() { return Timestamper.next(); } /** * {@inheritDoc} */ public EntityRegion buildEntityRegion(String regionName, Properties properties, CacheDataDescription metadata) throws CacheException { return new EhcacheEntityRegion(getCache(regionName), settings, metadata, properties); } /** * {@inheritDoc} */ public CollectionRegion buildCollectionRegion(String regionName, Properties properties, CacheDataDescription metadata) throws CacheException { return new EhcacheCollectionRegion(getCache(regionName), settings, metadata, properties); } /** * {@inheritDoc} */ public QueryResultsRegion buildQueryResultsRegion(String regionName, Properties properties) throws CacheException { return new EhcacheQueryResultsRegion(getCache(regionName), properties); } /** * {@inheritDoc} */ public TimestampsRegion buildTimestampsRegion(String regionName, Properties properties) throws CacheException { return new EhcacheTimestampsRegion(getCache(regionName), properties); } private Ehcache getCache(String name) throws CacheException { try { Ehcache cache = manager.getEhcache(name); if (cache == null) { LOG.warn("Couldn't find a specific ehcache configuration for cache named [" + name + "]; using defaults."); manager.addCache(name); cache = manager.getEhcache(name); LOG.debug("started EHCache region: " + name); } HibernateUtil.validateEhcache(cache); return cache; } catch (net.sf.ehcache.CacheException e) { throw new CacheException(e); } } /** * Load a resource from the classpath. */ protected static URL loadResource(String configurationResourceName) { ClassLoader standardClassloader = ClassLoaderUtil.getStandardClassLoader(); URL url = null; if (standardClassloader != null) { url = standardClassloader.getResource(configurationResourceName); } if (url == null) { url = AbstractEhcacheRegionFactory.class.getResource(configurationResourceName); } LOG.debug("Creating EhCacheRegionFactory from a specified resource: {}. Resolved to URL: {}", configurationResourceName, url); if (url == null) { LOG.warn("A configurationResourceName was set to {} but the resource could not be loaded from the classpath." + "Ehcache will configure itself using defaults.", configurationResourceName); } return url; } /** * Default access-type used when the configured using JPA 2.0 config. JPA 2.0 allows <code>@Cacheable(true)</code> to be attached to an * entity without any access type or usage qualification. * <p> * We are conservative here in specifying {@link AccessType#READ_WRITE} so as to follow the mantra of "do no harm". * <p> * This is a Hibernate 3.5 method. */ public AccessType getDefaultAccessType() { return AccessType.READ_WRITE; } }
[ "hhuynh@b9324663-ca0f-0410-8574-be9b3887307d" ]
hhuynh@b9324663-ca0f-0410-8574-be9b3887307d
c813237f31f08a71a20cc6a75c6b8da29877a1dc
85eb470c9b11ca969a1b6371c47c4e2df45b195b
/src/main/java/isahasa/htmlmarchaller/isa/UnderlinedHtmlText.java
cbdd31ee049ece34841e78c1e47e9b4ce90370db
[]
no_license
csgrabt/training-solutions
b694332b856f17c237831123bd2c6504a18d5cb4
5e5fc887dc3d72aa673f8df01ba3f1d097f37176
refs/heads/master
2023-08-15T00:29:28.460172
2021-10-04T08:36:23
2021-10-04T08:36:23
308,076,903
1
1
null
null
null
null
UTF-8
Java
false
false
327
java
package isahasa.htmlmarchaller.isa; import isahasa.htmlmarchaller.HtmlText; public class UnderlinedHtmlText extends HtmlText { public UnderlinedHtmlText(String plainText) { super(plainText); } @Override public String getPlainText() { return "<u>" + super.getPlainText() + "</u>"; } }
[ "gy.cseko@outlook.com" ]
gy.cseko@outlook.com
dbd3e6337385a462ebef44f416c516771d89e7da
fe054c25369a5d0d58fa17c3f827c3b0ee0b3c0b
/Testing/selenium/src/test/java/selenium/TestAnnot.java
2e552744596568bb46b99d80e783e4f8e3c4ae24
[]
no_license
SurajkhanPinjar/TY_CG_HTD_BangaloreNovember_JFS_SurajkhanPinjar
4bdc6bacfbb547f4adc4811ec207745e3a53e17c
85dfcdde17a86dd61a7ee83cfea04a0497880ba6
refs/heads/master
2023-01-12T14:37:49.797977
2020-06-15T04:03:35
2020-06-15T04:03:35
225,843,658
0
1
null
2023-01-07T14:14:27
2019-12-04T10:47:21
Java
UTF-8
Java
false
false
538
java
package selenium; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; import org.testng.Reporter; import org.testng.annotations.Test; //import org.testng.Reporter; //import org.testng.annotations.Test; public class TestAnnot { static { System.setProperty("webdriver.chrome.driver", "./src/main/resources/chromedriver.exe"); } @Test public void demo1() { WebDriver driver = new ChromeDriver(); driver.get("https://www.facebook.com"); Reporter.log("from testannot demo1", true); } }
[ "surajkhanpinjar@gmail.com" ]
surajkhanpinjar@gmail.com
841c7acaedd08d8d9b85daaf76431f63d637eeda
13c2d3db2d49c40c74c2e6420a9cd89377f1c934
/program_data/JavaProgramData/63/328.java
95641c5632ba3ce39820d82c264ffa67df050186
[ "MIT" ]
permissive
qiuchili/ggnn_graph_classification
c2090fefe11f8bf650e734442eb96996a54dc112
291ff02404555511b94a4f477c6974ebd62dcf44
refs/heads/master
2021-10-18T14:54:26.154367
2018-10-21T23:34:14
2018-10-21T23:34:14
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,188
java
package <missing>; public class GlobalMembers { public static int Main() { int x1; int x2; int y1; int y2; int i; int j; int p; int q; int[][] a = new int[100][100]; int[][] b = new int[100][100]; int[][] c = new int[100][100]; x1 = Integer.parseInt(ConsoleInput.readToWhiteSpace(true)); y1 = Integer.parseInt(ConsoleInput.readToWhiteSpace(true)); for (i = 0;i < x1;i++) { for (p = 0;p < y1;p++) { a[i][p] = Integer.parseInt(ConsoleInput.readToWhiteSpace(true)); } } x2 = Integer.parseInt(ConsoleInput.readToWhiteSpace(true)); y2 = Integer.parseInt(ConsoleInput.readToWhiteSpace(true)); for (q = 0;q < x2;q++) { for (j = 0;j < y2;j++) { b[q][j] = Integer.parseInt(ConsoleInput.readToWhiteSpace(true)); } } for (i = 0;i < x1;i++) { for (j = 0;j < y2;j++) { for (p = 0;p < y1;p++) { c[i][j] += a[i][p] * b[p][j]; } } } for (i = 0;i < x1;i++) { System.out.print(c[i][0]); for (j = 1;j < y2;j++) { System.out.print(" "); System.out.print(c[i][j]); } System.out.print("\n"); } return 0; //????? } }
[ "y.yu@open.ac.uk" ]
y.yu@open.ac.uk
1bdf9373e133abaa026a38d3aeff99a0c4460f94
7ad843a5b11df711f58fdb8d44ed50ae134deca3
/JDK/JDK1.8/src/com/sun/corba/se/spi/transport/IORToSocketInfo.java
a299c5e240db7dab4d08eafa974ff180f2b3898e
[ "MIT" ]
permissive
JavaScalaDeveloper/java-source
f014526ad7750ad76b46ff475869db6a12baeb4e
0e6be345eaf46cfb5c64870207b4afb1073c6cd0
refs/heads/main
2023-07-01T22:32:58.116092
2021-07-26T06:42:32
2021-07-26T06:42:32
362,427,367
0
0
null
null
null
null
UTF-8
Java
false
false
512
java
/* * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. */ package com.sun.corba.se.spi.transport; import java.util.List; import com.sun.corba.se.spi.ior.IOR; public interface IORToSocketInfo { /** * Used to extract socket address information from an IOR. * * @param ior. * * @return List - a list of SocketInfo. * */ public List getSocketInfo(IOR ior); } // End of file.
[ "panzha@dian.so" ]
panzha@dian.so
3a282de694edef2bc047316f21f5b15b98fc6c04
62e334192393326476756dfa89dce9f0f08570d4
/tk_code/tiku-essay-app/essay-common/src/main/java/com/huatu/tiku/essay/vo/word/QuestionWord.java
5d49f2a10ae465c68191a4bc16346182f79d0e43
[]
no_license
JellyB/code_back
4796d5816ba6ff6f3925fded9d75254536a5ddcf
f5cecf3a9efd6851724a1315813337a0741bd89d
refs/heads/master
2022-07-16T14:19:39.770569
2019-11-22T09:22:12
2019-11-22T09:22:12
223,366,837
1
2
null
2022-06-30T20:21:38
2019-11-22T09:15:50
Java
UTF-8
Java
false
false
1,128
java
package com.huatu.tiku.essay.vo.word; import com.huatu.tiku.essay.vo.admin.AdminQuestionDeductRuleVO; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; import java.util.List; /** * @Author ZhenYang * @Date Created in 2018/2/28 21:18 * @Description */ @Data @NoArgsConstructor @AllArgsConstructor public class QuestionWord { /* 标题 */ private String topic; /* 试题类型 */ private String type; // 题干 private String stem; // 资料 private List<Integer> materias; // // 批改得分 // private String piGai; private List<String> deFen; private List<String> kouFen; /* 参考答案 / 标准答案*/ private String answerComment; /* 阅卷规则 */ private String rule; /* 试题分析 */ private String analyze; /* 材料与标准答案点评 */ private String remark; /* 试题分数 */ private double score; /* 难度系数 */ private double difficultGrade; /* 扣分规则*/ private AdminQuestionDeductRuleVO questionDeductRuleVO = new AdminQuestionDeductRuleVO(); }
[ "jelly_b@126.com" ]
jelly_b@126.com
3c28cfdabc65c7cfe4b087a0f2e4e16a640cb4f0
4505e3e21447c803e5f23d2d40abf182e6d0ed78
/analysis/src/main/java/edu/stanford/nlp/util/IntUni.java
1c897707a4c2a18ccb6d18378dc4f0e17337ed8c
[]
no_license
photon3710/es_test
76e182267412db5d0ef20cbb97a4d34f1079b98b
83f9f67906ef9c9ce60c5532f804f7d947dfa56b
refs/heads/master
2021-01-21T16:44:07.347016
2015-07-30T09:15:14
2015-07-30T09:15:14
null
0
0
null
null
null
null
UTF-8
Java
false
false
690
java
package edu.stanford.nlp.util; /** * Just a single integer * * @author Kristina Toutanova (kristina@cs.stanford.edu) */ public class IntUni extends IntTuple { public IntUni() { super(1); } public IntUni(int src) { super(1); elements[0] = src; } public int getSource() { return elements[0]; } public void setSource(int src) { elements[0] = src; } @Override public IntTuple getCopy() { IntUni nT = new IntUni(elements[0]); return nT; } public void add(int val) { elements[0] += val; } private static final long serialVersionUID = -7182556672628741200L; }
[ "ashley.wang@misingularity.io" ]
ashley.wang@misingularity.io
18f6083791e8be4cce3bf9c7d10308565ddea406
7ced6c0ed03f2f9345bbc06a09dbbcf5c8687619
/catering-basic-server/catering-marketing/catering-marketing-server/src/main/java/com/meiyuan/catering/marketing/dto/seckillevent/MarketingSeckillEventEditDTO.java
d0b05a0ec11bfd7850579f3636b8477aba7720c5
[]
no_license
haorq/food-word
c14d5752c6492aed4a6a1410f9e0352479460da0
18a71259d77b4d96261dab8ed51ca1f109ab5c2f
refs/heads/master
2023-01-01T12:19:48.967366
2020-10-26T07:32:25
2020-10-26T07:32:25
307,292,398
1
0
null
null
null
null
UTF-8
Java
false
false
1,450
java
package com.meiyuan.catering.marketing.dto.seckillevent; import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonIgnore; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import javax.validation.constraints.NotNull; import java.time.LocalDateTime; import java.time.LocalTime; import java.util.Date; /** * @author GongJunZheng * @date 2020/08/05 09:08 * @description 秒杀场次编辑DTO **/ @Data @ApiModel("秒杀场次编辑DTO") public class MarketingSeckillEventEditDTO { @ApiModelProperty(value = "场次主键ID", required = true) @NotNull(message = "场次主键ID不能为空") private Long id; /** * 场次开始时间 */ @JsonFormat(pattern = "HH:mm:ss", timezone = "GMT+8") @ApiModelProperty(value = "场次开始时间,例如“11:00:00”", required = true) @NotNull(message = "场次开始时间不能为空") private Date beginTime; /** * 场次结束时间 */ @JsonFormat(pattern = "HH:mm:ss", timezone = "GMT+8") @ApiModelProperty(value = "场次结束时间,例如“12:00:00”", required = true) @NotNull(message = "场次结束时间不能为空") private Date endTime; /** * 编辑人ID */ @JsonIgnore private Long updateBy; /** * 编辑时间 */ @JsonIgnore private LocalDateTime updateTime; }
[ "386234736" ]
386234736
fdb577967d1520f66811fba2b650f536f500f50c
e27942cce249f7d62b7dc8c9b86cd40391c1ddd4
/modules/adwords_appengine/src/main/java/com/google/api/ads/adwords/jaxws/v201710/mcm/ManagedCustomerPage.java
61de411a049fbce32995c4a0046e1212749e8359
[ "Apache-2.0" ]
permissive
mo4ss/googleads-java-lib
b4b6178747d25d16ae6aa0c80d80ee18a2dfe01a
efaa9c3bd8a46a3ed4b00963dc9760c6dd8bd641
refs/heads/master
2022-12-05T00:30:56.740813
2022-11-16T10:47:15
2022-11-16T10:47:15
108,132,394
0
0
Apache-2.0
2022-11-16T10:47:16
2017-10-24T13:41:43
Java
UTF-8
Java
false
false
3,668
java
// Copyright 2017 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. package com.google.api.ads.adwords.jaxws.v201710.mcm; 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; import com.google.api.ads.adwords.jaxws.v201710.cm.Page; /** * * Return result of {@link ManagedCustomerService} * * * <p>Java class for ManagedCustomerPage complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="ManagedCustomerPage"> * &lt;complexContent> * &lt;extension base="{https://adwords.google.com/api/adwords/cm/v201710}Page"> * &lt;sequence> * &lt;element name="entries" type="{https://adwords.google.com/api/adwords/mcm/v201710}ManagedCustomer" maxOccurs="unbounded" minOccurs="0"/> * &lt;element name="links" type="{https://adwords.google.com/api/adwords/mcm/v201710}ManagedCustomerLink" maxOccurs="unbounded" minOccurs="0"/> * &lt;/sequence> * &lt;/extension> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "ManagedCustomerPage", propOrder = { "entries", "links" }) public class ManagedCustomerPage extends Page { protected List<ManagedCustomer> entries; protected List<ManagedCustomerLink> links; /** * Gets the value of the entries 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 entries property. * * <p> * For example, to add a new item, do as follows: * <pre> * getEntries().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link ManagedCustomer } * * */ public List<ManagedCustomer> getEntries() { if (entries == null) { entries = new ArrayList<ManagedCustomer>(); } return this.entries; } /** * Gets the value of the links 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 links property. * * <p> * For example, to add a new item, do as follows: * <pre> * getLinks().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link ManagedCustomerLink } * * */ public List<ManagedCustomerLink> getLinks() { if (links == null) { links = new ArrayList<ManagedCustomerLink>(); } return this.links; } }
[ "jradcliff@users.noreply.github.com" ]
jradcliff@users.noreply.github.com
c5463e4a9c4c16a81fa8b5f1926a6f882719555a
03bf0fe651a672472e0d39ea7692fa99853e6b04
/src/test/java/com/fu/blogsystemmaven/service/UserServiceTest.java
9f4eacf141fc8fe6e82c4177f62e714b33a46e1c
[]
no_license
wunaifu/BlogSystemMaven
e65da7367557dfa6c1aa31e473ad6505f3914f24
497a80086e66821342fd4f10bac142c53c8139ba
refs/heads/master
2021-01-15T12:37:41.169715
2017-08-08T05:35:34
2017-08-08T05:35:34
99,653,807
0
0
null
null
null
null
UTF-8
Java
false
false
1,847
java
package com.fu.blogsystemmaven.service; import com.fu.blogsystemmaven.entity.User; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import java.util.List; import static org.junit.Assert.*; /** * Created by wunaifu on 2017/8/6. */ @RunWith(SpringJUnit4ClassRunner.class) //告诉junit spring的配置文件 @ContextConfiguration({"classpath:spring/spring-dao.xml", "classpath:spring/spring-service.xml"}) public class UserServiceTest { @Autowired private UserService userService; @Test public void addUserByPam() throws Exception { int flag = userService.addUserByPam("18219111604", "123456"); System.out.println("添加返回=="+flag); } @Test public void deleteUserByPhone() throws Exception { int flag = userService.deleteUserByPhone("18219111604"); System.out.println("删除返回==" + flag); } @Test public void updateAndAddUser() throws Exception { int flag=0; try { flag = userService.updateAndAddUser( "18219111605", "update1234", "18219111606", "123456add"); } catch (Exception e) { e.printStackTrace(); } System.out.println("更新返回==" + flag); } @Test public void findUserByPhone() throws Exception { User user = userService.findUserByPhone("18219111624"); System.out.println("查找User==="+user); } @Test public void findAllUser() throws Exception { List<User> userList=userService.findAllUser(); for (User user : userList) { System.out.println("User===="+user); } } }
[ "1278022159@qq.com" ]
1278022159@qq.com
6048f46b50f007637a99a5eb01c18bc52112c354
e26b552cbdae26e099f9f011eb8ed08cfba41315
/bootstrapProject/saludcoop/commons/src/main/java/com/conexia/saludcoop/common/entity/maestro/EstadoVisible.java
da6857138164114e526ac12d8341b9238f799174
[]
no_license
maes0186/ABBAPrototipo1
3c9575b66360b1960eec0b63e8c549dbbf6c14a5
2d0de9a18b54ee8a17a2ba10a25a4357a6708cd5
refs/heads/master
2021-01-10T07:44:58.067830
2015-11-08T00:38:39
2015-11-08T00:38:39
45,358,707
0
0
null
null
null
null
UTF-8
Java
false
false
238
java
package com.conexia.saludcoop.common.entity.maestro; import javax.persistence.Entity; import javax.persistence.Table; @Entity @Table(name="estado_visible", schema="maestros") public class EstadoVisible extends Descriptivo{ }
[ "maes0186@aa3da725-fa38-4a37-849c-0e1cb1b97359" ]
maes0186@aa3da725-fa38-4a37-849c-0e1cb1b97359
4748fa134bfec170255bb9e0a1e8a77589c1dd07
2b6e3a34ec277f72a5da125afecfe3f4a61419f5
/Ruyicai_91/v3.4/src/com/ruyicai/activity/notice/LotnoDetail/QXCDetailView.java
cb24202a2b0f196fc4421137b7ffa09b36a53072
[]
no_license
surport/Android
03d538fe8484b0ff0a83b8b0b2499ad14592c64b
afc2668728379caeb504c9b769011f2ba1e27d25
refs/heads/master
2020-04-02T10:29:40.438348
2013-12-18T09:55:42
2013-12-18T09:55:42
15,285,717
3
5
null
null
null
null
UTF-8
Java
false
false
5,315
java
package com.ruyicai.activity.notice.LotnoDetail; import org.json.JSONException; import org.json.JSONObject; import com.palmdream.RuyicaiAndroid91.R; import com.ruyicai.activity.notice.PrizeBallLinearLayout; import com.ruyicai.constant.Constants; import com.ruyicai.net.newtransaction.NoticePrizeDetailInterface; import com.ruyicai.util.PublicMethod; import android.app.Activity; import android.app.ProgressDialog; import android.content.Context; import android.os.Handler; import android.view.View; import android.widget.LinearLayout; import android.widget.TextView; import android.widget.Toast; public class QXCDetailView extends LotnoDetailView{ public QXCDetailView(Activity context, String lotno, String batchcode,ProgressDialog progress,Handler handler,boolean isDialog) { super(context, lotno, batchcode,progress,handler, isDialog); // TODO Auto-generated constructor stub } TextView prizeBatchCode,prizeDate,totalsellmoney,prizepoolmoney; TextView prizename1,prizenum1,prizemoney1; TextView prizename2,prizenum2,prizemoney2; TextView prizename3,prizenum3,prizemoney3; TextView prizename4,prizenum4,prizemoney4; TextView prizename5,prizenum5,prizemoney5; TextView prizename6,prizenum6,prizemoney6; @Override void initLotnoDetailViewWidget() { prizeBatchCode = (TextView)view.findViewById(R.id.prizedetail_batchcode); prizeDate = (TextView)view.findViewById(R.id.prizedetail_prizeData); ballLinear = (LinearLayout)view.findViewById(R.id.prizedetail_numball); totalsellmoney = (TextView)view.findViewById(R.id.prizedetail_totalsellmoney); prizepoolmoney = (TextView)view.findViewById(R.id.prizedetail_prizepoolmoney); prizename1 = (TextView)view.findViewById(R.id.prizedetail_prizename1); prizename2 = (TextView)view.findViewById(R.id.prizedetail_prizename2); prizename3 = (TextView)view.findViewById(R.id.prizedetail_prizename3); prizename4 = (TextView)view.findViewById(R.id.prizedetail_prizename4); prizename5 = (TextView)view.findViewById(R.id.prizedetail_prizename5); prizename6 = (TextView)view.findViewById(R.id.prizedetail_prizename6); prizenum1 = (TextView)view.findViewById(R.id.prizedetail_prizenum1); prizenum2 = (TextView)view.findViewById(R.id.prizedetail_prizenum2); prizenum3 = (TextView)view.findViewById(R.id.prizedetail_prizenum3); prizenum4 = (TextView)view.findViewById(R.id.prizedetail_prizenum4); prizenum5 = (TextView)view.findViewById(R.id.prizedetail_prizenum5); prizenum6 = (TextView)view.findViewById(R.id.prizedetail_prizenum6); prizemoney1 =(TextView)view.findViewById(R.id.prizedetail_prizemoney1); prizemoney2 =(TextView)view.findViewById(R.id.prizedetail_prizemoney2); prizemoney3 =(TextView)view.findViewById(R.id.prizedetail_prizemoney3); prizemoney4 =(TextView)view.findViewById(R.id.prizedetail_prizemoney4); prizemoney5 =(TextView)view.findViewById(R.id.prizedetail_prizemoney5); prizemoney6 =(TextView)view.findViewById(R.id.prizedetail_prizemoney6); prizename1.setText(R.string.prizedetail_fristprize); prizename2.setText(R.string.prizedetail_secondprize); prizename3.setText(R.string.prizedetail_thirdprize); prizename4.setText(R.string.prizedetail_fourthprize); prizename5.setText(R.string.prizedetail_fifthprize); prizename6.setText(R.string.prizedetail_sixthprize); } @Override public void initLotonoView(JSONObject ssqPrizeDetailJson) throws JSONException { // TODO Auto-generated method stub prizeBatchCode.setText("七星彩 第"+ssqPrizeDetailJson.getString("batchCode")+"期"); prizeDate.setText(context.getString(R.string.prizedetail_opentime)+ssqPrizeDetailJson.getString("openTime")); String prizeNum = ssqPrizeDetailJson.getString("winNo"); PrizeBallLinearLayout prizeBallLinear = new PrizeBallLinearLayout(context, ballLinear, Constants.QXCLABEL, prizeNum); prizeBallLinear.initQXCBallLinear(); totalsellmoney.setText(context.getString(R.string.prizedetail_thebatchcodeamt)+PublicMethod.toIntYuan(ssqPrizeDetailJson.getString("sellTotalAmount"))+context.getString(R.string.game_card_yuan)); prizepoolmoney.setText(context.getString(R.string.prizedetail_theprizepoolamt)+PublicMethod.toIntYuan(ssqPrizeDetailJson.getString("prizePoolTotalAmount"))+context.getString(R.string.game_card_yuan)); prizenum1.setText(ssqPrizeDetailJson.getString("onePrizeNum")); prizenum2.setText(ssqPrizeDetailJson.getString("twoPrizeNum")); prizenum3.setText(ssqPrizeDetailJson.getString("threePrizeNum")); prizenum4.setText(ssqPrizeDetailJson.getString("fourPrizeNum")); prizenum5.setText(ssqPrizeDetailJson.getString("fivePrizeNum")); prizenum6.setText(ssqPrizeDetailJson.getString("sixPrizeNum")); prizemoney1.setText(PublicMethod.toIntYuan(ssqPrizeDetailJson.getString("onePrizeAmt"))); prizemoney2.setText(PublicMethod.toIntYuan(ssqPrizeDetailJson.getString("twoPrizeAmt"))); prizemoney3.setText(PublicMethod.toIntYuan(ssqPrizeDetailJson.getString("threePrizeAmt"))); prizemoney4.setText(PublicMethod.toIntYuan(ssqPrizeDetailJson.getString("fourPrizeAmt"))); prizemoney5.setText(PublicMethod.toIntYuan(ssqPrizeDetailJson.getString("fivePrizeAmt"))); prizemoney6.setText(PublicMethod.toIntYuan(ssqPrizeDetailJson.getString("sixPrizeAmt"))); } }
[ "zxflimit@gmail.com" ]
zxflimit@gmail.com
ae5bec3efde4d97f0de33add1b45145954ec605f
ac09a467d9981f67d346d1a9035d98f234ce38d5
/leetcode/src/main/java/org/leetcode/problems/_000684_RedundantConnection.java
df8c3dfc1dd5b40fdcf9e9e1b6fd8604657b746f
[]
no_license
AlexKokoz/leetcode
03c9749c97c846c4018295008095ac86ae4951ee
9449593df72d86dadc4c470f1f9698e066632859
refs/heads/master
2023-02-23T13:56:38.978851
2023-02-12T21:21:54
2023-02-12T21:21:54
232,152,255
0
0
null
null
null
null
UTF-8
Java
false
false
540
java
package org.leetcode.problems; /** * * EASY * * @author akokozidis * */ public class _000684_RedundantConnection { public int[] findRedundantConnection(int[][] edges) { int[] id = new int[edges.length + 1]; for (int i = 1; i < id.length; i++) id[i] = i; for (int[] edge : edges) { int v = edge[0]; int w = edge[1]; int p = find(v, id); int q = find(w, id); if (p == q) return edge; id[p] = q; } return new int[2]; } int find(int v, int[] id) { while (id[v] != v) v = id[v]; return v; } }
[ "alexandros.kokozidis@gmail.com" ]
alexandros.kokozidis@gmail.com
0c8c9c0906dd9b9602c767dabfd58777c81e5b4a
2da705ba188bb9e4a0888826818f1b25d04e90c8
/support/cas-server-support-pm/src/test/java/org/apereo/cas/pm/impl/GroovyResourcePasswordManagementServiceTests.java
7411a06af666493e9fef2ae99cebec1ebec9b5cd
[ "LicenseRef-scancode-free-unknown", "Apache-2.0", "LicenseRef-scancode-warranty-disclaimer" ]
permissive
williamadmin/cas
9441fd730de81a5abaf173e2e831a19c9e417579
a4c49ab5137745146afa0f6d41791c2881a344a6
refs/heads/master
2021-05-25T19:05:01.862668
2020-04-07T05:15:53
2020-04-07T05:15:53
253,788,442
1
0
Apache-2.0
2020-04-07T12:37:38
2020-04-07T12:37:37
null
UTF-8
Java
false
false
1,829
java
package org.apereo.cas.pm.impl; import org.apereo.cas.authentication.CoreAuthenticationTestUtils; import org.apereo.cas.config.CasCoreUtilConfiguration; import org.apereo.cas.pm.PasswordChangeRequest; import org.apereo.cas.pm.PasswordManagementService; import org.apereo.cas.pm.config.PasswordManagementConfiguration; import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.cloud.autoconfigure.RefreshAutoConfiguration; import static org.junit.jupiter.api.Assertions.*; /** * This is {@link GroovyResourcePasswordManagementServiceTests}. * * @author Misagh Moayyed * @since 6.1.0 */ @SpringBootTest(classes = { RefreshAutoConfiguration.class, PasswordManagementConfiguration.class, CasCoreUtilConfiguration.class }, properties = { "cas.authn.pm.enabled=true", "cas.authn.pm.groovy.location=classpath:/GroovyPasswordMgmt.groovy" }) @Tag("Groovy") public class GroovyResourcePasswordManagementServiceTests { @Autowired @Qualifier("passwordChangeService") private PasswordManagementService passwordChangeService; @Test public void verifyFindEmail() { assertNotNull(passwordChangeService.findEmail("casuser")); } @Test public void verifyFindUser() { assertNotNull(passwordChangeService.findUsername("casuser@example.org")); } @Test public void verifyChangePassword() { assertTrue(passwordChangeService.change( CoreAuthenticationTestUtils.getCredentialsWithDifferentUsernameAndPassword("casuser", "password"), new PasswordChangeRequest("casuser", "password", "password"))); } }
[ "mm1844@gmail.com" ]
mm1844@gmail.com
bc957950b4ed89af864bfcc5ae952e4822de657f
23a7445ec116d26823eeb1610c4d8dbe22f0b045
/aTalk/src/main/java/net/java/sip/communicator/impl/protocol/jabber/extensions/jingle/PayloadTypePacketExtension.java
beac2d9793ffd49ea7c83f9f778e8203c1d3d12d
[ "Apache-2.0" ]
permissive
Rudloff/atalk-android
e998e9d1787f5aa4c08efb38b1607c0ebdfa52f3
00ff07475bf0233a60ddb6ad93bd0ba4be4f3572
refs/heads/master
2020-03-17T15:27:35.236473
2018-05-07T10:45:33
2018-05-07T10:45:33
133,711,522
1
0
null
2018-05-16T19:06:01
2018-05-16T19:06:00
null
UTF-8
Java
false
false
6,231
java
/* * Jitsi, the OpenSource Java VoIP and Instant Messaging client. * * Distributable under LGPL license. See terms of license at gnu.org. */ package net.java.sip.communicator.impl.protocol.jabber.extensions.jingle; import java.util.List; import net.java.sip.communicator.impl.protocol.jabber.extensions.AbstractPacketExtension; /** * Represents the <tt>payload-type</tt> elements described in XEP-0167. * * @author Emil Ivov * @author Eng Chong Meng */ public class PayloadTypePacketExtension extends AbstractPacketExtension { /** * The name of the "payload-type" element. */ public static final String ELEMENT_NAME = "payload-type"; /** * The name of the <tt>channels</tt> <tt>payload-type</tt> argument. */ public static final String CHANNELS_ATTR_NAME = "channels"; /** * The name of the <tt>clockrate</tt> SDP argument. */ public static final String CLOCKRATE_ATTR_NAME = "clockrate"; /** * The name of the payload <tt>id</tt> SDP argument. */ public static final String ID_ATTR_NAME = "id"; /** * The name of the <tt>maxptime</tt> SDP argument. */ public static final String MAXPTIME_ATTR_NAME = "maxptime"; /** * The name of the <tt>name</tt> SDP argument. */ public static final String NAME_ATTR_NAME = "name"; /** * The name of the <tt>ptime</tt> SDP argument. */ public static final String PTIME_ATTR_NAME = "ptime"; /** * Creates a new {@link PayloadTypePacketExtension} instance. */ public PayloadTypePacketExtension() { super(ELEMENT_NAME, null); } /** * Sets the number of channels in this payload type. If omitted, it will be assumed to contain * one channel. * * @param channels * the number of channels in this payload type. */ public void setChannels(int channels) { super.setAttribute(CHANNELS_ATTR_NAME, channels); } /** * Returns the number of channels in this payload type. * * @return the number of channels in this payload type. */ public int getChannels() { /* * XEP-0167: Jingle RTP Sessions says: if omitted, it MUST be assumed to contain one * channel. */ return getAttributeAsInt(CHANNELS_ATTR_NAME, 1); } /** * Specifies the sampling frequency in Hertz used by this encoding. * * @param clockrate * the sampling frequency in Hertz used by this encoding. */ public void setClockrate(int clockrate) { super.setAttribute(CLOCKRATE_ATTR_NAME, clockrate); } /** * Returns the sampling frequency in Hertz used by this encoding. * * @return the sampling frequency in Hertz used by this encoding. */ public int getClockrate() { return getAttributeAsInt(CLOCKRATE_ATTR_NAME); } /** * Specifies the payload identifier for this encoding. * * @param id * the payload type id */ public void setId(int id) { super.setAttribute(ID_ATTR_NAME, id); } /** * Returns the payload identifier for this encoding (as specified by RFC 3551 or a dynamic one). * * @return the payload identifier for this encoding (as specified by RFC 3551 or a dynamic one). */ public int getID() { return getAttributeAsInt(ID_ATTR_NAME); } /** * Sets the maximum packet time as specified in RFC 4566. * * @param maxptime * the maximum packet time as specified in RFC 4566 */ public void setMaxptime(int maxptime) { setAttribute(MAXPTIME_ATTR_NAME, maxptime); } /** * Returns maximum packet time as specified in RFC 4566. * * @return maximum packet time as specified in RFC 4566 */ public int getMaxptime() { return getAttributeAsInt(MAXPTIME_ATTR_NAME); } /** * Sets the packet time as specified in RFC 4566. * * @param ptime * the packet time as specified in RFC 4566 */ public void setPtime(int ptime) { super.setAttribute(PTIME_ATTR_NAME, ptime); } /** * Returns packet time as specified in RFC 4566. * * @return packet time as specified in RFC 4566 */ public int getPtime() { return getAttributeAsInt(PTIME_ATTR_NAME); } /** * Sets the name of the encoding, or as per the XEP: the appropriate subtype of the MIME type. * Setting this field is RECOMMENDED for static payload types, REQUIRED for dynamic payload * types. * * @param name * the name of this encoding. */ public void setName(String name) { setAttribute(NAME_ATTR_NAME, name); } /** * Returns the name of the encoding, or as per the XEP: the appropriate subtype of the MIME * type. Setting this field is RECOMMENDED for static payload types, REQUIRED for dynamic * payload types. * * @return the name of the encoding, or as per the XEP: the appropriate subtype of the MIME * type. Setting this field is RECOMMENDED for static payload types, REQUIRED for * dynamic payload types. */ public String getName() { return getAttributeAsString(NAME_ATTR_NAME); } /** * Adds an SDP parameter to the list that we already have registered for this payload type. * * @param parameter * an SDP parameter for this encoding. */ public void addParameter(ParameterPacketExtension parameter) { // parameters are the only extensions we can have so let's use // super's list. addChildExtension(parameter); } /** * Returns a <b>reference</b> to the the list of parameters currently registered for this * payload type. * * @return a <b>reference</b> to the the list of parameters currently registered for this * payload type. */ public List<ParameterPacketExtension> getParameters() { return getChildExtensionsOfType(ParameterPacketExtension.class); } /** * Adds an RTCP feedback type to the list that we already have registered for this payload type. * * @param rtcpFbPacketExtension * RTCP feedback type for this encoding. */ public void addRtcpFeedbackType(RtcpFbPacketExtension rtcpFbPacketExtension) { addChildExtension(rtcpFbPacketExtension); } /** * Returns the list of RTCP feedback types currently registered for this payload type. * * @return the list of RTCP feedback types currently registered for this payload type. */ public List<RtcpFbPacketExtension> getRtcpFeedbackTypeList() { return getChildExtensionsOfType(RtcpFbPacketExtension.class); } }
[ "cmeng.gm@gmail.com" ]
cmeng.gm@gmail.com
5317d1e794f396152a35d67095a5991213f242bf
29acc5b6a535dfbff7c625f5513871ba55554dd2
/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/xspec/ListAppendFunction.java
ed1d6773aa68e6b5468e16b0f2c706a36a5bbeff
[ "JSON", "Apache-2.0" ]
permissive
joecastro/aws-sdk-java
b2d25f6a503110d156853836b49390d2889c4177
fdbff1d42a73081035fa7b0f172b9b5c30edf41f
refs/heads/master
2021-01-21T16:52:46.982971
2016-01-11T22:55:28
2016-01-11T22:55:28
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,580
java
/* * Copyright 2015-2016 Amazon Technologies, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at: * * http://aws.amazon.com/apache2.0 * * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES * OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and * limitations under the License. */ package com.amazonaws.services.dynamodbv2.xspec; import com.amazonaws.annotation.Beta; /** * Represents the <a href= * "http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.Modifying.html" * >list_append(operand, operand)</a> function in building expression. * <p> * "list_append (operand, operand) ??? This function evaluates to a list with a * new element added to it. You can append the new element to the start or the * end of the list by reversing the order of the operands." * <p> * This object is as immutable (or unmodifiable) as the values in it's operands. */ @Beta public final class ListAppendFunction extends FunctionOperand { private final Operand first; private final Operand second; ListAppendFunction(Operand first, Operand second) { this.first = first; this.second = second; } @Override String asSubstituted(SubstitutionContext context) { return "list_append(" + first.asSubstituted(context) + ", " + second.asSubstituted(context) + ")"; } }
[ "aws@amazon.com" ]
aws@amazon.com
22c71a099fa62efa2608174170de60a868bf49ab
f61f16b03d4a73ca19c5e2e5fb22deae12d96af3
/src/javaFundamental/CompareTo.java
cf590d9cace50513d2e6ca68224ba1fc13e128ba
[]
no_license
cayori/kh
47d49d50597aa3d618443f9f9d24bc2f27952e4f
19df8a004956b46b139133cb4b7ec1b263f782c6
refs/heads/master
2021-07-04T04:24:55.124924
2017-09-25T23:54:08
2017-09-25T23:54:08
103,261,961
0
0
null
null
null
null
UTF-8
Java
false
false
197
java
package javaFundamental; public class CompareTo { public static void main(String[] args) { int c; String s1 = "A"; String s2 = "Z"; c = s1.compareTo(s2); System.out.println(c); } }
[ "cayori@gmail.com" ]
cayori@gmail.com
1a225b980b5f8d9599cd08ad1ab66a430cb336c6
23b6d6971a66cf057d1846e3b9523f2ad4e05f61
/MLMN-Statistics/src/vn/com/vhc/vmsc2/statistics/dao/MonitorKpi2gMailDAO.java
23be442dc712268d0c8ca7c7a1bdbf8276a64eea
[]
no_license
vhctrungnq/mlmn
943f5a44f24625cfac0edc06a0d1b114f808dfb8
d3ba1f6eebe2e38cdc8053f470f0b99931085629
refs/heads/master
2020-03-22T13:48:30.767393
2018-07-08T05:14:12
2018-07-08T05:14:12
140,132,808
0
1
null
2018-07-08T05:29:27
2018-07-08T02:57:06
Java
UTF-8
Java
false
false
778
java
package vn.com.vhc.vmsc2.statistics.dao; import java.util.List; import vn.com.vhc.vmsc2.statistics.domain.MonitorKpi2gMail; public interface MonitorKpi2gMailDAO { /** * This method was generated by Apache iBATIS ibator. * This method corresponds to the database table MONITOR_KPI_2G_MAIL * * @ibatorgenerated Fri May 11 15:57:17 ICT 2018 */ void insert(MonitorKpi2gMail record); /** * This method was generated by Apache iBATIS ibator. * This method corresponds to the database table MONITOR_KPI_2G_MAIL * * @ibatorgenerated Fri May 11 15:57:17 ICT 2018 */ void insertSelective(MonitorKpi2gMail record); List<MonitorKpi2gMail> getDataList(String startDate, String endDate); }
[ "trungnq@vhc.com.vn" ]
trungnq@vhc.com.vn
6ebc9a01a753dc4635e12a0b29c9630ec956f179
b41cde8d057cf54c2e9b0995d35d053e31f04a2a
/sdk/src/main/java/com/google/cloud/dataflow/sdk/util/NoopStager.java
b54018c49c4d98381fd0d605a2e50f4ddf677274
[ "Apache-2.0" ]
permissive
mxm/DataflowJavaSDK
37d00fe3c1fb0cdd61e0fe248224d8b74c96d120
1a4a54a9b81568af549b7cf5ac893517e5febf3b
refs/heads/master
2021-01-15T21:08:00.879690
2015-02-20T13:47:56
2015-02-20T13:48:49
31,066,732
0
0
null
2015-02-20T13:49:22
2015-02-20T13:49:21
null
UTF-8
Java
false
false
1,166
java
/* * Copyright (C) 2014 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations under * the License. */ package com.google.cloud.dataflow.sdk.util; import com.google.api.services.dataflow.model.DataflowPackage; import com.google.cloud.dataflow.sdk.options.PipelineOptions; import java.util.ArrayList; import java.util.List; /** * Do-nothing stager class. stageFiles() does nothing and returns an empty list of packages. */ class NoopStager implements Stager { public static NoopStager fromOptions(PipelineOptions options) { return new NoopStager(); } @Override public List<DataflowPackage> stageFiles() { return new ArrayList<DataflowPackage>(); } }
[ "davorbonaci@users.noreply.github.com" ]
davorbonaci@users.noreply.github.com
80d89ea39b2b72fc2accb8e6b70e7965bf09ab0b
ed7dc923814f6878020ee915d078cf486c30fc46
/INDIVIDUAL EXPERIMENTS/org.xtext.example.mydsl.referencesuntyped.ui/xtend-gen/org/xtext/example/mydsl/referencesuntyped/ui/outline/MyDslOutlineTreeProvider.java
2eddab2d96286078bb7bee69a42534bead37f846
[]
no_license
a24ibrah/XMLText
2aca934ddc42e98233af541f8c57f359ed19dd1f
fa03e63b0ac004da015a7c1844c5f7d374bca9fc
refs/heads/master
2020-07-23T18:57:15.976381
2017-06-02T15:20:31
2017-06-02T15:20:31
null
0
0
null
null
null
null
UTF-8
Java
false
false
398
java
/** * generated by Xtext */ package org.xtext.example.mydsl.referencesuntyped.ui.outline; import org.eclipse.xtext.ui.editor.outline.impl.DefaultOutlineTreeProvider; /** * Customization of the default outline structure. * * see http://www.eclipse.org/Xtext/documentation.html#outline */ @SuppressWarnings("all") public class MyDslOutlineTreeProvider extends DefaultOutlineTreeProvider { }
[ "neubauer@big.tuwien.ac.at" ]
neubauer@big.tuwien.ac.at
da8819eb1f86add77a811cf11ad0879949b84442
ccf94dcb6b1500fcbbd56964ae8c4832a496b8b3
/java/baiduads-sdk-auto/src/test/java/com/baidu/dev2/api/sdk/searchfeed/model/GetOcpcTransFeedResponseWrapperTest.java
b10e4375e58daa79ec7572a74fe5528441845100
[ "Apache-2.0" ]
permissive
baidu/baiduads-sdk
24c36b5cf3da9362ec5c8ecd417ff280421198ff
176363de5e8a4e98aaca039e4300703c3964c1c7
refs/heads/main
2023-06-08T15:40:24.787863
2023-05-20T03:40:51
2023-05-20T03:40:51
446,718,177
16
11
Apache-2.0
2023-06-02T05:19:40
2022-01-11T07:23:17
Python
UTF-8
Java
false
false
1,504
java
/* * dev2 api schema * 'dev2.baidu.com' api schema * * The version of the OpenAPI document: 1.0.1-SNAPSHOT * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ package com.baidu.dev2.api.sdk.searchfeed.model; import com.baidu.dev2.api.sdk.searchfeed.model.GetOcpcTransFeedResponseWrapperBody; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.junit.Assert; import org.junit.Ignore; import org.junit.Test; /** * Model tests for GetOcpcTransFeedResponseWrapper */ public class GetOcpcTransFeedResponseWrapperTest { private final GetOcpcTransFeedResponseWrapper model = new GetOcpcTransFeedResponseWrapper(); /** * Model tests for GetOcpcTransFeedResponseWrapper */ @Test public void testGetOcpcTransFeedResponseWrapper() { // TODO: test GetOcpcTransFeedResponseWrapper } /** * Test the property 'header' */ @Test public void headerTest() { // TODO: test header } /** * Test the property 'body' */ @Test public void bodyTest() { // TODO: test body } }
[ "jiangyuan04@baidu.com" ]
jiangyuan04@baidu.com
9bffc7580335394341f1037d9d7007355c5f5ae1
10186b7d128e5e61f6baf491e0947db76b0dadbc
/org/apache/xerces/parsers/AbstractXMLDocumentParser.java
aafff9431f44a7f75f0abe2ea302121e103c1b34
[ "SMLNJ", "Apache-1.1", "Apache-2.0", "BSD-2-Clause" ]
permissive
MewX/contendo-viewer-v1.6.3
7aa1021e8290378315a480ede6640fd1ef5fdfd7
69fba3cea4f9a43e48f43148774cfa61b388e7de
refs/heads/main
2022-07-30T04:51:40.637912
2021-03-28T05:06:26
2021-03-28T05:06:26
351,630,911
2
0
Apache-2.0
2021-10-12T22:24:53
2021-03-26T01:53:24
Java
UTF-8
Java
false
false
7,755
java
package org.apache.xerces.parsers; import org.apache.xerces.xni.Augmentations; import org.apache.xerces.xni.NamespaceContext; import org.apache.xerces.xni.QName; import org.apache.xerces.xni.XMLAttributes; import org.apache.xerces.xni.XMLDTDContentModelHandler; import org.apache.xerces.xni.XMLDTDHandler; import org.apache.xerces.xni.XMLDocumentHandler; import org.apache.xerces.xni.XMLLocator; import org.apache.xerces.xni.XMLResourceIdentifier; import org.apache.xerces.xni.XMLString; import org.apache.xerces.xni.XNIException; import org.apache.xerces.xni.parser.XMLDTDContentModelSource; import org.apache.xerces.xni.parser.XMLDTDSource; import org.apache.xerces.xni.parser.XMLDocumentSource; import org.apache.xerces.xni.parser.XMLParserConfiguration; public abstract class AbstractXMLDocumentParser extends XMLParser implements XMLDTDContentModelHandler, XMLDTDHandler, XMLDocumentHandler { protected boolean fInDTD; protected XMLDocumentSource fDocumentSource; protected XMLDTDSource fDTDSource; protected XMLDTDContentModelSource fDTDContentModelSource; protected AbstractXMLDocumentParser(XMLParserConfiguration paramXMLParserConfiguration) { super(paramXMLParserConfiguration); paramXMLParserConfiguration.setDocumentHandler(this); paramXMLParserConfiguration.setDTDHandler(this); paramXMLParserConfiguration.setDTDContentModelHandler(this); } public void startDocument(XMLLocator paramXMLLocator, String paramString, NamespaceContext paramNamespaceContext, Augmentations paramAugmentations) throws XNIException {} public void xmlDecl(String paramString1, String paramString2, String paramString3, Augmentations paramAugmentations) throws XNIException {} public void doctypeDecl(String paramString1, String paramString2, String paramString3, Augmentations paramAugmentations) throws XNIException {} public void startElement(QName paramQName, XMLAttributes paramXMLAttributes, Augmentations paramAugmentations) throws XNIException {} public void emptyElement(QName paramQName, XMLAttributes paramXMLAttributes, Augmentations paramAugmentations) throws XNIException { startElement(paramQName, paramXMLAttributes, paramAugmentations); endElement(paramQName, paramAugmentations); } public void characters(XMLString paramXMLString, Augmentations paramAugmentations) throws XNIException {} public void ignorableWhitespace(XMLString paramXMLString, Augmentations paramAugmentations) throws XNIException {} public void endElement(QName paramQName, Augmentations paramAugmentations) throws XNIException {} public void startCDATA(Augmentations paramAugmentations) throws XNIException {} public void endCDATA(Augmentations paramAugmentations) throws XNIException {} public void endDocument(Augmentations paramAugmentations) throws XNIException {} public void startGeneralEntity(String paramString1, XMLResourceIdentifier paramXMLResourceIdentifier, String paramString2, Augmentations paramAugmentations) throws XNIException {} public void textDecl(String paramString1, String paramString2, Augmentations paramAugmentations) throws XNIException {} public void endGeneralEntity(String paramString, Augmentations paramAugmentations) throws XNIException {} public void comment(XMLString paramXMLString, Augmentations paramAugmentations) throws XNIException {} public void processingInstruction(String paramString, XMLString paramXMLString, Augmentations paramAugmentations) throws XNIException {} public void setDocumentSource(XMLDocumentSource paramXMLDocumentSource) { this.fDocumentSource = paramXMLDocumentSource; } public XMLDocumentSource getDocumentSource() { return this.fDocumentSource; } public void startDTD(XMLLocator paramXMLLocator, Augmentations paramAugmentations) throws XNIException { this.fInDTD = true; } public void startExternalSubset(XMLResourceIdentifier paramXMLResourceIdentifier, Augmentations paramAugmentations) throws XNIException {} public void endExternalSubset(Augmentations paramAugmentations) throws XNIException {} public void startParameterEntity(String paramString1, XMLResourceIdentifier paramXMLResourceIdentifier, String paramString2, Augmentations paramAugmentations) throws XNIException {} public void endParameterEntity(String paramString, Augmentations paramAugmentations) throws XNIException {} public void ignoredCharacters(XMLString paramXMLString, Augmentations paramAugmentations) throws XNIException {} public void elementDecl(String paramString1, String paramString2, Augmentations paramAugmentations) throws XNIException {} public void startAttlist(String paramString, Augmentations paramAugmentations) throws XNIException {} public void attributeDecl(String paramString1, String paramString2, String paramString3, String[] paramArrayOfString, String paramString4, XMLString paramXMLString1, XMLString paramXMLString2, Augmentations paramAugmentations) throws XNIException {} public void endAttlist(Augmentations paramAugmentations) throws XNIException {} public void internalEntityDecl(String paramString, XMLString paramXMLString1, XMLString paramXMLString2, Augmentations paramAugmentations) throws XNIException {} public void externalEntityDecl(String paramString, XMLResourceIdentifier paramXMLResourceIdentifier, Augmentations paramAugmentations) throws XNIException {} public void unparsedEntityDecl(String paramString1, XMLResourceIdentifier paramXMLResourceIdentifier, String paramString2, Augmentations paramAugmentations) throws XNIException {} public void notationDecl(String paramString, XMLResourceIdentifier paramXMLResourceIdentifier, Augmentations paramAugmentations) throws XNIException {} public void startConditional(short paramShort, Augmentations paramAugmentations) throws XNIException {} public void endConditional(Augmentations paramAugmentations) throws XNIException {} public void endDTD(Augmentations paramAugmentations) throws XNIException { this.fInDTD = false; } public void setDTDSource(XMLDTDSource paramXMLDTDSource) { this.fDTDSource = paramXMLDTDSource; } public XMLDTDSource getDTDSource() { return this.fDTDSource; } public void startContentModel(String paramString, Augmentations paramAugmentations) throws XNIException {} public void any(Augmentations paramAugmentations) throws XNIException {} public void empty(Augmentations paramAugmentations) throws XNIException {} public void startGroup(Augmentations paramAugmentations) throws XNIException {} public void pcdata(Augmentations paramAugmentations) throws XNIException {} public void element(String paramString, Augmentations paramAugmentations) throws XNIException {} public void separator(short paramShort, Augmentations paramAugmentations) throws XNIException {} public void occurrence(short paramShort, Augmentations paramAugmentations) throws XNIException {} public void endGroup(Augmentations paramAugmentations) throws XNIException {} public void endContentModel(Augmentations paramAugmentations) throws XNIException {} public void setDTDContentModelSource(XMLDTDContentModelSource paramXMLDTDContentModelSource) { this.fDTDContentModelSource = paramXMLDTDContentModelSource; } public XMLDTDContentModelSource getDTDContentModelSource() { return this.fDTDContentModelSource; } protected void reset() throws XNIException { super.reset(); this.fInDTD = false; } } /* Location: /mnt/r/ConTenDoViewer.jar!/org/apache/xerces/parsers/AbstractXMLDocumentParser.class * Java compiler version: 3 (47.0) * JD-Core Version: 1.1.3 */
[ "xiayuanzhong+gpg2020@gmail.com" ]
xiayuanzhong+gpg2020@gmail.com
211d92508803273a6e09497bdbb5569749ab25ba
44e0b10a1e98587ea4cf9067b0de39937f5de081
/src/main/java/com/cdkj/ylq/dto/res/XN802167Res.java
431c38f42a33c5d34f78c72c61b256dcc608440d
[]
no_license
ibisTime/xn-ylq
96df9254746f4d7017865f45908a9d93269d3876
937e475780d80c1fb29659878effd060e28a1b94
refs/heads/master
2021-01-16T11:29:30.662194
2018-01-05T09:57:20
2018-01-05T09:57:20
99,996,279
0
6
null
null
null
null
UTF-8
Java
false
false
623
java
/** * @Title XN802166Res.java * @Package com.std.account.dto.res * @Description * @author leo(haiqing) * @date 2017年9月15日 下午12:54:59 * @version V1.0 */ package com.cdkj.ylq.dto.res; /** * @author: haiqingzheng * @since: 2017年9月15日 下午12:54:59 * @history: */ public class XN802167Res { private boolean isSuccess; public XN802167Res(boolean isSuccess) { super(); this.isSuccess = isSuccess; } public boolean isSuccess() { return isSuccess; } public void setSuccess(boolean isSuccess) { this.isSuccess = isSuccess; } }
[ "leo.zheng@hichengdai.com" ]
leo.zheng@hichengdai.com
6d56a48fe1a2033ca66c8c6d5af8edd89100e046
7569f9a68ea0ad651b39086ee549119de6d8af36
/cocoon-2.1.9/src/blocks/forms/java/org/apache/cocoon/forms/datatype/typeimpl/AbstractDatatype.java
00a039f97e2a7898680a78e5a9fa5ed4a566d063
[ "Apache-2.0" ]
permissive
tpso-src/cocoon
844357890f8565c4e7852d2459668ab875c3be39
f590cca695fd9930fbb98d86ae5f40afe399c6c2
refs/heads/master
2021-01-10T02:45:37.533684
2015-07-29T18:47:11
2015-07-29T18:47:11
44,549,791
0
0
null
null
null
null
UTF-8
Java
false
false
3,855
java
/* * Copyright 1999-2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.cocoon.forms.datatype.typeimpl; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.Locale; import org.apache.cocoon.forms.datatype.Datatype; import org.apache.cocoon.forms.datatype.DatatypeBuilder; import org.apache.cocoon.forms.datatype.ValidationRule; import org.apache.cocoon.forms.datatype.convertor.Convertor; import org.apache.cocoon.forms.datatype.convertor.ConversionResult; import org.apache.cocoon.forms.validation.ValidationError; import org.apache.cocoon.forms.FormsConstants; import org.apache.cocoon.xml.AttributesImpl; import org.outerj.expression.ExpressionContext; import org.xml.sax.ContentHandler; import org.xml.sax.SAXException; /** * Abstract base class for Datatype implementations. Most concreate datatypes * will derive from this class. * @version $Id: AbstractDatatype.java 370089 2006-01-18 09:26:09Z jbq $ */ public abstract class AbstractDatatype implements Datatype { private List validationRules = new ArrayList(); private boolean arrayType = false; private DatatypeBuilder builder; private Convertor convertor; public ValidationError validate(Object value, ExpressionContext expressionContext) { Iterator validationRulesIt = validationRules.iterator(); while (validationRulesIt.hasNext()) { ValidationRule validationRule = (ValidationRule)validationRulesIt.next(); ValidationError result = validationRule.validate(value, expressionContext); if (result != null) return result; } return null; } public void addValidationRule(ValidationRule validationRule) { validationRules.add(validationRule); } public boolean isArrayType() { return arrayType; } protected void setArrayType(boolean arrayType) { this.arrayType = arrayType; } public void setConvertor(Convertor convertor) { this.convertor = convertor; } protected void setBuilder(DatatypeBuilder builder) { this.builder = builder; } public Convertor getPlainConvertor() { return builder.getPlainConvertor(); } public DatatypeBuilder getBuilder() { return builder; } public Convertor getConvertor() { return convertor; } public ConversionResult convertFromString(String value, Locale locale) { return getConvertor().convertFromString(value, locale, null); } public String convertToString(Object value, Locale locale) { return getConvertor().convertToString(value, locale, null); } private static final String DATATYPE_EL = "datatype"; public void generateSaxFragment(ContentHandler contentHandler, Locale locale) throws SAXException { AttributesImpl attrs = new AttributesImpl(); attrs.addCDATAAttribute("type", getDescriptiveName()); contentHandler.startElement(FormsConstants.INSTANCE_NS, DATATYPE_EL, FormsConstants.INSTANCE_PREFIX_COLON + DATATYPE_EL, attrs); getConvertor().generateSaxFragment(contentHandler, locale); contentHandler.endElement(FormsConstants.INSTANCE_NS, DATATYPE_EL, FormsConstants.INSTANCE_PREFIX_COLON + DATATYPE_EL); } }
[ "ms@tpso.com" ]
ms@tpso.com
badcb80b3815a4d3976527a94830c60926d4dc7a
46b85208c7dfd1249ff5c2f263cdb0e742bff8da
/solon/src/main/java/org/noear/solon/core/util/IoUtil.java
5a5858fb379863415ff3b6f3cf9cccd3156ac31e
[ "Apache-2.0" ]
permissive
noear/solon
1c0a78c5ab2bec45a67fcf772f582f9cb4894fab
63f3f49cddcbfa8bd6d596998735f0704e8d43f8
refs/heads/master
2023-08-31T09:10:32.303640
2023-08-30T14:13:27
2023-08-30T14:13:27
140,086,420
1,687
187
Apache-2.0
2023-09-10T10:31:54
2018-07-07T13:23:50
Java
UTF-8
Java
false
false
2,625
java
package org.noear.solon.core.util; import org.noear.solon.Solon; import org.noear.solon.Utils; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; /** * 输入输出工具 * * @author noear * @since 2.4 */ public class IoUtil { public static String transferToString(InputStream ins) throws IOException { return transferToString(ins, Solon.encoding()); } /** * 将输入流转换为字符串 * * @param ins 输入流 * @param charset 字符集 */ public static String transferToString(InputStream ins, String charset) throws IOException { if (ins == null) { return null; } ByteArrayOutputStream outs = transferTo(ins, new ByteArrayOutputStream()); if (Utils.isEmpty(charset)) { return outs.toString(); } else { return outs.toString(charset); } } /** * 将输入流转换为byte数组 * * @param ins 输入流 */ public static byte[] transferToBytes(InputStream ins) throws IOException { if (ins == null) { return null; } return transferTo(ins, new ByteArrayOutputStream()).toByteArray(); } /** * 将输入流转换为输出流 * * @param ins 输入流 * @param out 输出流 */ public static <T extends OutputStream> T transferTo(InputStream ins, T out) throws IOException { if (ins == null || out == null) { return null; } int len = 0; byte[] buf = new byte[512]; while ((len = ins.read(buf)) != -1) { out.write(buf, 0, len); } return out; } /** * 将输入流转换为输出流 * * @param ins 输入流 * @param out 输出流 * @param start 开始位 * @param length 长度 */ public static <T extends OutputStream> T transferTo(InputStream ins, T out, long start, long length) throws IOException { int len = 0; byte[] buf = new byte[512]; int bufMax = buf.length; if (length < bufMax) { bufMax = (int) length; } if (start > 0) { ins.skip(start); } while ((len = ins.read(buf, 0, bufMax)) != -1) { out.write(buf, 0, len); length -= len; if (bufMax > length) { bufMax = (int) length; if (bufMax == 0) { break; } } } return out; } }
[ "noear@live.cn" ]
noear@live.cn
71adc535145f57e8692d5273f3df154a5d618fb6
48e835e6f176a8ac9ae3ca718e8922891f1e5a18
/benchmark/validation/uk/gov/gchq/gaffer/sketches/datasketches/frequencies/serialisation/StringsSketchSerialiserTest.java
91211a5dd55846dd424bf57f4469f4d5e9a9d490
[]
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,198
java
/** * Copyright 2017-2019 Crown Copyright * * 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 uk.gov.gchq.gaffer.sketches.datasketches.frequencies.serialisation; import com.yahoo.sketches.frequencies.ItemsSketch; import org.junit.Assert; import org.junit.Test; import uk.gov.gchq.gaffer.sketches.clearspring.cardinality.serialisation.ViaCalculatedValueSerialiserTest; public class StringsSketchSerialiserTest extends ViaCalculatedValueSerialiserTest<ItemsSketch<String>, Long> { @Test public void testCanHandleItemsSketch() { Assert.assertTrue(serialiser.canHandle(ItemsSketch.class)); Assert.assertFalse(serialiser.canHandle(String.class)); } }
[ "benjamin.danglot@inria.fr" ]
benjamin.danglot@inria.fr
112058daba7d5fe57e56a0fcc8ec446492421246
bd59f9a9b7bf598a1168299dce0b1e07b91c8729
/src/main/java/com/geekq/miaosha/service/rpchander/RpcCompensateService.java
43fd0ff0bceb731b86d8a835e584d9899ce14f75
[]
no_license
jiayangchen/miaosha
8425be8ad35d4a512c8a53302c03b43517d94b98
3dc731e70195176f49d5e021e0af954368e74270
refs/heads/master
2020-04-18T01:01:10.107267
2019-01-22T15:19:03
2019-01-22T15:19:03
167,101,943
3
0
null
2019-01-23T02:21:49
2019-01-23T02:21:49
null
UTF-8
Java
false
false
3,770
java
package com.geekq.miaosha.service.rpchander; import com.geekq.miaosha.common.SnowflakeIdWorker; import com.geekq.miaosha.common.resultbean.ResultGeekQ; import com.geekq.miaosha.service.rpchander.enums.PlanStepStatus; import com.geekq.miaosha.service.rpchander.enums.PlanStepType; import com.geekq.miaosha.service.rpchander.vo.HandlerParam; import com.geekq.miaosha.service.rpchander.vo.PlanOrder; import com.geekq.miaosha.service.rpchander.vo.PlanStep; import org.springframework.stereotype.Service; import java.util.ArrayList; import java.util.Date; import java.util.List; @Service public class RpcCompensateService { public ResultGeekQ<String> recharge(){ ResultGeekQ<String> result = ResultGeekQ.build(); /** * 各种校验check */ /** * 需要可加redis分布式锁 */ /** * 拦截 * 校验状态 -- init 或 ROLLING_BACK则 返回 * * 成功则返回已处理状态 */ /** * 生成订单和处理步骤 */ /** * 获取订单 */ long orderId = SnowflakeIdWorker.getOrderId(1,1); /** * 创建订单步骤 可定义一个VO * 一个planorder 对应多个planstep * 创建 PlanOrder 创建 planStep * createOrderStep(vo); */ // PlanOrder planOrder = new PlanOrder(); // planOrder.setCreateTime(new Date()); // planOrder.setVersion(0); // planOrder.setUserId(inputVo.getUserId()); // planOrder.setOrderNo(inputVo.getOrderNo()); // planOrder.setType(PlanOrderType.X_RECHARGE.name()); // planOrder.setParams(params); // planOrder.setStatus(PlanOrderStatus.INIT.name()); // planOrderDao.insertSelective(planOrder); // // List<PlanStep> steps = new ArrayList<>(); // //第一步请求民生 // steps.add(planStepLogic.buildStep(planOrder.getId(), PlanStepType.X_RECHARGE_CMBC, PlanStepStatus.INIT)); // if (inputVo.getCouponId() != null) { // //第二步使用优惠券 // steps.add(planStepLogic.buildStep(planOrder.getId(), PlanStepType.X_RECHARGE_USE_COUPON, PlanStepStatus.INIT)); // } // //第三步减扣主账户 // steps.add(planStepLogic.buildStep(planOrder.getId(), PlanStepType.X_RECHARGE_POINT, PlanStepStatus.INIT)); // //第四部减扣子账户 // steps.add(planStepLogic.buildStep(planOrder.getId(), PlanStepType.X_RECHARGE_SUB_POINT, PlanStepStatus.INIT)); // //第五步发送通知 // steps.add(planStepLogic.buildStep(planOrder.getId(), PlanStepType.X_RECHARGE_NOTIFY, PlanStepStatus.INIT)); // // planStepDao.batchInsert(steps); /** * * 调用Rpc接口 第几步错误则回滚前几步 * 并更新step状态 * * 然后定时任务去处理 状态为INIT与ROLLBACK的 状态订单 * * */ // HandlerParam handlerParam = new HandlerParam(); // handlerParam.setPlanOrder(planOrder); // AutoInvestPlanRechargeOrderInputVo inputVo = JsonUtil.jsonToBean(planOrder.getParams(), AutoInvestPlanRechargeOrderInputVo.class); // handlerParam.setInputVo(inputVo); // for (int i = 0; i < planStepList.size(); i++) { // PlanStep planStep = planStepList.get(i); // PlanStepType stepType = PlanStepType.valueOf(planStep.getType()); // xxx handler = (xxx) xxxx.getApplicationContext().getBean(stepType.getHandler()); // boolean handlerResult = handler.handle(handlerParam); // if (!handlerResult) { // break; // } // } return result; } }
[ "qiurunze@youxin.com" ]
qiurunze@youxin.com
02eabb0269f54006c6b30c3974937413c3f8f409
c9ff26cd1055c64092b4fdefba860f8d4fb1ca82
/src/test/java/com/example/UndertowSSLDemo/UndertowSslDemoApplicationTests.java
11aa0ec21c45df8cc4e189bc9da9ad616758cc11
[]
no_license
JaxYoun/UndertowSSLDemo
607cd71b47d853095b562e215ae7425c4e82b426
98bfa31f3b440380de43322c6a1f0fbf066a476d
refs/heads/master
2021-04-27T03:57:36.965954
2019-07-31T03:59:38
2019-07-31T03:59:38
122,723,811
1
1
null
null
null
null
UTF-8
Java
false
false
353
java
package com.example.UndertowSSLDemo; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; @RunWith(SpringRunner.class) @SpringBootTest public class UndertowSslDemoApplicationTests { @Test public void contextLoads() { } }
[ "gao88jie@qq.com" ]
gao88jie@qq.com
7a37f6bed18527b753f84d057cedc2613bb08203
39ca712287c78ac6ae55887fe857318bf23ac9d7
/trunk/src/factory/ranger/view/VendorPanel.java
3280202cca7465884f76353e6e1344df5827c14e
[]
no_license
BGCX067/factory-ranger-svn-to-git
4415a52d3c3c6efa1d1a0fde5edaab223a0df6a2
b19a9160d974754d0b57c93a4a05fb8a8235bb80
refs/heads/master
2016-09-01T08:55:03.339705
2015-12-28T14:39:12
2015-12-28T14:39:12
48,871,930
0
0
null
null
null
null
UTF-8
Java
false
false
3,532
java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package factory.ranger.view; import factory.ranger.model.ListVendor; import factory.ranger.model.Machine; import factory.ranger.model.Vendor; import factory.ranger.utility.Input; import java.awt.Color; import java.awt.Dimension; import java.awt.Font; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import java.awt.Rectangle; import java.io.IOException; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JTextArea; import javax.swing.ScrollPaneConstants; /** * * @author axioo */ public class VendorPanel extends JPanel{ public VendorPanel(){ } public String getString(Vendor vendor, int i){ String temp = ""; temp += "[vendor "+vendor.getName() +"]\n"; temp += " position\t\t: ("+vendor.getPosition().x+", "+vendor.getPosition().y+")\n"; temp += " available machines\t: "; Machine[] m = ListVendor.getSingleton().getListVendor().get(i).getListOfMachines(); for(int j=1; j<m.length; j++){ if(j<m.length-1) temp += vendor.getListOfMachines()[j].getNumber()+", "; else temp += vendor.getListOfMachines()[j].getNumber(); } temp += "\n"; return temp; } public JScrollPane getContent() throws IOException { Dimension d = new Dimension(570,360); JPanel panel = new JPanel(new GridBagLayout()); panel.setBounds(new Rectangle(d)); panel.setBackground(new Color(229, 224, 181)); //panel.setOpaque(false); GridBagConstraints gbc= new GridBagConstraints(); gbc.weightx = 1.0; gbc.gridx = 0; gbc.gridy = 0; gbc.anchor = GridBagConstraints.FIRST_LINE_START; //bottom of space for (int i=0;i<ListVendor.getSingleton().getListVendor().size();i++){ panel.add(getPanel(i, ListVendor.getSingleton().getListVendor().get(i)), gbc); gbc.gridy++; } return new JScrollPane(panel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED , ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED); } private JPanel getPanel(int mesinke, Vendor vendor) throws IOException { JPanel panel = new JPanel(new GridBagLayout()); panel.setOpaque(false); GridBagConstraints gbc = new GridBagConstraints(); int x = 0; gbc.gridx = 0; gbc.gridy = 0; gbc.gridwidth = 2; gbc.anchor = GridBagConstraints.FIRST_LINE_START; //bottom of space gbc.insets.set(15, 10, 0, 0); JTextArea no_machine = new JTextArea(); no_machine.setEditable(false); no_machine.setOpaque(false); no_machine.setFont(new Font("Trebuchet MS", 1, 18)); no_machine.setText(getString(vendor, mesinke)); no_machine.setLineWrap(true); no_machine.setBounds(new Rectangle(570, 350)); panel.add(no_machine, gbc); return panel; } public static void main(String[] args) throws IOException { JFrame f = new JFrame(); Input input = new Input("coba.txt"); VendorPanel vpanel = new VendorPanel(); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.add(vpanel.getContent()); f.setSize(400,400); f.setLocation(200,200); f.setVisible(true); } }
[ "you@example.com" ]
you@example.com
89060903d2e2757d0d745c6e5ac253a505bf6bc7
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/24/24_43c91dacd814b55542b120c2de94cab20f676716/StaticCallGraphBuilder/24_43c91dacd814b55542b120c2de94cab20f676716_StaticCallGraphBuilder_s.java
8451088e9c3d25cb395a61860d7d3b1babdff9fe
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
6,044
java
package jkit.jil.stages; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Set; import java.util.Stack; import jkit.jil.stages.NonNullInference.Location; import jkit.jil.tree.*; import jkit.util.*; import jkit.util.graph.*; /** * The purpose of this class is to build a static call graph. That is, a graph * whose edges represent potential calls between methods. More specifically, an * edge from method A to method B exists iff there is an invocation of method B * within method A. Observe that, since the construction process is static, the * edge will exist regardless of whether or not the method is ever be called (in * that context). * * @author djp * */ public class StaticCallGraphBuilder { public static class Node extends Triple<Type.Clazz, String, Type.Function> { public Node(Type.Clazz owner, String name, Type.Function type) { super(owner, name, type); } public Type.Clazz owner() { return first(); } public String name() { return second(); } public Type.Function type() { return third(); } public String toString() { return first() + "." + second() + ":" + type(); } } public static class Edge extends Pair<Node,Node> { public Edge(Node from, Node to) { super(from,to); } public Node from() { return first(); } public Node to() { return second(); } public String toString() { return first() + "->" + second(); } } /** * This represents the call graph. Each node in the call graph is identified * by a triple (O,N,T), where O=owner, N=name and T=type. */ private Graph<Node,Edge> callGraph = new DirectedAdjacencyList(); public void apply(JilClass owner) { // First, we identify all the problem cases. for (JilMethod method : owner.methods()) { build(method,owner); } } protected void build(JilMethod method, JilClass owner) { Node myNode = new Node(owner.type(), method.name(), method.type()); List<JilStmt> body = method.body(); // first, initialiser label map for(JilStmt s : body) { if(s instanceof JilExpr.Invoke) { addCallGraphEdges((JilExpr.Invoke)s, myNode); } } } protected void addCallGraphEdges(JilExpr expr, Node myNode) { if(expr instanceof JilExpr.ArrayIndex) { addCallGraphEdges((JilExpr.ArrayIndex) expr, myNode); } else if(expr instanceof JilExpr.BinOp) { addCallGraphEdges((JilExpr.BinOp) expr, myNode); } else if(expr instanceof JilExpr.UnOp) { addCallGraphEdges((JilExpr.UnOp) expr, myNode); } else if(expr instanceof JilExpr.Cast) { addCallGraphEdges((JilExpr.Cast) expr, myNode); } else if(expr instanceof JilExpr.Convert) { addCallGraphEdges((JilExpr.Convert) expr, myNode); } else if(expr instanceof JilExpr.ClassVariable) { addCallGraphEdges((JilExpr.ClassVariable) expr, myNode); } else if(expr instanceof JilExpr.Deref) { addCallGraphEdges((JilExpr.Deref) expr, myNode); } else if(expr instanceof JilExpr.Variable) { addCallGraphEdges((JilExpr.Variable) expr, myNode); } else if(expr instanceof JilExpr.InstanceOf) { addCallGraphEdges((JilExpr.InstanceOf) expr, myNode); } else if(expr instanceof JilExpr.Invoke) { addCallGraphEdges((JilExpr.Invoke) expr, myNode); } else if(expr instanceof JilExpr.New) { addCallGraphEdges((JilExpr.New) expr, myNode); } else if(expr instanceof JilExpr.Value) { addCallGraphEdges((JilExpr.Value) expr, myNode); } } public void addCallGraphEdges(JilExpr.ArrayIndex expr, Node myNode) { addCallGraphEdges(expr.target(), myNode); addCallGraphEdges(expr.index(), myNode); } public void addCallGraphEdges(JilExpr.BinOp expr, Node myNode) { addCallGraphEdges(expr.lhs(), myNode); addCallGraphEdges(expr.rhs(), myNode); } public void addCallGraphEdges(JilExpr.UnOp expr, Node myNode) { addCallGraphEdges(expr.expr(), myNode); } public void addCallGraphEdges(JilExpr.Cast expr, Node myNode) { addCallGraphEdges(expr.expr(), myNode); } public void addCallGraphEdges(JilExpr.Convert expr, Node myNode) { addCallGraphEdges(expr.expr(), myNode); } public void addCallGraphEdges(JilExpr.ClassVariable expr, Node myNode) { // do nothing! } public void addCallGraphEdges(JilExpr.Deref expr, Node myNode) { addCallGraphEdges(expr.target(), myNode); } public void addCallGraphEdges(JilExpr.Variable expr, Node myNode) { // do nothing! } public void addCallGraphEdges(JilExpr.InstanceOf expr, Node myNode) { addCallGraphEdges(expr.lhs(), myNode); } public void addCallGraphEdges(JilExpr.Invoke expr, Node myNode) { JilExpr target = expr.target(); addCallGraphEdges(target, myNode); for(JilExpr e : expr.parameters()) { addCallGraphEdges(e, myNode); } // Interesting issue here if target is not a class. Could be an array, // for example. Node targetNode = new Node((Type.Clazz) target.type(), expr.name(), expr.funType()); System.out.println("ADDING EDGE: " + myNode + "--> " + targetNode); // Add the call graph edge! callGraph.add(new Edge(myNode,targetNode)); } public void addCallGraphEdges(JilExpr.New expr, Node myNode) { for(JilExpr e : expr.parameters()) { addCallGraphEdges(e, myNode); } // Interesting issue here if target is not a class. Could be an array, // for example. Type.Clazz type = (Type.Clazz) expr.type(); Node targetNode = new Node(type, type.lastComponent().first(), expr .funType()); // Add the call graph edge! callGraph.add(new Edge(myNode,targetNode)); } public void addCallGraphEdges(JilExpr.Value expr, Node myNode) { if(expr instanceof JilExpr.Array) { JilExpr.Array ae = (JilExpr.Array) expr; for(JilExpr v : ae.values()) { addCallGraphEdges(v, myNode); } } } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
2f435dd250e45a1d71cd76250a106a51aded0908
e26fceb0c49ca5865fcf36bd161a168530ae4e69
/OpenAMASE/src/Core/avtas/properties/TestClass.java
e34aeb3071915198ccd1d1766a76a61d0c74ddb2
[ "LicenseRef-scancode-unknown-license-reference", "LicenseRef-scancode-warranty-disclaimer", "LicenseRef-scancode-us-govt-public-domain" ]
permissive
sahabi/OpenAMASE
e1ddd2c62848f0046787acbb02b8d31de2f03146
b50f5a71265a1f1644c49cce2161b40b108c65fe
refs/heads/master
2021-06-17T14:15:16.366053
2017-05-07T13:16:35
2017-05-07T13:16:35
90,772,724
3
0
null
null
null
null
UTF-8
Java
false
false
3,682
java
// =============================================================================== // Authors: AFRL/RQQD // Organization: Air Force Research Laboratory, Aerospace Systems Directorate, Power and Control Division // // Copyright (c) 2017 Government of the United State of America, as represented by // the Secretary of the Air Force. No copyright is claimed in the United States under // Title 17, U.S. Code. All Other Rights Reserved. // =============================================================================== package avtas.properties; import java.awt.Color; import java.awt.Font; import java.awt.event.ActionEvent; import java.io.File; import java.util.ArrayList; import java.util.List; import javax.swing.AbstractAction; import javax.swing.Action; import javax.swing.JOptionPane; /** * * @author AFRL/RQQD */ public class TestClass { @UserProperty private int intVal = 5; @UserProperty( Description="Color") private Color color = Color.RED; @UserProperty( ) private File file = new File("../test"); @UserProperty( FileType = UserProperty.FileTypes.Directories) private File dir; @UserProperty private Font font = new Font("Arial", Font.PLAIN, 12); @UserProperty private TestEnum anEnum = TestEnum.One; @UserProperty private List list = new ArrayList(); @UserProperty Action push = new AbstractAction("Push") { @Override public void actionPerformed(ActionEvent e) { JOptionPane.showMessageDialog(null, "Hello"); } }; private Object ignoreMe; public TestClass() { list.add("one"); list.add("two"); list.add("three"); } /** * @return the intVal */ public int getIntVal() { return intVal; } /** * @param intVal the intVal to set */ //public void setIntVal(int intVal) { // this.intVal = intVal; //} /** * @return the color */ public Color getColor() { return color; } /** * @param color the color to set */ public void setColor(Color color) { this.color = color; } /** * @return the file */ public File getFile() { return file; } /** * @param file the file to set */ public void setFile(File file) { this.file = file; } /** * @return the font */ public Font getFont() { return font; } /** * @param font the font to set */ public void setFont(Font font) { this.font = font; } /** * @return the anEnum */ public TestEnum getAnEnum() { return anEnum; } /** * @param anEnum the anEnum to set */ public void setAnEnum(TestEnum anEnum) { this.anEnum = anEnum; } /** * @return the ignoreMe */ public Object getIgnoreMe() { return ignoreMe; } /** * @param ignoreMe the ignoreMe to set */ public void setIgnoreMe(Object ignoreMe) { this.ignoreMe = ignoreMe; } /** * @return the dir */ public File getDir() { return dir; } /** * @param dir the dir to set */ public void setDir(File dir) { this.dir = dir; } public static enum TestEnum { One, Two, Three } public List getList() { return list; } public void setList(List list) { System.out.println("a new list"); this.list = list; } } /* Distribution A. Approved for public release. * Case: #88ABW-2015-4601. Date: 24 Sep 2015. */
[ "derek.kingston@us.af.mil" ]
derek.kingston@us.af.mil
4aa9f98625af6fccbc8bec03e96c60eaea28f69e
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/7/7_e3898da94c8bb7d0ff52fddbc729daf9dbc5ba85/ExportPrivateKey/7_e3898da94c8bb7d0ff52fddbc729daf9dbc5ba85_ExportPrivateKey_t.java
ff4bf02915e864fdc9731ff3206f5227657aeb83
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
2,340
java
package org.cujau.crypto; import java.io.File; import java.io.FileInputStream; import java.io.FileWriter; import java.security.Key; import java.security.KeyPair; import java.security.KeyStore; import java.security.KeyStoreException; import java.security.NoSuchAlgorithmException; import java.security.PrivateKey; import java.security.PublicKey; import java.security.UnrecoverableKeyException; import java.security.cert.Certificate; import org.cujau.utils.Base64; public class ExportPrivateKey { private File keystoreFile; private String keyStoreType; private char[] password; private String alias; private File exportedFile; public static KeyPair getPrivateKey( KeyStore keystore, String alias, char[] password ) { try { Key key = keystore.getKey( alias, password ); if ( key instanceof PrivateKey ) { Certificate cert = keystore.getCertificate( alias ); PublicKey publicKey = cert.getPublicKey(); return new KeyPair( publicKey, (PrivateKey) key ); } } catch ( UnrecoverableKeyException e ) { } catch ( NoSuchAlgorithmException e ) { } catch ( KeyStoreException e ) { } return null; } public void export() throws Exception { KeyStore keystore = KeyStore.getInstance( keyStoreType ); keystore.load( new FileInputStream( keystoreFile ), password ); KeyPair keyPair = getPrivateKey( keystore, alias, password ); PrivateKey privateKey = keyPair.getPrivate(); String encoded = Base64.encodeBytes( privateKey.getEncoded() ); FileWriter fw = new FileWriter( exportedFile ); fw.write( "-----BEGIN PRIVATE KEY-----\n" ); fw.write( encoded ); fw.write( "\n" ); fw.write( "-----END PRIVATE KEY-----" ); fw.close(); } public static void main( String args[] ) throws Exception { ExportPrivateKey export = new ExportPrivateKey(); export.keystoreFile = new File( args[0] ); export.keyStoreType = args[1]; export.password = args[2].toCharArray(); export.alias = args[3]; export.exportedFile = new File( args[4] ); export.export(); } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
883ac2a9692c9845654dc0911838c312a905a3cd
f50981b391d075e280fca88954caef5d42a21c35
/src/leetcode/array/LC_332_ReconstructItinerary.java
bdb64706688cd925b1902a10c5344a6a3c93014c
[]
no_license
fengjiny/algorithm
e2a953c56e3f3da048bf9bcc799a43060274d34a
9ca3fcd0447debff214ce53816a01131124f25fc
refs/heads/master
2020-03-10T17:25:41.691258
2018-05-09T07:59:19
2018-05-09T07:59:19
129,500,074
0
0
null
null
null
null
UTF-8
Java
false
false
1,027
java
package leetcode.array; import java.util.*; public class LC_332_ReconstructItinerary { public static List<String> findItinerary(String[][] tickets) { List<String> res = new LinkedList<>(); Map<String, PriorityQueue<String>> map = new HashMap<>(); for(String[] ticket : tickets) { map.computeIfAbsent(ticket[0], v -> new PriorityQueue()).add(ticket[1]); } Stack<String> stack = new Stack<String>(); stack.push("JFK"); while(!stack.isEmpty()) { while (map.containsKey(stack.peek()) && !map.get(stack.peek()).isEmpty()) stack.push(map.get(stack.peek()).poll()); res.add(0, stack.pop()); } return res; } public static void main(String[] args) { String[][] tickets = {{"MUC", "LHR"}, {"JFK", "MUC"}, {"SFO", "SJC"}, {"LHR", "SFO"}, {"JFK", "ATL"}}; List<String> list = findItinerary(tickets); list.forEach(s-> { System.out.println(s); }); } }
[ "fengjinyu@mobike.com" ]
fengjinyu@mobike.com
981c8736b05e2dcaa3cca428f7d708259f653e7f
a40e8647d702acb405f8da205e7f6e7daa7856c0
/org.jenetics/src/test/java/org/jenetics/internal/math/probabilityTest.java
b805740d2040715628b7222ea60e5d93683ba42c
[ "Apache-2.0" ]
permissive
xiaoqshou/jenetics
ca8965d318f4147d23a98f9d0e908969c43d7799
b0bc2d4762873df8df9295cebc8728a4a87677b6
refs/heads/master
2021-01-21T08:44:31.782899
2015-01-12T17:51:33
2015-01-12T17:51:33
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,742
java
/* * Java Genetic Algorithm Library (@__identifier__@). * Copyright (c) @__year__@ Franz Wilhelmstötter * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * Author: * Franz Wilhelmstötter (franz.wilhelmstoetter@gmx.at) */ package org.jenetics.internal.math; import java.util.Random; import org.testng.Assert; import org.testng.annotations.Test; import org.jenetics.util.RandomRegistry; /** * @author <a href="mailto:franz.wilhelmstoetter@gmx.at">Franz Wilhelmstötter</a> * @version <em>$Date: 2013-09-01 $</em> */ public class probabilityTest { @Test public void toIntToFloat() { final Random random = RandomRegistry.getRandom(); for (int i = 0; i < 100000; ++i) { final float p = random.nextFloat(); final int ip = probability.toInt(p); final float fip = probability.toFloat(ip); Assert.assertEquals(fip, p, 0.000001F); } } @Test public void probabilityToInt() { Assert.assertEquals(probability.toInt(0), Integer.MIN_VALUE); Assert.assertEquals(probability.toInt(1), Integer.MAX_VALUE); Assert.assertEquals(probability.toInt(0.5), 0); Assert.assertEquals(probability.toInt(0.25), Integer.MIN_VALUE/2); Assert.assertEquals(probability.toInt(0.75), Integer.MAX_VALUE/2); } }
[ "franz.wilhelmstoetter@gmail.com" ]
franz.wilhelmstoetter@gmail.com
176e7b731a48b5904237acecc55d3a7e3b74c73c
4b2b6fe260ba39f684f496992513cb8bc07dfcbc
/com/planet_ink/coffee_mud/Commands/Hold.java
45b7e22068808ae1d5cd13109fb0bb18bfb8dffe
[ "Apache-2.0" ]
permissive
vjanmey/EpicMudfia
ceb26feeac6f5b3eb48670f81ea43d8648314851
63c65489c673f4f8337484ea2e6ebfc11a09364c
refs/heads/master
2021-01-18T20:12:08.160733
2014-06-22T04:38:14
2014-06-22T04:38:14
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,052
java
package com.planet_ink.coffee_mud.Commands; import com.planet_ink.coffee_mud.core.interfaces.*; import com.planet_ink.coffee_mud.core.*; import com.planet_ink.coffee_mud.core.collections.*; import com.planet_ink.coffee_mud.Abilities.interfaces.*; import com.planet_ink.coffee_mud.Areas.interfaces.*; import com.planet_ink.coffee_mud.Behaviors.interfaces.*; import com.planet_ink.coffee_mud.CharClasses.interfaces.*; import com.planet_ink.coffee_mud.Commands.interfaces.*; import com.planet_ink.coffee_mud.Common.interfaces.*; import com.planet_ink.coffee_mud.Exits.interfaces.*; import com.planet_ink.coffee_mud.Items.interfaces.*; import com.planet_ink.coffee_mud.Locales.interfaces.*; import com.planet_ink.coffee_mud.MOBS.interfaces.*; import com.planet_ink.coffee_mud.Races.interfaces.*; import java.util.*; /* Copyright 2000-2014 Bo Zimmerman Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ @SuppressWarnings({"unchecked","rawtypes"}) public class Hold extends StdCommand { public Hold(){} private final String[] access=_i(new String[]{"HOLD","HOL","HO","H"}); @Override public String[] getAccessWords(){return access;} @Override public boolean execute(MOB mob, Vector commands, int metaFlags) throws java.io.IOException { if(commands.size()<2) { mob.tell(_("Hold what?")); return false; } commands.removeElementAt(0); final List<Item> items=CMLib.english().fetchItemList(mob,mob,null,commands,Wearable.FILTER_UNWORNONLY,false); if(items.size()==0) mob.tell(_("You don't seem to be carrying that.")); else for(int i=0;i<items.size();i++) if((items.size()==1)||(items.get(i).canWear(mob,Wearable.WORN_HELD))) { final Item item=items.get(i); int msgType=CMMsg.MSG_HOLD; String str=_("<S-NAME> hold(s) <T-NAME>."); if((mob.freeWearPositions(Wearable.WORN_WIELD,(short)0,(short)0)>0) &&((item.rawProperLocationBitmap()==Wearable.WORN_WIELD) ||(item.rawProperLocationBitmap()==(Wearable.WORN_HELD|Wearable.WORN_WIELD)))) { str=_("<S-NAME> wield(s) <T-NAME>."); msgType=CMMsg.MSG_WIELD; } final CMMsg newMsg=CMClass.getMsg(mob,item,null,msgType,str); if(mob.location().okMessage(mob,newMsg)) mob.location().send(mob,newMsg); } return false; } @Override public double combatActionsCost(final MOB mob, final List<String> cmds){return CMProps.getCombatActionCost(ID());} @Override public double actionsCost(final MOB mob, final List<String> cmds){return CMProps.getActionCost(ID());} @Override public boolean canBeOrdered(){return true;} }
[ "vjanmey@gmail.com" ]
vjanmey@gmail.com
0da67bffbaa826ac31688c3ac8fa8c0f47a66884
d69101efcbce0e033d42a3e9ca82f81719728aa7
/bobo-mall/bobo-manager/bobo-manager-service/src/main/java/com/bobo/service/ItemCatService.java
d0f4ad90e02742a0c369d8c8cb4aacc6bd86bdf8
[]
no_license
a982338665/lf-project-java-mall
22bf23d6385bf9e887f6f1c73fcc58f99593c132
62af77cc795239200b9437d0c1ee1ea36d99bef3
refs/heads/master
2021-09-14T23:32:56.788897
2018-05-22T09:25:52
2018-05-22T09:25:52
null
0
0
null
null
null
null
UTF-8
Java
false
false
257
java
package com.bobo.service; import com.bobo.common.pojo.EUTreeNode; import java.util.List; public interface ItemCatService { /** * 根据父类目id查询类目列表 * @param parentId * @return */ List<EUTreeNode> getCatList(long parentId); }
[ "982338665@qq.com" ]
982338665@qq.com
221c039af09d7012e980a90a5729e1b995f9b49e
5b7043c0020a1ffbc5f01150d76de461f3f919c6
/jOOQ/src/main/java/org/jooq/impl/DropIndexImpl.java
5c06027bbaa08b726ef2d001a595ba4ac09fae06
[ "Apache-2.0" ]
permissive
brmeyer/jOOQ
b8566ff3438c2cae57949c8a1575502945bd707a
33e616356d268d574eb52297c38176c8ed0cc247
refs/heads/master
2021-01-18T19:54:26.050884
2015-01-26T14:43:40
2015-01-26T14:43:40
29,864,793
0
1
null
2015-01-26T14:36:40
2015-01-26T14:36:39
null
UTF-8
Java
false
false
4,007
java
/** * Copyright (c) 2009-2015, Data Geekery GmbH (http://www.datageekery.com) * All rights reserved. * * This work is dual-licensed * - under the Apache Software License 2.0 (the "ASL") * - under the jOOQ License and Maintenance Agreement (the "jOOQ License") * ============================================================================= * You may choose which license applies to you: * * - If you're using this work with Open Source databases, you may choose * either ASL or jOOQ License. * - If you're using this work with at least one commercial database, you must * choose jOOQ License * * For more information, please visit http://www.jooq.org/licenses * * Apache Software License 2.0: * ----------------------------------------------------------------------------- * 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. * * jOOQ License and Maintenance Agreement: * ----------------------------------------------------------------------------- * Data Geekery grants the Customer the non-exclusive, timely limited and * non-transferable license to install and use the Software under the terms of * the jOOQ License and Maintenance Agreement. * * This library is distributed with a LIMITED WARRANTY. See the jOOQ License * and Maintenance Agreement for more details: http://www.jooq.org/licensing */ package org.jooq.impl; import static java.util.Arrays.asList; import static org.jooq.Clause.DROP_INDEX; // ... // ... import static org.jooq.SQLDialect.CUBRID; // ... import static org.jooq.SQLDialect.DERBY; import static org.jooq.SQLDialect.FIREBIRD; // ... // ... import static org.jooq.impl.DSL.name; import static org.jooq.impl.DropStatementType.INDEX; import org.jooq.Clause; import org.jooq.Configuration; import org.jooq.Context; import org.jooq.DropIndexFinalStep; /** * @author Lukas Eder */ class DropIndexImpl extends AbstractQuery implements // Cascading interface implementations for DROP INDEX behaviour DropIndexFinalStep { /** * Generated UID */ private static final long serialVersionUID = 8904572826501186329L; private static final Clause[] CLAUSES = { DROP_INDEX }; private final String index; private final boolean ifExists; DropIndexImpl(Configuration configuration, String index) { this(configuration, index, false); } DropIndexImpl(Configuration configuration, String index, boolean ifExists) { super(configuration); this.index = index; this.ifExists = ifExists; } // ------------------------------------------------------------------------ // XXX: QueryPart API // ------------------------------------------------------------------------ private final boolean supportsIfExists(Context<?> ctx) { return !asList(CUBRID, DERBY, FIREBIRD).contains(ctx.family()); } @Override public final void accept(Context<?> ctx) { if (ifExists && !supportsIfExists(ctx)) { Utils.executeImmediateBegin(ctx, INDEX); accept0(ctx); Utils.executeImmediateEnd(ctx, INDEX); } else { accept0(ctx); } } private void accept0(Context<?> ctx) { ctx.keyword("drop index").sql(" "); if (ifExists && supportsIfExists(ctx)) ctx.keyword("if exists").sql(" "); ctx.visit(name(index)); } @Override public final Clause[] clauses(Context<?> ctx) { return CLAUSES; } }
[ "lukas.eder@gmail.com" ]
lukas.eder@gmail.com
7f0ac49900eca884a223d84d2704020daa16483d
ae177443e7cfe52e7a29dfa48a30ab64b635e813
/XvXvDoctor/app/src/main/java/cn/com/xxdoctor/bean/CardBean.java
6af7b04c15c01ba704464000da1dbb445e6efb1d
[]
no_license
Galvatron0521/XvXvDoctor
4b09a4549567f0b62e3b4f019f63c7920b49df43
27a4abdc525fa53ca94c03d4eb94dcf3f87d6a75
refs/heads/master
2022-01-15T10:08:35.377429
2019-06-03T03:30:52
2019-06-03T03:30:52
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,748
java
package cn.com.xxdoctor.bean; import com.bigkoo.pickerview.model.IPickerViewData; /** * Created by KyuYi on 2017/3/2. * E-Mail:kyu_yi@sina.com * 功能: */ public class CardBean implements IPickerViewData { public String cardItemId; public String cardItemName; public Object tag; //课题使用 public String id; public String isHaveChild; public String fieldName; public CardBean(String cardItemId, String cardItemName) { this.cardItemId = cardItemId; this.cardItemName = cardItemName; } public CardBean(String cardItemId, String cardItemName, String id, String isHaveChild,String fieldName) { this.cardItemId = cardItemId; this.cardItemName = cardItemName; this.id = id; this.isHaveChild = isHaveChild; this.fieldName = fieldName; } @Override public String toString() { return "CardBean{" + "cardItemId='" + cardItemId + '\'' + ", cardItemName='" + cardItemName + '\'' + ", tag=" + tag + ", id='" + id + '\'' + ", isHaveChild='" + isHaveChild + '\'' + ", fieldName='" + fieldName + '\'' + '}'; } public String getId() { return cardItemId; } public void setId(String id) { this.cardItemId = id; } public String getCardNo() { return cardItemName; } public void setCardNo(String cardNo) { this.cardItemName = cardNo; } public Object getTag() { return tag; } public void setTag(Object tag) { this.tag = tag; } @Override public String getPickerViewText() { return cardItemName; } }
[ "18353847303@163.com" ]
18353847303@163.com
dae2494456b849339e528c9abcad75d28a7abc6e
6f461acdb4dc2f2667c8682ff50c612096405570
/logserver/src/main/java/com/gaea/game/log/LogService.java
b19746d3ecf1b538ebcb339c0da76d81389cb170
[]
no_license
ymw520369/gaeagame
f1584aa3d5dd5a186b3318ea3530d2b5814b3749
0e989a1fc57a9221d230cc1e2e465fa6c3bedbc3
refs/heads/master
2021-01-19T18:49:09.886818
2017-10-09T10:18:20
2017-10-09T10:18:20
101,168,005
1
0
null
null
null
null
UTF-8
Java
false
false
1,237
java
package com.gaea.game.log; import com.alibaba.dubbo.config.annotation.Service; import com.alibaba.fastjson.JSON; import com.gaea.game.core.log.ILogService; import com.mongodb.BasicDBObject; import com.mongodb.DBCollection; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.mongodb.core.MongoTemplate; import java.util.Map; /** * Created on 2017/9/8. * * @author Alan * @since 1.0 */ @Service(version = "1.0.0") public class LogService implements ILogService { Logger log = LoggerFactory.getLogger(LogService.class); //@Autowired //RecordManager recordManager; @Autowired MongoTemplate mongoTemplate; @Override public boolean log(Map<String, Object> map) { log.info("收到日志消息,map=" + JSON.toJSONString(map)); if (map == null || map.isEmpty()) { log.warn("消息数据为空"); return true; } String dbName = map.get("name").toString(); DBCollection collection = mongoTemplate.getCollection(dbName); BasicDBObject dbObject = new BasicDBObject(map); collection.insert(dbObject); return true; } }
[ "mingweiyang@foxmail.com" ]
mingweiyang@foxmail.com
879779c742dd1d6b4c12b6bb50581478afd47263
69a4f2d51ebeea36c4d8192e25cfb5f3f77bef5e
/methods/Method_22218.java
cf7e69c6739263d7e81c3b1203ab1dc4f0df5b66
[]
no_license
P79N6A/icse_20_user_study
5b9c42c6384502fdc9588430899f257761f1f506
8a3676bc96059ea2c4f6d209016f5088a5628f3c
refs/heads/master
2020-06-24T08:25:22.606717
2019-07-25T15:31:16
2019-07-25T15:31:16
null
0
0
null
null
null
null
UTF-8
Java
false
false
232
java
private void collectSize(@NonNull Display display,@NonNull JSONObject container) throws JSONException { final Point size=new Point(); display.getSize(size); container.put("size",new JSONArray(Arrays.asList(size.x,size.y))); }
[ "sonnguyen@utdallas.edu" ]
sonnguyen@utdallas.edu
5b047241a023c7db3fa91945b43aff361f0a6000
10e1fe4940718d045f980577b82dd427315153e0
/src/android/Starbuzz/app/build/generated/source/buildConfig/debug/com/example/starbuzz/BuildConfig.java
dfe07937a3f54ae7154d57342bfd685080d8a979
[]
no_license
ValenbergHar/G-JD1-2019-10-01_ValenbergHar
6b693f08becdf624b235170712e552a4ff148ac3
bff38b21a10594cdfa7a719c216c04614cc01ac3
refs/heads/master
2022-12-22T12:10:22.999080
2020-10-20T21:02:01
2020-10-20T21:02:01
212,853,204
0
1
null
2022-12-16T15:42:29
2019-10-04T16:00:20
Java
UTF-8
Java
false
false
447
java
/** * Automatically generated file. DO NOT MODIFY */ package com.example.starbuzz; public final class BuildConfig { public static final boolean DEBUG = Boolean.parseBoolean("true"); public static final String APPLICATION_ID = "com.example.starbuzz"; public static final String BUILD_TYPE = "debug"; public static final String FLAVOR = ""; public static final int VERSION_CODE = 1; public static final String VERSION_NAME = "1.0"; }
[ "maskevich.valeri@gmail.com" ]
maskevich.valeri@gmail.com
8f5b0514b2c4c81a4527add2b9a34fb525687361
0ca74be41f99150e743e2ef9083c3fd578d6be3c
/ToDo_App/src/main/java/com/bridgeit/todo/user/utility/UserEmailNotFound.java
0a4bf29fbea8da325e18be646f5e3040c2980e08
[]
no_license
FAIROJ123/ToDo
08301058d7e344dcc68437f84eb1ad19321396ed
9df902ec68ed50cfe75c498c3f2419f43084fbd7
refs/heads/master
2020-03-22T05:32:38.195512
2018-08-28T05:08:03
2018-08-28T05:08:03
139,573,344
0
0
null
null
null
null
UTF-8
Java
false
false
163
java
package com.bridgeit.todo.user.utility; public class UserEmailNotFound extends Exception{ public UserEmailNotFound(String msg) { super(msg); } }
[ "you@example.com" ]
you@example.com
db480852d3eb730ba1cdbe00403073bb0ec847b1
9a8e3137db2b3e29dceb170887144e991974c1f2
/rsc/rsc/TheLoveMachine/TLM/KeyHandler.java
5a066d50de5d9542b15148a955a11f58b5091bbd
[]
no_license
drewjbartlett/runescape-classic-dump
07155b735cfb6bf7b7b727557d1dd0c6f8e0db0b
f90e3bcc77ffb7ea4a78f087951f1d4cb0f6ad8e
refs/heads/master
2021-01-19T21:32:45.000029
2015-09-05T22:36:22
2015-09-05T22:36:22
88,663,647
1
0
null
2017-04-18T19:40:23
2017-04-18T19:40:23
null
UTF-8
Java
false
false
444
java
// Decompiled by DJ v3.7.7.81 Copyright 2004 Atanas Neshkov Date: 19/09/2004 20:04:12 // Home Page : http://members.fortunecity.com/neshkov/dj.html - Check often for new version! // Decompiler options: packimports(3) // Source File Name: KeyHandler.java import java.awt.*; public interface KeyHandler { public abstract int[] getAssociatedKeys(); public abstract void activate(int i, KeyState ks, boolean down); }
[ "tom@tom-fitzhenry.me.uk" ]
tom@tom-fitzhenry.me.uk
a2b932f69e1078e2083405cdbd76ba369dbf7f5a
7f261a1e2bafd1cdd98d58f00a2937303c0dc942
/src/ANXCamera/sources/android/support/v4/provider/RawDocumentFile.java
db03374e77e7f75800d8ecb4ee1154e05adb0be0
[]
no_license
xyzuan/ANXCamera
7614ddcb4bcacdf972d67c2ba17702a8e9795c95
b9805e5197258e7b980e76a97f7f16de3a4f951a
refs/heads/master
2022-04-23T16:58:09.592633
2019-05-31T17:18:34
2019-05-31T17:26:48
259,555,505
3
0
null
2020-04-28T06:49:57
2020-04-28T06:49:57
null
UTF-8
Java
false
false
4,164
java
package android.support.v4.provider; import android.net.Uri; import android.util.Log; import android.webkit.MimeTypeMap; import java.io.File; import java.io.IOException; import java.util.ArrayList; class RawDocumentFile extends DocumentFile { private File mFile; RawDocumentFile(DocumentFile parent, File file) { super(parent); this.mFile = file; } public DocumentFile createFile(String mimeType, String displayName) { String extension = MimeTypeMap.getSingleton().getExtensionFromMimeType(mimeType); if (extension != null) { StringBuilder sb = new StringBuilder(); sb.append(displayName); sb.append("."); sb.append(extension); displayName = sb.toString(); } File target = new File(this.mFile, displayName); try { target.createNewFile(); return new RawDocumentFile(this, target); } catch (IOException e) { StringBuilder sb2 = new StringBuilder(); sb2.append("Failed to createFile: "); sb2.append(e); Log.w("DocumentFile", sb2.toString()); return null; } } public DocumentFile createDirectory(String displayName) { File target = new File(this.mFile, displayName); if (target.isDirectory() || target.mkdir()) { return new RawDocumentFile(this, target); } return null; } public Uri getUri() { return Uri.fromFile(this.mFile); } public String getName() { return this.mFile.getName(); } public String getType() { if (this.mFile.isDirectory()) { return null; } return getTypeForName(this.mFile.getName()); } public boolean isDirectory() { return this.mFile.isDirectory(); } public boolean isFile() { return this.mFile.isFile(); } public long lastModified() { return this.mFile.lastModified(); } public long length() { return this.mFile.length(); } public boolean canRead() { return this.mFile.canRead(); } public boolean canWrite() { return this.mFile.canWrite(); } public boolean delete() { deleteContents(this.mFile); return this.mFile.delete(); } public boolean exists() { return this.mFile.exists(); } public DocumentFile[] listFiles() { ArrayList<DocumentFile> results = new ArrayList<>(); File[] files = this.mFile.listFiles(); if (files != null) { for (File file : files) { results.add(new RawDocumentFile(this, file)); } } return (DocumentFile[]) results.toArray(new DocumentFile[results.size()]); } public boolean renameTo(String displayName) { File target = new File(this.mFile.getParentFile(), displayName); if (!this.mFile.renameTo(target)) { return false; } this.mFile = target; return true; } private static String getTypeForName(String name) { int lastDot = name.lastIndexOf(46); if (lastDot >= 0) { String mime = MimeTypeMap.getSingleton().getMimeTypeFromExtension(name.substring(lastDot + 1).toLowerCase()); if (mime != null) { return mime; } } return "application/octet-stream"; } private static boolean deleteContents(File dir) { boolean success; File[] arr$; File[] files = dir.listFiles(); boolean success2 = true; if (files != null) { for (File file : files) { if (file.isDirectory()) { success2 &= deleteContents(file); } if (!file.delete()) { StringBuilder sb = new StringBuilder(); sb.append("Failed to delete "); sb.append(file); Log.w("DocumentFile", sb.toString()); success2 = false; } } } return success; } }
[ "sv.xeon@gmail.com" ]
sv.xeon@gmail.com
839fb9187e0dbb2e9819b41538ca4dea2484c4c5
d1bd1246f161b77efb418a9c24ee544d59fd1d20
/android/mylibrary/trunk/src/org/anybox/android/library/app/MyAccountBinder.java
bc7ca7b846bcc935f3e8f1c338412d9ddce904b2
[]
no_license
navychen2003/javen
f9a94b2e69443291d4b5c3db5a0fc0d1206d2d4a
a3c2312bc24356b1c58b1664543364bfc80e816d
refs/heads/master
2021-01-20T12:12:46.040953
2015-03-03T06:14:46
2015-03-03T06:14:46
30,912,222
0
1
null
2023-03-20T11:55:50
2015-02-17T10:24:28
Java
UTF-8
Java
false
false
1,714
java
package org.anybox.android.library.app; import android.view.LayoutInflater; import android.view.View; import org.javenstudio.android.app.IActivity; import org.javenstudio.provider.app.anybox.user.AnyboxAccountBinder; import org.javenstudio.provider.app.anybox.user.AnyboxAccountProvider; public class MyAccountBinder extends AnyboxAccountBinder { //private static final Logger LOG = Logger.getLogger(MyAccountBinder.class); private final MyBinderHelper mHelper = MyBinderHelper.BLUE; public MyAccountBinder(AnyboxAccountProvider p) { super(p); } @Override protected void onBindedItemView(IActivity activity, LayoutInflater inflater, View view) { super.onBindedItemView(activity, inflater, view); if (mHelper != null) mHelper.onBindRefreshView(activity, view); } @Override public int getHomeAsUpIndicatorMenuRes() { if (mHelper != null) return mHelper.getHomeAsUpIndicatorMenuRes(); return super.getHomeAsUpIndicatorMenuRes(); } @Override public int getHomeAsUpIndicatorBackRes() { if (mHelper != null) return mHelper.getHomeAsUpIndicatorBackRes(); return super.getHomeAsUpIndicatorBackRes(); } @Override protected int getHeaderMainViewBackgroundRes() { if (mHelper != null) return mHelper.getHeaderMainViewBackgroundRes(); return super.getHeaderMainViewBackgroundRes(); } @Override protected int getHeaderActionsViewBackgroundRes() { if (mHelper != null) return mHelper.getHeaderActionsViewBackgroundRes(); return super.getHeaderActionsViewBackgroundRes(); } @Override protected int getAboveActionsViewBackgroundRes() { if (mHelper != null) return mHelper.getAboveActionsViewBackgroundRes(); return super.getAboveActionsViewBackgroundRes(); } }
[ "navychen2003@hotmail.com" ]
navychen2003@hotmail.com
493bf2e2d80f1a7059f200a06bcbc720e411cf54
251536bd3c55b438538c256a1defeda78f7238e0
/opengl_tutorial/src/main/java/com/glumes/openglbasicshape/egl/EglActivity.java
615cb7f72c2cbf89bc657a20f32ce907245ff8bb
[]
no_license
glumes/AndroidOpenGLTutorial
c166671ed97f698331d97cb292e1cc16739530c0
23d87a9d52e3237c3add60d4dbb67d7ee3d553fa
refs/heads/master
2022-05-04T04:16:12.095247
2022-04-22T14:03:40
2022-04-22T14:03:40
97,850,730
273
62
null
2018-07-11T16:05:14
2017-07-20T15:23:31
Java
UTF-8
Java
false
false
1,206
java
package com.glumes.openglbasicshape.egl; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.SurfaceHolder; import android.view.SurfaceView; import com.glumes.openglbasicshape.R; public class EglActivity extends AppCompatActivity { private SurfaceView mSurfaceView; private EglDemo mEglDemo; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_egl); mSurfaceView = findViewById(R.id.eglview); mEglDemo = new EglDemo(); mSurfaceView.getHolder().addCallback(new SurfaceHolder.Callback() { @Override public void surfaceCreated(SurfaceHolder holder) { mEglDemo.initEgl(); } @Override public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) { mEglDemo.render(mSurfaceView.getHolder().getSurface(), width, height, EglActivity.this); } @Override public void surfaceDestroyed(SurfaceHolder holder) { mEglDemo.release(); } }); } }
[ "zhaoying9402@gmail.com" ]
zhaoying9402@gmail.com
e49285073985bc74cffecb81f22e83f53ff72950
b3a02d5f1f60cd584fbb6da1b823899607693f63
/04_DB Frameworks_Hibernate+Spring Data/08_Spring Data Intro EX/Problem_9_UserSystem/src/main/java/app/services/UserService.java
b9d8101cd7eb018da74b5b10b0db341b54db4c86
[ "MIT" ]
permissive
akkirilov/SoftUniProject
20bf0543c9aaa0a33364daabfddd5f4c3e400ba2
709d2d1981c1bb6f1d652fe4101c1693f5afa376
refs/heads/master
2021-07-11T02:53:18.108275
2018-12-04T20:14:19
2018-12-04T20:14:19
79,428,334
0
0
null
null
null
null
UTF-8
Java
false
false
1,145
java
package app.services; import java.util.List; import javax.transaction.Transactional; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import app.entities.User; import app.repositories.UserRepository; @Service @Transactional public class UserService { @Autowired private UserRepository userRepository; public void saveAndFlush(User user) { userRepository.saveAndFlush(user); } public void save(User user) { userRepository.save(user); } public void save(List<User> users) { userRepository.saveAll(users); } public User findById(Long id) { return userRepository.getOne(id); } public User findByEmail(String email) { return userRepository.findByEmail(email); } public User findByUsername(String username) { return userRepository.findByUsername(username); } public List<User> findAll() { return userRepository.findAll(); } public boolean isExist(User user) { return userRepository.existsById(user.getId()); } public void setLastNameManual(User user, String lastName) { userRepository.setLastName(lastName, user.getId()); } }
[ "akkirilov@mail.bg" ]
akkirilov@mail.bg
819d05ba7889533766d769808f0e02ea919f607a
bf1a992b5adcaefbef690120265e9dc61dec3f54
/basic-api-study/src/main/java/com/yicj/study/controller/modelsupport/ModelSupportController.java
a4c864547cd168047accf468798b4ec5205c5600
[]
no_license
yichengjie/spring-mvc-study
7deda2abbf98d6d66629a4664420baf477b3280f
ac2bf38290adbd375eb6868c7bff34e3d8039a97
refs/heads/master
2022-12-15T17:59:52.825183
2020-09-20T13:24:33
2020-09-20T13:24:33
292,978,492
0
0
null
null
null
null
UTF-8
Java
false
false
1,564
java
package com.yicj.study.controller.modelsupport; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.servlet.mvc.support.RedirectAttributes; import javax.servlet.http.HttpServletRequest; @Controller public class ModelSupportController { @GetMapping("/forwardView") public String forwardView(Model model){ // 设置转发前的模型属性 model.addAttribute("info", "转发前的属性") ; //返回转发视图,转发目标是forwardTargetView return "forward:forwardTargetView" ; } @GetMapping("/forwardTargetView") public String forwardTargetView(Model model, HttpServletRequest request){ Object info = request.getAttribute("info"); // 设置模型属性 model.addAttribute("first", info) ; model.addAttribute("second", "转发后的属性") ; return "viewView" ; } @GetMapping("/redirectView") public String redirectView(RedirectAttributes model){ // 重定向前的模型数据 model.addFlashAttribute("first", "重定向前的属性") ; // 返回重定向视图,转发目标forwardTargetView return "redirect:redirectTargetView" ; } @GetMapping("/redirectTargetView") public String redirectTargetView(Model model){ //此时的Model已经有了重定向的属性了 model.addAttribute("second", "重定向后的属性") ; return "viewView" ; } }
[ "626659321@qq.com" ]
626659321@qq.com
6072b414be6dfc94458b532240b415e4bf305a58
f96fe513bfdf2d1dbd582305e1cbfda14a665bec
/net.sf.smbt.jazzmutant/src-model/net/sf/smbt/jzmui/MidiVarD0ChannelPressure.java
25f1fc498f73cedcd11b87179553b7628508991e
[]
no_license
lucascraft/ubq_wip
04fdb727e7b2dc384ba1d2195ad47e895068e1e4
eff577040f21be71ea2c76c187d574f1617703ce
refs/heads/master
2021-01-22T02:28:20.687330
2015-06-10T12:38:47
2015-06-10T12:38:47
37,206,324
0
0
null
null
null
null
UTF-8
Java
false
false
454
java
/** * <copyright> * </copyright> * * $Id$ */ package net.sf.smbt.jzmui; import org.eclipse.emf.ecore.EObject; /** * <!-- begin-user-doc --> * A representation of the model object '<em><b>Midi Var D0 Channel Pressure</b></em>'. * <!-- end-user-doc --> * * * @see net.sf.smbt.jzmui.JzmuiPackage#getMidiVarD0ChannelPressure() * @model * @generated */ public interface MidiVarD0ChannelPressure extends EObject { } // MidiVarD0ChannelPressure
[ "lucas.bigeardel@gmail.com" ]
lucas.bigeardel@gmail.com
f8dfc01a45b2a82f588335f45bbf735ba0a84b67
9af8fe96b774b77617e8f66846474c44f66fcf74
/AndroidUtils/src/main/java/com/nityankhanna/androidutils/DateTimeFormat.java
1b88dd23ca5644e03805bb95ab2b30920ef18dae
[ "MIT" ]
permissive
b3457m0d3/android-utils-1
82868365d070fed6b8fab729075ced0a5c41d33e
b2aecf04e28e5fa794874f391e7d9e16e80cd363
refs/heads/master
2020-12-31T03:16:11.023342
2014-03-09T04:17:55
2014-03-09T04:17:55
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,044
java
package com.nityankhanna.androidutils; /** * Created by Nityan Khanna on Jan 14 2014. */ public enum DateTimeFormat { DAY_MONTH_YEAR("dd/MM/yyyy"), MONTH_DAY_YEAR("MM/dd/yyyy"), YEAR_MONTH_DAY("yyyy/MM/dd"), HOUR_MINUTE_SECOND_12("hh:mm:ss"), HOUR_MINUTE_SECOND_24("kk:mm:ss"), HOUR_MINUTE_SECOND_AM_PM("hh:mm:ss aa"), DAY_MONTH_YEAR_HOUR_MINUTE_SECOND_12("dd/MM/yyyy hh:mm:ss"), DAY_MONTH_YEAR_HOUR_MINUTE_SECOND_24("dd/MM/yyyy kk:mm:ss"), MONTH_DAY_YEAR_HOUR_MINUTE_SECOND_12("MM/dd/yyyy hh:mm:ss"), MONTH_DAY_YEAR_HOUR_MINUTE_SECOND_24("MM/dd/yyyy kk:mm:ss"), YEAR_MONTH_DAY_HOUR_MINUTE_SECOND_12("yyyy/MM/dd hh:mm:ss"), YEAR_MONTH_DAY_HOUR_MINUTE_SECOND_24("yyyy/MM/dd kk:mm:ss"), DAY_MONTH_YEAR_HOUR_MINUTE_SECOND_AM_PM("dd/MM/yyyy hh:mm:ss aa"), MONTH_DAY_YEAR_HOUR_MINUTE_SECOND_AM_PM("MM/dd/yyyy hh:mm:ss aa"), YEAR_MONTH_DAY_HOUR_MINUTE_SECOND_AM_PM("yyyy/MM/dd hh:mm:ss aa"); private String value; private DateTimeFormat(String value) { this.value = value; } public String getValue() { return value; } }
[ "nityan.khanna@mohawkcollege.ca" ]
nityan.khanna@mohawkcollege.ca
c428ace3a8b17a96ca68bede6b1e4fb5f678fc11
be932cae69ad9e9d28950e1c6540872686cdabf9
/rongke-web/src/main/java/com/rongke/web/lianpay/vo/OrderInfo.java
a1e292a2ed115ab7cbe1237bca8aa2337f166075
[]
no_license
gaolizhan/rongke
a8af53f7810d462c8294c248c89faf8a6ae10daa
684a1aa522f182137b3b23b0ec98e2fbd4eef801
refs/heads/master
2020-04-08T08:18:49.829102
2018-11-25T14:53:35
2018-11-25T14:53:35
159,174,206
0
1
null
null
null
null
UTF-8
Java
false
false
1,488
java
package com.rongke.web.lianpay.vo; import java.io.Serializable; /** * 商户订单信息 * @author guoyx * @date:Jun 24, 2013 3:25:29 PM * @version :1.0 * */ public class OrderInfo implements Serializable{ private static final long serialVersionUID = 1L; private String no_order; // 商户唯一订单号 private String dt_order; // 商户订单时间 private String name_goods; // 商品名称 private String info_order; // 订单描述 private String money_order; // 交易金额 单位为RMB-元 public String getNo_order() { return no_order; } public void setNo_order(String no_order) { this.no_order = no_order; } public String getDt_order() { return dt_order; } public void setDt_order(String dt_order) { this.dt_order = dt_order; } public String getName_goods() { return name_goods; } public void setName_goods(String name_goods) { this.name_goods = name_goods; } public String getInfo_order() { return info_order; } public void setInfo_order(String info_order) { this.info_order = info_order; } public String getMoney_order() { return money_order; } public void setMoney_order(String money_order) { this.money_order = money_order; } }
[ "cmeizu@hotmail.com" ]
cmeizu@hotmail.com
f4ef8545fc418a0e998bb43741ad2997cbd74096
3ef55e152decb43bdd90e3de821ffea1a2ec8f75
/large/module0254_internal/src/java/module0254_internal/a/Foo3.java
23f34bcff4c77c8bd00b1d2e2df22fc15b813593
[ "BSD-3-Clause" ]
permissive
salesforce/bazel-ls-demo-project
5cc6ef749d65d6626080f3a94239b6a509ef145a
948ed278f87338edd7e40af68b8690ae4f73ebf0
refs/heads/master
2023-06-24T08:06:06.084651
2023-03-14T11:54:29
2023-03-14T11:54:29
241,489,944
0
5
BSD-3-Clause
2023-03-27T11:28:14
2020-02-18T23:30:47
Java
UTF-8
Java
false
false
1,578
java
package module0254_internal.a; import javax.lang.model.*; import javax.management.*; import javax.naming.directory.*; /** * Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut * labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. * Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. * * @see java.nio.file.FileStore * @see java.sql.Array * @see java.util.logging.Filter */ @SuppressWarnings("all") public abstract class Foo3<X> extends module0254_internal.a.Foo2<X> implements module0254_internal.a.IFoo3<X> { java.util.zip.Deflater f0 = null; javax.annotation.processing.Completion f1 = null; javax.lang.model.AnnotatedConstruct f2 = null; public X element; public static Foo3 instance; public static Foo3 getInstance() { return instance; } public static <T> T create(java.util.List<T> input) { return module0254_internal.a.Foo2.create(input); } public String getName() { return module0254_internal.a.Foo2.getInstance().getName(); } public void setName(String string) { module0254_internal.a.Foo2.getInstance().setName(getName()); return; } public X get() { return (X)module0254_internal.a.Foo2.getInstance().get(); } public void set(Object element) { this.element = (X)element; module0254_internal.a.Foo2.getInstance().set(this.element); } public X call() throws Exception { return (X)module0254_internal.a.Foo2.getInstance().call(); } }
[ "gwagenknecht@salesforce.com" ]
gwagenknecht@salesforce.com
33f489d90fecf8ab1e446075f875113e650a3203
05a5bb2f14da29e67a086d0a0beb0863978663e9
/src/main/java/net/imglib2/blocks/TempArrayImpl.java
e3db8c4a9dc94fffe28e6a0a47e4f1f974eec9bc
[ "BSD-2-Clause" ]
permissive
imglib/imglib2
8239153419a862149cc8317ca27a185dbe07aeec
0f83262f6a1db0b131341fe28ec1d4f495c65a7a
refs/heads/master
2023-08-18T10:50:51.702443
2023-02-06T17:59:32
2023-07-14T12:01:47
2,996,011
260
79
NOASSERTION
2023-09-12T12:26:59
2011-12-16T16:36:19
Java
UTF-8
Java
false
false
2,532
java
/*- * #%L * ImgLib2: a general-purpose, multidimensional image processing library. * %% * Copyright (C) 2009 - 2023 Tobias Pietzsch, Stephan Preibisch, Stephan Saalfeld, * John Bogovic, Albert Cardona, Barry DeZonia, Christian Dietz, Jan Funke, * Aivar Grislis, Jonathan Hale, Grant Harris, Stefan Helfrich, Mark Hiner, * Martin Horn, Steffen Jaensch, Lee Kamentsky, Larry Lindsey, Melissa Linkert, * Mark Longair, Brian Northan, Nick Perry, Curtis Rueden, Johannes Schindelin, * Jean-Yves Tinevez and Michael Zinsmaier. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * #L% */ package net.imglib2.blocks; import java.lang.ref.WeakReference; class TempArrayImpl< T > implements TempArray< T > { private final PrimitiveTypeProperties< T, ? > props; private WeakReference< T > arrayRef; TempArrayImpl( PrimitiveTypeProperties< T, ? > props ) { arrayRef = new WeakReference<>( null ); this.props = props; } @Override public T get( final int minSize ) { T array = arrayRef.get(); if ( array == null || props.length( array ) < minSize ) { array = props.allocate( minSize ); arrayRef = new WeakReference<>( array ); } return array; } @Override public TempArray< T > newInstance() { return new TempArrayImpl<>( props ); } }
[ "tobias.pietzsch@gmail.com" ]
tobias.pietzsch@gmail.com
355e512f68e8424eddf19ba183bd42315a734285
85a912b7e7f46f0a8b828463075cba1c5a338065
/hello-eureka-client-service-consumer-feign/src/main/java/com/lee/springcloud/simple/ConsumerController.java
f19914c12ca15b188fd7ff1f114d9d138959583e
[]
no_license
BlueLeer/lee-springcloud-learn
0c6a810b24f94a584b0cca6bb095c95174ef9ccf
3cac1541bd4408a771bad2ac4a5457076cc8c4ec
refs/heads/master
2020-06-21T21:17:41.257789
2020-04-17T16:59:41
2020-04-17T16:59:41
197,554,499
1
0
null
null
null
null
UTF-8
Java
false
false
621
java
package com.lee.springcloud.simple; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; /** * Feign继承的特性 * * @author lee * @date 2020/4/16 16:27 */ @RestController public class ConsumerController { @Autowired private ConsumerService consumerService; @RequestMapping("/simple") public String simple() { String hi = consumerService.hi(); String name = consumerService.hiFeign("wangle"); return hi + "##########" + name; } }
[ "251668577@qq.com" ]
251668577@qq.com
f28e49187c24e0e1d2e362f7c34ccedf3c6338db
0af8b92686a58eb0b64e319b22411432aca7a8f3
/large-multiproject/project24/src/test/java/org/gradle/test/performance24_3/Test24_207.java
50dd68e1ca00914b44ccbbfb0805cbcac3ef84a6
[]
no_license
gradle/performance-comparisons
b0d38db37c326e0ce271abebdb3c91769b860799
e53dc7182fafcf9fedf07920cbbea8b40ee4eef4
refs/heads/master
2023-08-14T19:24:39.164276
2022-11-24T05:18:33
2022-11-24T05:18:33
80,121,268
17
15
null
2022-09-30T08:04:35
2017-01-26T14:25:33
null
UTF-8
Java
false
false
292
java
package org.gradle.test.performance24_3; import static org.junit.Assert.*; public class Test24_207 { private final Production24_207 production = new Production24_207("value"); @org.junit.Test public void test() { assertEquals(production.getProperty(), "value"); } }
[ "cedric.champeau@gmail.com" ]
cedric.champeau@gmail.com
3feb19d9d351bf1fc109ac2c19aff0470fd55e3e
fa1408365e2e3f372aa61e7d1e5ea5afcd652199
/src/testcases/CWE369_Divide_by_Zero/s02/CWE369_Divide_by_Zero__int_connect_tcp_modulo_61b.java
65ef67f9bf7ea2f11d8e7060333ccab03104fa79
[]
no_license
bqcuong/Juliet-Test-Case
31e9c89c27bf54a07b7ba547eddd029287b2e191
e770f1c3969be76fdba5d7760e036f9ba060957d
refs/heads/master
2020-07-17T14:51:49.610703
2019-09-03T16:22:58
2019-09-03T16:22:58
206,039,578
1
2
null
null
null
null
UTF-8
Java
false
false
7,085
java
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE369_Divide_by_Zero__int_connect_tcp_modulo_61b.java Label Definition File: CWE369_Divide_by_Zero__int.label.xml Template File: sources-sinks-61b.tmpl.java */ /* * @description * CWE: 369 Divide by zero * BadSource: connect_tcp Read data using an outbound tcp connection * GoodSource: A hardcoded non-zero, non-min, non-max, even number * Sinks: modulo * GoodSink: Check for zero before modulo * BadSink : Modulo by a value that may be zero * Flow Variant: 61 Data flow: data returned from one method to another in different classes in the same package * * */ package testcases.CWE369_Divide_by_Zero.s02; import testcasesupport.*; import javax.servlet.http.*; import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.IOException; import java.net.Socket; import java.util.logging.Level; public class CWE369_Divide_by_Zero__int_connect_tcp_modulo_61b { public int badSource() throws Throwable { int data; data = Integer.MIN_VALUE; /* Initialize data */ /* Read data using an outbound tcp connection */ { Socket socket = null; BufferedReader readerBuffered = null; InputStreamReader readerInputStream = null; try { /* Read data using an outbound tcp connection */ socket = new Socket("host.example.org", 39544); /* read input from socket */ readerInputStream = new InputStreamReader(socket.getInputStream(), "UTF-8"); readerBuffered = new BufferedReader(readerInputStream); /* POTENTIAL FLAW: Read data using an outbound tcp connection */ String stringNumber = readerBuffered.readLine(); if (stringNumber != null) /* avoid NPD incidental warnings */ { try { data = Integer.parseInt(stringNumber.trim()); } catch(NumberFormatException exceptNumberFormat) { IO.logger.log(Level.WARNING, "Number format exception parsing data from string", exceptNumberFormat); } } } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "Error with stream reading", exceptIO); } finally { /* clean up stream reading objects */ try { if (readerBuffered != null) { readerBuffered.close(); } } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "Error closing BufferedReader", exceptIO); } try { if (readerInputStream != null) { readerInputStream.close(); } } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "Error closing InputStreamReader", exceptIO); } /* clean up socket objects */ try { if (socket != null) { socket.close(); } } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "Error closing Socket", exceptIO); } } } return data; } /* goodG2B() - use goodsource and badsink */ public int goodG2BSource() throws Throwable { int data; /* FIX: Use a hardcoded number that won't cause underflow, overflow, divide by zero, or loss-of-precision issues */ data = 2; return data; } /* goodB2G() - use badsource and goodsink */ public int goodB2GSource() throws Throwable { int data; data = Integer.MIN_VALUE; /* Initialize data */ /* Read data using an outbound tcp connection */ { Socket socket = null; BufferedReader readerBuffered = null; InputStreamReader readerInputStream = null; try { /* Read data using an outbound tcp connection */ socket = new Socket("host.example.org", 39544); /* read input from socket */ readerInputStream = new InputStreamReader(socket.getInputStream(), "UTF-8"); readerBuffered = new BufferedReader(readerInputStream); /* POTENTIAL FLAW: Read data using an outbound tcp connection */ String stringNumber = readerBuffered.readLine(); if (stringNumber != null) /* avoid NPD incidental warnings */ { try { data = Integer.parseInt(stringNumber.trim()); } catch(NumberFormatException exceptNumberFormat) { IO.logger.log(Level.WARNING, "Number format exception parsing data from string", exceptNumberFormat); } } } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "Error with stream reading", exceptIO); } finally { /* clean up stream reading objects */ try { if (readerBuffered != null) { readerBuffered.close(); } } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "Error closing BufferedReader", exceptIO); } try { if (readerInputStream != null) { readerInputStream.close(); } } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "Error closing InputStreamReader", exceptIO); } /* clean up socket objects */ try { if (socket != null) { socket.close(); } } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "Error closing Socket", exceptIO); } } } return data; } }
[ "bqcuong2212@gmail.com" ]
bqcuong2212@gmail.com
07d7f5fa19ad2b8d83859dad932817a8655c0874
38c4451ab626dcdc101a11b18e248d33fd8a52e0
/identifiers/lucene-3.6.2/core/src/java/org/apache/lucene/index/TermInfo.java
4711506b8efe369b2ef785a51df695644326bdf1
[]
no_license
habeascorpus/habeascorpus-data
47da7c08d0f357938c502bae030d5fb8f44f5e01
536d55729f3110aee058ad009bcba3e063b39450
refs/heads/master
2020-06-04T10:17:20.102451
2013-02-19T15:19:21
2013-02-19T15:19:21
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,106
java
org PACKAGE_IDENTIFIER false apache PACKAGE_IDENTIFIER false lucene PACKAGE_IDENTIFIER false index PACKAGE_IDENTIFIER false TermInfo TYPE_IDENTIFIER true docFreq VARIABLE_IDENTIFIER true freqPointer VARIABLE_IDENTIFIER true proxPointer VARIABLE_IDENTIFIER true skipOffset VARIABLE_IDENTIFIER true TermInfo METHOD_IDENTIFIER false TermInfo METHOD_IDENTIFIER false df VARIABLE_IDENTIFIER true fp VARIABLE_IDENTIFIER true pp VARIABLE_IDENTIFIER true docFreq VARIABLE_IDENTIFIER false df VARIABLE_IDENTIFIER false freqPointer VARIABLE_IDENTIFIER false fp VARIABLE_IDENTIFIER false proxPointer VARIABLE_IDENTIFIER false pp VARIABLE_IDENTIFIER false TermInfo METHOD_IDENTIFIER false TermInfo TYPE_IDENTIFIER false ti VARIABLE_IDENTIFIER true docFreq VARIABLE_IDENTIFIER false ti VARIABLE_IDENTIFIER false docFreq VARIABLE_IDENTIFIER false freqPointer VARIABLE_IDENTIFIER false ti VARIABLE_IDENTIFIER false freqPointer VARIABLE_IDENTIFIER false proxPointer VARIABLE_IDENTIFIER false ti VARIABLE_IDENTIFIER false proxPointer VARIABLE_IDENTIFIER false skipOffset VARIABLE_IDENTIFIER false ti VARIABLE_IDENTIFIER false skipOffset VARIABLE_IDENTIFIER false set METHOD_IDENTIFIER true docFreq VARIABLE_IDENTIFIER true freqPointer VARIABLE_IDENTIFIER true proxPointer VARIABLE_IDENTIFIER true skipOffset VARIABLE_IDENTIFIER true docFreq VARIABLE_IDENTIFIER false docFreq VARIABLE_IDENTIFIER false freqPointer VARIABLE_IDENTIFIER false freqPointer VARIABLE_IDENTIFIER false proxPointer VARIABLE_IDENTIFIER false proxPointer VARIABLE_IDENTIFIER false skipOffset VARIABLE_IDENTIFIER false skipOffset VARIABLE_IDENTIFIER false set METHOD_IDENTIFIER true TermInfo TYPE_IDENTIFIER false ti VARIABLE_IDENTIFIER true docFreq VARIABLE_IDENTIFIER false ti VARIABLE_IDENTIFIER false docFreq VARIABLE_IDENTIFIER false freqPointer VARIABLE_IDENTIFIER false ti VARIABLE_IDENTIFIER false freqPointer VARIABLE_IDENTIFIER false proxPointer VARIABLE_IDENTIFIER false ti VARIABLE_IDENTIFIER false proxPointer VARIABLE_IDENTIFIER false skipOffset VARIABLE_IDENTIFIER false ti VARIABLE_IDENTIFIER false skipOffset VARIABLE_IDENTIFIER false
[ "pschulam@gmail.com" ]
pschulam@gmail.com
a39962024f9b29127b010673d405f06d51ad520a
3c8c96e41b0af44b65779cfa95af5247c01922df
/src/main/java/io/vertx/ext/unit/report/impl/SimpleFormatter.java
24d4699e51896ec5fe22a72bb2d661b518b1c6e3
[]
no_license
alexlehm/vertx-unit
ec9e33b4d584f3ff3ffd5779df95037794f44cdb
c6b444454e1d9d46c5abd722f4f7731b4b7e3bd4
refs/heads/initial-work
2021-01-14T09:29:10.763743
2015-02-20T18:27:45
2015-02-20T18:27:45
29,323,669
0
0
null
2020-10-14T08:16:33
2015-01-15T23:37:37
Java
UTF-8
Java
false
false
2,110
java
package io.vertx.ext.unit.report.impl; import io.vertx.core.Handler; import io.vertx.core.buffer.Buffer; import io.vertx.ext.unit.report.TestResult; import io.vertx.ext.unit.report.Reporter; import java.util.function.BiConsumer; import java.util.function.Consumer; /** * @author <a href="mailto:julien@julienviet.com">Julien Viet</a> */ public class SimpleFormatter implements Reporter<SimpleFormatter.ReportImpl> { private final Consumer<Buffer> info; private final BiConsumer<Buffer, Throwable> error; private final Handler<Void> endHandler; public SimpleFormatter(Consumer<Buffer> info, BiConsumer<Buffer, Throwable> error, Handler<Void> endHandler) { this.info = info; this.error = error; this.endHandler = endHandler; } public static class ReportImpl { private int run; private int failures; private int errors; } @Override public ReportImpl createReport() { return new ReportImpl(); } @Override public void reportBeginTestSuite(ReportImpl report, String name) { info.accept(Buffer.buffer("Begin test suite " + name)); } @Override public void reportBeginTestCase(ReportImpl report, String name) { info.accept(Buffer.buffer("Begin test " + name)); report.run++; } @Override public void reportEndTestCase(ReportImpl report, String name, TestResult result) { if (result.succeeded()) { info.accept(Buffer.buffer("Passed " + result.name())); } else { if (result.failure().isError()) { report.errors++; } else { report.failures++; } error.accept(Buffer.buffer("Failed " + result.name()), result.failure().cause()); } } @Override public void reportEndTestSuite(ReportImpl report, String name, Throwable err) { if (err != null) { error.accept(Buffer.buffer("Test suite " + name + " failure"), err); } String msg = "End test suite " + name + " , run: " + report.run + ", Failures: " + report.failures + ", Errors: " + report.errors; info.accept(Buffer.buffer(msg)); if (endHandler != null) { endHandler.handle(null); } } }
[ "julien@julienviet.com" ]
julien@julienviet.com
f7bb74f852ebbe49355f29da0f2cf7a0b0de414a
c6e9d89306da3dee1b2339014d8b8216309c052b
/src/org/adligo/fabricate_tests/models/dependencies/LibraryDependencyTrial.java
7d901bdada0749a1a7adebcef8e46a831584a715
[ "Apache-2.0" ]
permissive
adligo/fabricate_tests.adligo.org
70143d659c1cf50cc9ef23e1a0c1ac74ba87fa5a
b2d2c80d2c6fb84338fb1c1599888629b348abe0
refs/heads/master
2021-01-10T21:35:35.966080
2015-04-01T13:36:45
2015-04-01T13:36:45
33,228,690
0
0
null
null
null
null
UTF-8
Java
false
false
5,486
java
package org.adligo.fabricate_tests.models.dependencies; import org.adligo.fabricate.models.dependencies.LibraryDependency; import org.adligo.fabricate.models.dependencies.LibraryDependencyMutant; import org.adligo.fabricate.xml.io_v1.library_v1_0.LibraryReferenceType; import org.adligo.tests4j.shared.asserts.common.ExpectedThrowable; import org.adligo.tests4j.shared.asserts.common.I_Thrower; import org.adligo.tests4j.system.shared.trials.SourceFileScope; import org.adligo.tests4j.system.shared.trials.Test; import org.adligo.tests4j_4mockito.MockitoSourceFileTrial; import java.util.ArrayList; import java.util.List; @SourceFileScope (sourceClass=LibraryDependency.class, minCoverage=80.0) public class LibraryDependencyTrial extends MockitoSourceFileTrial { @Test public void testConstructorExceptions() { assertThrown(new ExpectedThrowable(NullPointerException.class), new I_Thrower() { @SuppressWarnings("unused") @Override public void run() throws Throwable { new LibraryDependency(null); } }); } @Test public void testConstructorCopy() { LibraryDependencyMutant pdm = new LibraryDependencyMutant(); pdm.setPlatform("platform"); pdm.setLibraryName("ln"); assertEquals("platform", pdm.getPlatform()); assertEquals("ln", pdm.getLibraryName()); LibraryDependency pdm2 = new LibraryDependency(pdm); assertEquals("platform", pdm2.getPlatform()); assertEquals("ln", pdm2.getLibraryName()); } @SuppressWarnings("boxing") @Test public void testMethodsEqualsHashCodeAndToString() { LibraryDependencyMutant pdm = new LibraryDependencyMutant(); pdm.setPlatform("platform"); pdm.setLibraryName("ln"); LibraryDependency pd = new LibraryDependency(pdm); LibraryDependencyMutant pdmA = new LibraryDependencyMutant(); pdmA.setPlatform("platform"); pdmA.setLibraryName("ln"); LibraryDependency pdA = new LibraryDependency(pdmA); LibraryDependencyMutant pdm2 = new LibraryDependencyMutant(); pdm2.setPlatform("platform"); pdm2.setLibraryName("ln2"); LibraryDependency pd2 = new LibraryDependency(pdm2); LibraryDependencyMutant pdm3 = new LibraryDependencyMutant(); pdm3.setPlatform("platform3"); pdm3.setLibraryName("ln"); LibraryDependency pd3 = new LibraryDependency(pdm3); LibraryDependencyMutant pdm4 = new LibraryDependencyMutant(); pdm4.setLibraryName("ln"); LibraryDependency pd4 = new LibraryDependency(pdm4); LibraryDependencyMutant pdm5 = new LibraryDependencyMutant(); pdm5.setPlatform("platform"); LibraryDependency pd5 = new LibraryDependency(pdm5); //LibraryDependency ld = new LibraryDependency() assertEquals(pd, pd); assertEquals(pd.hashCode(), pd.hashCode()); assertEquals("LibraryDependency [name=ln,platform=platform]", pd.toString()); assertEquals(pd, pdA); assertEquals(pd.hashCode(), pdA.hashCode()); assertNotEquals(pd, pd2); assertNotEquals(pd.hashCode(), pd2.hashCode()); assertNotEquals(pd, pd3); assertNotEquals(pd.hashCode(), pd3.hashCode()); assertNotEquals(pd, pd4); assertNotEquals(pd.hashCode(), pd4.hashCode()); assertNotEquals(pd, pd5); assertNotEquals(pd.hashCode(), pd5.hashCode()); assertEquals("LibraryDependency [name=ln2,platform=platform]", pd2.toString()); assertEquals("LibraryDependency [name=ln,platform=platform3]", pd3.toString()); assertNotEquals(pdA, pd2); assertNotEquals(pdA.hashCode(), pd2.hashCode()); assertNotEquals(pdA, pd3); assertNotEquals(pdA.hashCode(), pd3.hashCode()); assertNotEquals(pdA, pd4); assertNotEquals(pdA.hashCode(), pd4.hashCode()); assertNotEquals(pdA, pd5); assertNotEquals(pdA.hashCode(), pd5.hashCode()); assertEquals("LibraryDependency [name=ln]", pd4.toString()); assertNotEquals(pd3, pdA); assertNotEquals(pd3.hashCode(), pdA.hashCode()); assertNotEquals(pd3, pd2); assertNotEquals(pd3.hashCode(), pd2.hashCode()); assertNotEquals(pd3, pd4); assertNotEquals(pd3.hashCode(), pd4.hashCode()); assertNotEquals(pd3, pd5); assertNotEquals(pd3.hashCode(), pd5.hashCode()); assertEquals("LibraryDependency [name=null,platform=platform]", pd5.toString()); } @Test public void testStaticMethodsConvert() { LibraryReferenceType lrt = new LibraryReferenceType(); lrt.setPlatform("platform"); lrt.setValue("libA"); LibraryDependency ldm = LibraryDependency.convert(lrt); assertEquals("platform", ldm.getPlatform()); assertEquals("libA", ldm.getLibraryName()); LibraryReferenceType lrtB = new LibraryReferenceType(); lrtB.setPlatform("platformB"); lrtB.setValue("libB"); LibraryDependency ldmB = LibraryDependency.convert(lrtB); assertEquals("platformB", ldmB.getPlatform()); assertEquals("libB", ldmB.getLibraryName()); List<LibraryReferenceType> asList = new ArrayList<LibraryReferenceType>(); asList.add(lrt); asList.add(lrtB); List<LibraryDependency> convertedList = LibraryDependency.convert(asList); ldm = convertedList.get(0); assertEquals("platform", ldm.getPlatform()); assertEquals("libA", ldm.getLibraryName()); ldmB = convertedList.get(1); assertEquals("platformB", ldmB.getPlatform()); assertEquals("libB", ldmB.getLibraryName()); } }
[ "scott@adligo.com" ]
scott@adligo.com
8f1dffc7ba9051f01c6d7f4a82cb2005a82439f8
dce4ff9edbef476d218c79cec4acd8861b09642c
/xenon-android-library/src/main/java/com/abubusoft/xenon/animations/TextureAnimationLoader.java
c989f288c1cdb5402c92abd9e3684cc3f2887e92
[]
no_license
skykying/xenon
d3e1cdc79932892d2a396926f9d21962ddef0568
619cc533e602307a62ceaf739daea76f88c37994
refs/heads/master
2021-09-16T04:22:45.416370
2018-06-16T09:01:28
2018-06-16T09:01:28
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,847
java
package com.abubusoft.xenon.animations; import java.util.ArrayList; import java.util.HashMap; import com.abubusoft.xenon.texture.Texture; import com.abubusoft.xenon.texture.TextureManager; import com.abubusoft.xenon.texture.TextureOptions; import com.abubusoft.xenon.texture.AtlasTexture; import com.abubusoft.xenon.texture.AtlasTextureOptions; import com.abubusoft.xenon.texture.TextureRegion; import com.abubusoft.kripton.android.Logger; import com.abubusoft.xenon.core.util.IOUtility; import android.content.Context; /** * Classe di utilitaà per caricare animazioni in formato gdx * * @author Francesco Benincasa * */ class TextureAnimationLoader { /** * <p> * Carica la definizione di una texture animation. L'animazione si compone di 3 risorse: l'atlas, la definizione degli sprite e quella delle animazioni. Dato ad esempio un * baseName <b>heart</b> i nomi dei file dovrebbero essere rispettivamente <b>heart.png</b> <b>heart_sprites.txt</b> e <b>heart_animations.txt</b> * </p> * * @param context * context * @param spriteDefinitionResourceId * resource id della definizione dello sprite * @param animationDefinitionResourceId * resource id della definizione delle animazioni * @param imageResourceId * id dell'immagine * @param options * opzioni per il caricamento della texture * @return atlas */ static ArrayList<TextureAnimation> loadFromResources(Context context, int spriteDefinitionResourceId, int animationDefinitionResourceId, int imageResourceId, TextureOptions options) { try { Texture texture = TextureManager.instance().createTextureFromResourceId(context, imageResourceId, options); AtlasTexture atlasTexture = TextureManager.instance().createAtlasTexture(texture, AtlasTextureOptions.build()); String spriteDefinition = IOUtility.readRawTextFile(context, spriteDefinitionResourceId); HashMap<String, TextureRegion> tilesMap = GDXParserHelper.createTiles(spriteDefinition, atlasTexture); String animationDefinition = IOUtility.readRawTextFile(context, animationDefinitionResourceId); ArrayList<TextureAnimation> animationMap = GDXParserHelper.createAnimations(animationDefinition, tilesMap, atlasTexture); return animationMap; } catch (Exception e) { Logger.fatal(e.getMessage()); e.printStackTrace(); return null; } } /** * <p> * Carica la definizione di una texture animation. L'animazione si compone di 3 file: l'atlas, la definizione degli sprite e quella delle animazioni. Dato ad esempio un * baseName <b>heart</b> i nomi dei file dovrebbero essere rispettivamente <b>heart.png</b> <b>heart.sprites</b> e <b>heart.animations</b> * </p> * * @param context * context * @param baseName * nome di base dell'animazione * @param options * opzioni per il caricamento della texture * @return atlas */ static ArrayList<TextureAnimation> loadFromAssets(Context context, String baseName, TextureOptions options) { try { Texture texture = TextureManager.instance().createTextureFromAssetsFile(context, baseName + ".png", options); AtlasTexture atlasTexture = TextureManager.instance().createAtlasTexture(texture, AtlasTextureOptions.build()); String spriteDefinition = IOUtility.readTextFileFromAssets(context, baseName + ".sprites"); HashMap<String, TextureRegion> tilesMap = GDXParserHelper.createTiles(spriteDefinition, atlasTexture); String animationDefinition = IOUtility.readTextFileFromAssets(context, baseName + ".animations"); ArrayList<TextureAnimation> animationMap = GDXParserHelper.createAnimations(animationDefinition, tilesMap, atlasTexture); return animationMap; } catch (Exception e) { Logger.fatal(e.getMessage()); e.printStackTrace(); return null; } } }
[ "abubusoft@gmail.com" ]
abubusoft@gmail.com
3c023b0b39fd802ec482dd6504ef1f1910dc13bd
a06cafcdfa8541e70a064875a1a3425a228de740
/curator-recipes/src/main/java/com/netflix/curator/framework/recipes/locks/RevocationListener.java
6a75ff24aa0122820590bb075d0f14ecc8f7a9d5
[ "Apache-2.0" ]
permissive
artemip/curator
0e1312e9e6e624ce50b43c4befeaf7fa47c04a87
01104d219adb3cfdedf9304b57beaf13f11d79ff
refs/heads/master
2021-01-18T06:41:41.375901
2012-07-05T19:04:23
2012-07-05T19:04:23
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,010
java
/* * * Copyright 2011 Netflix, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package com.netflix.curator.framework.recipes.locks; public interface RevocationListener<T> { /** * Called when a revocation request has been received. You should release the lock as soon * as possible. Revocation is cooperative. * * @param forLock the lock that should release */ public void revocationRequested(T forLock); }
[ "jordan@jordanzimmerman.com" ]
jordan@jordanzimmerman.com
187a4eeb2a500ca82bde87d3fa72415d94894021
45c00f46940dbd54517933ed5376797ba100ddfd
/src/main/java/org/ccframe/client/module/bike/view/AgentAppWindowView.java
82fed117607e8b638acbc0487b91ecc9204e11bb
[]
no_license
hoku850/bike-server
1926a92c1ef69a2ec6e497b2a653de6f89b96d43
a75559e923849ab96319438cc45dfbe7115206ef
refs/heads/master
2021-07-01T03:56:16.995615
2017-09-21T07:31:28
2017-09-21T07:31:28
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,485
java
package org.ccframe.client.module.bike.view; import org.ccframe.client.base.BaseWindowView; import org.ccframe.client.commons.CcFormPanelHelper; import org.ccframe.client.commons.ClientManager; import org.ccframe.client.commons.RestCallback; import org.ccframe.client.components.CcLabelValueCombobox; import org.ccframe.client.components.CcTextField; import org.ccframe.client.components.CcVBoxLayoutContainer; import org.ccframe.subsys.bike.domain.entity.AgentApp; import org.fusesource.restygwt.client.Method; import com.google.gwt.core.client.GWT; import com.google.gwt.editor.client.Editor; import com.google.gwt.editor.client.SimpleBeanEditorDriver; import com.google.gwt.uibinder.client.UiBinder; import com.google.gwt.uibinder.client.UiField; import com.google.gwt.uibinder.client.UiHandler; import com.google.gwt.user.client.ui.Widget; import com.google.inject.Singleton; import com.sencha.gxt.widget.core.client.Component; import com.sencha.gxt.widget.core.client.button.TextButton; import com.sencha.gxt.widget.core.client.event.SelectEvent; import com.sencha.gxt.widget.core.client.form.FormPanelHelper; import com.sencha.gxt.widget.core.client.info.Info; @Singleton public class AgentAppWindowView extends BaseWindowView<Integer, AgentApp> implements Editor<AgentApp>{ interface AgentAppUiBinder extends UiBinder<Component, AgentAppWindowView> {} interface AgentAppDriver extends SimpleBeanEditorDriver<AgentApp, AgentAppWindowView> {} private static AgentAppUiBinder uiBinder = GWT.create(AgentAppUiBinder.class); private AgentAppDriver driver = GWT.create(AgentAppDriver.class); private Integer agentAppId; @UiField CcVBoxLayoutContainer vBoxLayoutContainer; @UiField CcTextField appNm; @UiField CcTextField iosUrl; @UiField CcTextField androidUrl; @UiField CcLabelValueCombobox orgId; @UiHandler("saveButton") public void handleSaveClick(SelectEvent e){ if(FormPanelHelper.isValid(vBoxLayoutContainer, false)){ final AgentApp agentApp = driver.flush(); agentApp.setAgentAppId(agentAppId); final TextButton button = ((TextButton)(e.getSource())); button.disable(); ClientManager.getAgentAppClient().saveOrUpdate(agentApp, new RestCallback<Void>(){ @Override public void onSuccess(Method method, Void response) { Info.display("操作完成", "运营商APP" + (agentAppId == null ? "新增" : "修改") + "成功"); AgentAppWindowView.this.retCallBack.onClose(agentApp); //保存并回传结果数据 button.enable(); window.hide(); } @Override protected void afterFailure(){ //如果采用按钮的disable逻辑,一定要在此方法enable按钮 button.enable(); } }); } } @Override protected Widget bindUi() { Widget widget = uiBinder.createAndBindUi(this); driver.initialize(this); driver.edit(new AgentApp()); return widget; } @Override protected void onLoadData(Integer agentAppId) { this.agentAppId = agentAppId; window.setHeadingText("运营商APP" + (agentAppId == null ? "增加" : "修改")); orgId.reset(); CcFormPanelHelper.clearInvalid(vBoxLayoutContainer); // 重置下拉框 if(agentAppId == null){ FormPanelHelper.reset(vBoxLayoutContainer); }else{ ClientManager.getAgentAppClient().getById(agentAppId, new RestCallback<AgentApp>(){ @Override public void onSuccess(Method method, AgentApp response) { driver.edit(response); } }); } vBoxLayoutContainer.forceLayout(); } }
[ "1275563227@qq.com" ]
1275563227@qq.com
91ed6677876f6d17388e702e10109bd57c314a1d
dd992034b16f51c33101c0ff25498a6063fa5805
/websourceviewer/src/main/java/com/ngyb/websourceviewer/StreamUtils.java
d4c8a9d0beb6113324aee654c630d6938366d078
[]
no_license
nangongyibin/Android_NetLib
188d31028f685bb8a6c63d5cf4ee78be79d8d224
8aeb257551957ee978a1f2e212110623d1a15ba4
refs/heads/master
2021-07-24T06:26:13.369473
2020-08-11T14:03:59
2020-08-11T14:03:59
206,793,507
0
0
null
null
null
null
UTF-8
Java
false
false
770
java
package com.ngyb.websourceviewer; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; /** * 作者:南宫燚滨 * 描述: * 邮箱:nangongyibin@gmail.com * 日期:2019/9/4 21:48 */ public class StreamUtils { /** * @param is * @return */ public static String StreamToString(InputStream is) { try { ByteArrayOutputStream baos = new ByteArrayOutputStream(); int len = 0; byte[] buf = new byte[1024]; while ((len = is.read(buf)) != -1) { baos.write(buf, 0, len); } return baos.toString(); } catch (IOException e) { e.printStackTrace(); return ""; } } }
[ "nangongyibin@gmail.com" ]
nangongyibin@gmail.com
f85d1344d0a2b8556626219037956a3c94ccf90a
7a9c01bbee5d314a2d97bfb2aef67fcb4accc11d
/com/unity3d/player/C0696d.java
dd3336a688b384c45c3b02aaaede66fde66d866d
[]
no_license
Kainanchen/Sangokushi
72c9ec0aa654e95bc3622a8a3d758eedfc32276e
80fdb55c92776690b9b02aa0a6fba3dc7790025e
refs/heads/master
2021-01-13T01:17:35.153817
2017-03-14T22:01:10
2017-03-14T22:01:10
82,147,818
0
1
null
null
null
null
UTF-8
Java
false
false
2,552
java
package com.unity3d.player; import android.graphics.SurfaceTexture; import android.hardware.Camera; import android.os.Handler; import android.view.View; import android.view.View.OnSystemUiVisibilityChangeListener; import com.ut.device.AidConstants; /* renamed from: com.unity3d.player.d */ public final class C0696d implements C0695f { private static final SurfaceTexture f2259a; private static final int f2260b; private volatile boolean f2261c; /* renamed from: com.unity3d.player.d.1 */ class C06931 implements OnSystemUiVisibilityChangeListener { final /* synthetic */ View f2255a; final /* synthetic */ C0696d f2256b; C06931(C0696d c0696d, View view) { this.f2256b = c0696d; this.f2255a = view; } public final void onSystemUiVisibilityChange(int i) { this.f2256b.m2560a(this.f2255a, (int) AidConstants.EVENT_REQUEST_STARTED); } } /* renamed from: com.unity3d.player.d.2 */ class C06942 implements Runnable { final /* synthetic */ View f2257a; final /* synthetic */ C0696d f2258b; C06942(C0696d c0696d, View view) { this.f2258b = c0696d; this.f2257a = view; } public final void run() { this.f2258b.m2564a(this.f2257a, this.f2258b.f2261c); } } static { f2259a = new SurfaceTexture(-1); f2260b = C0714q.f2296f ? 5894 : 1; } private void m2560a(View view, int i) { Handler handler = view.getHandler(); if (handler == null) { m2564a(view, this.f2261c); } else { handler.postDelayed(new C06942(this, view), 1000); } } public final void m2563a(View view) { if (!C0714q.f2297g) { view.setOnSystemUiVisibilityChangeListener(new C06931(this, view)); } } public final void m2564a(View view, boolean z) { this.f2261c = z; view.setSystemUiVisibility(this.f2261c ? view.getSystemUiVisibility() | f2260b : view.getSystemUiVisibility() & (f2260b ^ -1)); } public final boolean m2565a(Camera camera) { try { camera.setPreviewTexture(f2259a); return true; } catch (Exception e) { return false; } } public final void m2566b(View view) { if (!C0714q.f2296f && this.f2261c) { m2564a(view, false); this.f2261c = true; } m2560a(view, (int) AidConstants.EVENT_REQUEST_STARTED); } }
[ "kainan.chen.cn@gmail.com" ]
kainan.chen.cn@gmail.com
56027a17d93929e03d36fe4a2dcd0c88a72d9fd5
01d6b951ce24b3d2c89b1ffa18fd79aaa9c4599c
/src/com/google/android/gms/cast/CastMediaControlIntent.java
e15994997999891d250b07f1984738a7225eff1c
[]
no_license
mohsenuss91/KGBANDROID
1a5cc246bf17b85dae4733c10a48cc2c34f978fd
a2906e3de617b66c5927a4d1fd85f6a3c6ed89d0
refs/heads/master
2016-09-03T06:45:38.912322
2015-03-08T12:03:35
2015-03-08T12:03:35
31,847,141
0
0
null
null
null
null
UTF-8
Java
false
false
4,681
java
// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: braces fieldsfirst space lnc package com.google.android.gms.cast; import android.text.TextUtils; import com.google.android.gms.internal.gj; import java.util.Collection; import java.util.Iterator; import java.util.Locale; public final class CastMediaControlIntent { public static final String ACTION_SYNC_STATUS = "com.google.android.gms.cast.ACTION_SYNC_STATUS"; public static final String CATEGORY_CAST = "com.google.android.gms.cast.CATEGORY_CAST"; public static final String DEFAULT_MEDIA_RECEIVER_APPLICATION_ID = "CC1AD845"; public static final int ERROR_CODE_REQUEST_FAILED = 1; public static final int ERROR_CODE_SESSION_START_FAILED = 2; public static final int ERROR_CODE_TEMPORARILY_DISCONNECTED = 3; public static final String EXTRA_CAST_APPLICATION_ID = "com.google.android.gms.cast.EXTRA_CAST_APPLICATION_ID"; public static final String EXTRA_CAST_LANGUAGE_CODE = "com.google.android.gms.cast.EXTRA_CAST_LANGUAGE_CODE"; public static final String EXTRA_CAST_RELAUNCH_APPLICATION = "com.google.android.gms.cast.EXTRA_CAST_RELAUNCH_APPLICATION"; public static final String EXTRA_CAST_STOP_APPLICATION_WHEN_SESSION_ENDS = "com.google.android.gms.cast.EXTRA_CAST_STOP_APPLICATION_WHEN_SESSION_ENDS"; public static final String EXTRA_CUSTOM_DATA = "com.google.android.gms.cast.EXTRA_CUSTOM_DATA"; public static final String EXTRA_DEBUG_LOGGING_ENABLED = "com.google.android.gms.cast.EXTRA_DEBUG_LOGGING_ENABLED"; public static final String EXTRA_ERROR_CODE = "com.google.android.gms.cast.EXTRA_ERROR_CODE"; private CastMediaControlIntent() { } private static String a(String s, String s1, Collection collection) { StringBuffer stringbuffer = new StringBuffer(s); if (s1 != null) { if (!s1.matches("[A-F0-9]+") && !s1.equals("00000000-0000-0000-0000-000000000000")) { throw new IllegalArgumentException((new StringBuilder("Invalid application ID: ")).append(s1).toString()); } stringbuffer.append("/").append(s1); } if (collection != null) { if (collection.isEmpty()) { throw new IllegalArgumentException("Must specify at least one namespace"); } for (Iterator iterator = collection.iterator(); iterator.hasNext();) { String s2 = (String)iterator.next(); if (TextUtils.isEmpty(s2) || s2.trim().equals("")) { throw new IllegalArgumentException("Namespaces must not be null or empty"); } } if (s1 == null) { stringbuffer.append("/"); } stringbuffer.append("/").append(TextUtils.join(",", collection)); } return stringbuffer.toString(); } public static String categoryForCast(String s) { if (s == null) { throw new IllegalArgumentException("applicationId cannot be null"); } else { return a("com.google.android.gms.cast.CATEGORY_CAST", s, null); } } public static String categoryForCast(String s, Collection collection) { if (s == null) { throw new IllegalArgumentException("applicationId cannot be null"); } if (collection == null) { throw new IllegalArgumentException("namespaces cannot be null"); } else { return a("com.google.android.gms.cast.CATEGORY_CAST", s, collection); } } public static String categoryForCast(Collection collection) { if (collection == null) { throw new IllegalArgumentException("namespaces cannot be null"); } else { return a("com.google.android.gms.cast.CATEGORY_CAST", null, collection); } } public static String categoryForRemotePlayback() { return a("com.google.android.gms.cast.CATEGORY_CAST_REMOTE_PLAYBACK", null, null); } public static String categoryForRemotePlayback(String s) { if (TextUtils.isEmpty(s)) { throw new IllegalArgumentException("applicationId cannot be null or empty"); } else { return a("com.google.android.gms.cast.CATEGORY_CAST_REMOTE_PLAYBACK", s, null); } } public static String languageTagForLocale(Locale locale) { return gj.b(locale); } }
[ "mohsenuss91@hotmail.com" ]
mohsenuss91@hotmail.com
c53c9fc719f43dd184e719d2bb20f35013ae71aa
4fb4603578010499b0e2ae39497199838d2d072c
/branches/icefaces4_ICE-10145/icefaces/ace/generator/src/org/icefaces/ace/meta/annotation/Required.java
dc27abaf31c2201b2515a971eabb8853a81aabf8
[ "Apache-2.0" ]
permissive
svn2github/icefaces-4-3
5f05a89225a6543725d69ed79e33b695f5d333b8
c6cea194d02b5536256ff7c81a3a697f1890ff74
refs/heads/master
2020-04-08T17:31:09.320358
2018-12-13T23:20:36
2018-12-13T23:20:36
159,570,706
0
0
null
null
null
null
UTF-8
Java
false
false
786
java
/* * Copyright 2004-2014 ICEsoft Technologies Canada Corp. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an "AS * IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language * governing permissions and limitations under the License. */ package org.icefaces.ace.meta.annotation; public enum Required { yes, no, UNSET; public static final Required DEFAULT = Required.no; }
[ "ken.fyten@8668f098-c06c-11db-ba21-f49e70c34f74" ]
ken.fyten@8668f098-c06c-11db-ba21-f49e70c34f74
d778c6aa5a9ca41ceb1f072a2310fb7b568b1aeb
ca7da6499e839c5d12eb475abe019370d5dd557d
/spring-beans/src/main/java/org/springframework/beans/factory/annotation/Required.java
a3154152fb3c8cf82815eb27a92f72808fad2a97
[ "Apache-2.0" ]
permissive
yangfancoming/spring-5.1.x
19d423f96627636a01222ba747f951a0de83c7cd
db4c2cbcaf8ba58f43463eff865d46bdbd742064
refs/heads/master
2021-12-28T16:21:26.101946
2021-12-22T08:55:13
2021-12-22T08:55:13
194,103,586
0
1
null
null
null
null
UTF-8
Java
false
false
924
java
package org.springframework.beans.factory.annotation; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Marks a method (typically a JavaBean setter method) as being 'required': that is, * the setter method must be configured to be dependency-injected with a value. * * Please do consult the javadoc for the {@link RequiredAnnotationBeanPostProcessor} * class (which, by default, checks for the presence of this annotation). * * @author Rob Harrop * @since 2.0 * @see RequiredAnnotationBeanPostProcessor * @deprecated as of 5.1, in favor of using constructor injection for required settings * (or a custom {@link org.springframework.beans.factory.InitializingBean} implementation) */ @Deprecated @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.METHOD) public @interface Required { }
[ "34465021+jwfl724168@users.noreply.github.com" ]
34465021+jwfl724168@users.noreply.github.com
2d9e6b93f134494e03aeebd33617b446ce386ea6
c04e06c47f73326a6bcb15d9203a36b389cf05ee
/src/main/java/cn/com/zhihetech/online/bean/BuyerUser.java
d83741afa04ef7fc8f963ececd83d177cd702b1b
[]
no_license
qq524007127/online
6994886381c88a29d8d8c78155c11935061bc20d
a3b979295e5524b0c4c6536e238b4b32d9cfea88
refs/heads/master
2021-01-10T04:48:05.451826
2016-01-14T02:04:44
2016-01-14T02:04:57
49,615,412
0
0
null
null
null
null
UTF-8
Java
false
false
1,116
java
package cn.com.zhihetech.online.bean; import cn.com.zhihetech.online.commons.Constant; import javax.persistence.*; /** * Created by ShenYunjie on 2016/1/13. */ @Entity @DiscriminatorValue("buyer_type") public class BuyerUser extends User { private ImgInfo wxPhoto; //微信朋友圈截图 private int wnFriendsCount; //微信好友人数 private float wxMFRatio; //微信好友男女比例 @ManyToOne @JoinColumn(name = "wx_photo") public ImgInfo getWxPhoto() { return wxPhoto; } public void setWxPhoto(ImgInfo wxPhoto) { this.wxPhoto = wxPhoto; } @Column(name = "wx_friends_count") public int getWnFriendsCount() { return wnFriendsCount; } public void setWnFriendsCount(int wnFriendsCount) { this.wnFriendsCount = wnFriendsCount; } @Column(name = "wx_mf_ratio") public float getWxMFRatio() { return wxMFRatio; } public void setWxMFRatio(float wxMFRatio) { this.wxMFRatio = wxMFRatio; } @Override public int getUserType() { return Constant.BUYER_USER; } }
[ "524007127" ]
524007127
e0622c9d5e10f64a18930c3852560d8c6806c3b7
83ccd81ac7377939b8cd008bd6f1f26288fbc50b
/Programing Basic Java 2018/ProgrammingBasicsMay2018/src/Nums1To20.java
84cdda5ec0a79fee7cde57481b37e39f67ec0308
[]
no_license
HristoStavrev89/SoftUni
2b1f84252a5963cfddd3a133a9c97881579ab859
b28802332d7c3ea9da767ee37553521ea5c6b91f
refs/heads/master
2022-11-25T07:08:53.313418
2020-12-05T08:57:45
2020-12-05T08:57:45
253,452,274
0
0
null
2020-04-06T09:47:32
2020-04-06T09:31:23
Java
UTF-8
Java
false
false
709
java
public class Nums1To20 { public static void main(String[] args) { System.out.println(1); System.out.println(2); System.out.println(3); System.out.println(4); System.out.println(5); System.out.println(6); System.out.println(7); System.out.println(8); System.out.println(9); System.out.println(10); System.out.println(11); System.out.println(12); System.out.println(13); System.out.println(14); System.out.println(15); System.out.println(16); System.out.println(17); System.out.println(18); System.out.println(19); System.out.println(20); } }
[ "hristo.stavrev@yahoo.com" ]
hristo.stavrev@yahoo.com
b820097c0f2f8fa3f7b7379a1fc073a93bc7d76e
e044f1e94835abb6e57f7d1ff6ca6e87b36c365b
/api/src/main/java/com/ulfric/turtle/GET.java
77034f44fe32fb4c699fd39d4b84d1429570977b
[]
no_license
ulfricarchive/turtle
a7cfceb97dc19ad3ddd3c347adcc42056d3ad791
ec5103e2179f0deec2609b230ad912a989c218c2
refs/heads/master
2021-03-27T18:39:13.020787
2017-01-31T10:47:48
2017-01-31T10:47:48
80,331,156
0
0
null
null
null
null
UTF-8
Java
false
false
280
java
package com.ulfric.turtle; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.METHOD) public @interface GET { }
[ "ad@mharrison.us" ]
ad@mharrison.us
a5af5bf398295929cff4514752fe26099df0c7b4
2ed796459754d8582ed72caecb4d28e42e57ca40
/Holo/src/main/java/com/holo/vo/BistroPageMaker.java
4becbf361984c3626270648d4d2284f56aaef0aa
[]
no_license
auviolet/Holo
922fa49f5238f812f48b61b5cbfb7f9dbf929d95
380bd3c113942421fb42973b1ab97bc95894a428
refs/heads/master
2021-05-07T07:28:11.021970
2017-11-01T12:45:30
2017-11-01T12:45:30
109,129,733
1
0
null
null
null
null
UTF-8
Java
false
false
2,134
java
package com.holo.vo; import org.springframework.web.util.UriComponents; import org.springframework.web.util.UriComponentsBuilder; public class BistroPageMaker { private int totalCount; private int startPage; private int endPage; private boolean prev; private boolean next; private int displayPageNum = 10; // 화면에 보여지는 페이지 번호의 숫자. private BistroCriteria cri; public void setCri(BistroCriteria cri) { this.cri = cri; } public void setTotalCount(int totalCount) { this.totalCount = totalCount; calcData(); } private void calcData() { endPage = (int) (Math.ceil(cri.getPage() / (double) displayPageNum) * displayPageNum); startPage = (endPage - displayPageNum) + 1; int tempEndPage = (int) (Math.ceil(totalCount / (double) cri.getPerPageNum())); if (endPage > tempEndPage) { endPage = tempEndPage; } prev = startPage == 1 ? false : true; next = endPage * cri.getPerPageNum() >= totalCount ? false : true; } public int getTotalCount() { return totalCount; } public int getStartPage() { return startPage; } public int getEndPage() { return endPage; } public boolean isPrev() { return prev; } public boolean isNext() { return next; } public int getDisplayPageNum() { return displayPageNum; } public BistroCriteria getCri() { return cri; } public String makeQuery(int page) { UriComponents uriComponents = UriComponentsBuilder.newInstance().queryParam("page", page) .queryParam("perPageNum", cri.getPerPageNum()).build(); return uriComponents.toUriString(); } public String makeSearch(int page){ UriComponents uriComponents = UriComponentsBuilder.newInstance() .queryParam("page", page) .queryParam("perPageNum", cri.getPerPageNum()) .build(); return uriComponents.toUriString(); } }
[ "you@example.com" ]
you@example.com
cb73233369f054cb5c1fc7dcd69ffc15398d017a
7668d8cce3e305f45756b1a4818cca2ea62e8b49
/uitest/src/com/vaadin/tests/push/PushErrorHandling.java
3074bd38514d5818d12957ba85750aae0c57b938
[]
no_license
rtvt123/vaadin
014b29a477dcc96cae60401e5ea80a39bc86e1b0
bc0d55197a2b7fd8a6ac163688026d92203f2618
refs/heads/master
2022-08-27T11:35:43.168720
2013-11-07T11:28:53
2013-11-07T12:16:39
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,236
java
package com.vaadin.tests.push; import java.util.ArrayList; import java.util.Collection; import java.util.List; import com.vaadin.data.util.AbstractInMemoryContainer; import com.vaadin.data.util.BeanContainer; import com.vaadin.event.ItemClickEvent; import com.vaadin.event.ItemClickEvent.ItemClickListener; import com.vaadin.server.ErrorHandler; import com.vaadin.server.VaadinRequest; import com.vaadin.server.VaadinSession; import com.vaadin.shared.communication.PushMode; import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Label; import com.vaadin.ui.Table; public class PushErrorHandling extends AbstractTestUI { @Override protected void setup(VaadinRequest request) { getPushConfiguration().setPushMode(PushMode.AUTOMATIC); VaadinSession.getCurrent().setErrorHandler(new ErrorHandler() { @Override public void error(com.vaadin.server.ErrorEvent event) { addComponent(new Label("An error! " + event.getThrowable().getMessage())); System.err.println("An error! " + event.getThrowable().getMessage()); } }); final Button button = new Button("Click for NPE!", new Button.ClickListener() { @Override public void buttonClick(ClickEvent event) { ((String) null).length(); // Null-pointer exception } }); addComponent(button); final Table view = new Table("testtable"); view.setSelectable(true); view.setMultiSelect(false); view.setImmediate(true); view.setSizeFull(); view.addItemClickListener(new ItemClickListener() { @Override public void itemClick(ItemClickEvent event) { BeanContainer<String, AbstractInMemoryContainer> metaContainer = new BeanContainer<String, AbstractInMemoryContainer>( AbstractInMemoryContainer.class) { @Override public Collection<String> getContainerPropertyIds() { List<String> cpropIds = new ArrayList<String>(super .getContainerPropertyIds()); cpropIds.add("testid"); return cpropIds; } @Override public Class<?> getType(Object propertyId) { ((Object) null).hashCode(); return super.getType(propertyId); } }; view.setContainerDataSource(metaContainer); } }); view.addContainerProperty("Column", String.class, "Click for NPE"); view.addItem(new Object()); addComponent(view); } @Override protected String getTestDescription() { return "Error handling should still work w/ push enabled. (Button can be handled properly, table causes internal error)"; } @Override protected Integer getTicketNumber() { return 11882; } }
[ "review@vaadin.com" ]
review@vaadin.com
9abf1fe85fc6f8f5d053fd168ca1104b501eab8f
544cfadc742536618168fc80a5bd81a35a5f2c99
/packages/apps/Car/Dialer/tests/robotests/src/com/android/car/dialer/ui/common/SingleLiveEventTest.java
181a41e687a73a149cf402440c24339b4e00b919
[]
no_license
ZYHGOD-1/Aosp11
0400619993b559bf4380db2da0addfa9cccd698d
78a61ca023cbf1a0cecfef8b97df2b274ac3a988
refs/heads/main
2023-04-21T20:13:54.629813
2021-05-22T05:28:21
2021-05-22T05:28:21
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,189
java
/* * Copyright (C) 2020 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.car.dialer.ui.common; import static com.google.common.truth.Truth.assertThat; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.never; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; import androidx.lifecycle.Lifecycle; import androidx.lifecycle.LifecycleOwner; import androidx.lifecycle.LifecycleRegistry; import com.android.car.dialer.CarDialerRobolectricTestRunner; import com.android.car.dialer.LiveDataObserver; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.ArgumentCaptor; import org.mockito.Captor; import org.mockito.Mock; import org.mockito.MockitoAnnotations; @RunWith(CarDialerRobolectricTestRunner.class) public class SingleLiveEventTest { private static final String VALUE = "setValue"; private SingleLiveEvent<String> mSingleLiveEvent; private LifecycleRegistry mLifecycleRegistry; @Mock private LifecycleOwner mMockLifecycleOwner; @Mock private LiveDataObserver<SingleLiveEvent> mMockObserver1; @Mock private LiveDataObserver<SingleLiveEvent> mMockObserver2; @Captor private ArgumentCaptor<String> mCaptor; @Before public void setup() { MockitoAnnotations.initMocks(this); mSingleLiveEvent = new SingleLiveEvent(); mLifecycleRegistry = new LifecycleRegistry(mMockLifecycleOwner); when(mMockLifecycleOwner.getLifecycle()).thenReturn(mLifecycleRegistry); } @Test public void test_onChangeCalledAfterSetValue() { mSingleLiveEvent.observe(mMockLifecycleOwner, mMockObserver1); verify(mMockObserver1, never()).onChanged(any()); mLifecycleRegistry.handleLifecycleEvent(Lifecycle.Event.ON_START); verify(mMockObserver1, never()).onChanged(any()); mSingleLiveEvent.setValue(VALUE); verify(mMockObserver1, times(1)).onChanged(mCaptor.capture()); assertThat(mCaptor.getValue()).isEqualTo(VALUE); } @Test public void test_onChangeOnlyHandledOnce() { mLifecycleRegistry.handleLifecycleEvent(Lifecycle.Event.ON_START); mSingleLiveEvent.observe(mMockLifecycleOwner, mMockObserver1); mSingleLiveEvent.observe(mMockLifecycleOwner, mMockObserver2); mSingleLiveEvent.setValue(VALUE); verify(mMockObserver1, times(1)).onChanged(mCaptor.capture()); assertThat(mCaptor.getValue()).isEqualTo(VALUE); verify(mMockObserver2, never()).onChanged(any()); } }
[ "rick_tan@qq.com" ]
rick_tan@qq.com
af048c1e6745477b9ad2b37fcb00507400f47b22
024ef33f04da3a84f9c44e4180604f5a9339f161
/ga-supervision-mgt/src/main/java/com/atosenet/ga/company/mgt/service/ga/employe/PhysicalRecordService.java
91d17f9178f9463c98f3e02d2168f717d5942c4c
[]
no_license
pitaoWang/ga_supervision
d95da46b39cf61185ac9c8f32f285e0198a4a8c2
4dc42dae1fae66f6065f27c65a52765b7e6f5f07
refs/heads/master
2020-04-08T22:27:49.202427
2018-12-04T09:43:35
2018-12-04T09:43:35
159,641,336
0
0
null
null
null
null
UTF-8
Java
false
false
2,207
java
package com.atosenet.ga.company.mgt.service.ga.employe; import java.util.List; import javax.servlet.http.HttpServletRequest; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; import com.atosenet.ga.company.db.model.ga.employe.Employee; import com.atosenet.ga.company.db.model.ga.employe.PhysicalRecord; import com.atosenet.ga.company.db.repos.ga.employe.EmployeeRepository; import com.atosenet.ga.company.db.repos.ga.employe.PhysicalRecordRepository; /** * @Description:TODO * @time:2017年9月1日 上午8:00:48 */ @Service @Transactional(propagation=Propagation.SUPPORTS,readOnly = true) public class PhysicalRecordService { @Autowired PhysicalRecordRepository physicalRecordRepository; @Autowired EmployeeRepository employeeRepository; /** * 增加 */ @Transactional(readOnly=false) public void save(PhysicalRecord record,HttpServletRequest request){ PhysicalRecord employee= physicalRecordRepository.save(record); Employee em = employeeRepository.findOne(employee.getEmployeeId()); em.setFlag(4); employeeRepository.save(em); } /** *删除 */ @Transactional(readOnly=false) public void delete(Long id){ physicalRecordRepository.delete(id); } /** *删除 */ @Transactional(readOnly=false) public void batchDelete(List<PhysicalRecord> entities){ physicalRecordRepository.delete(entities); } /** * 查询 */ @Transactional(readOnly=true) public Page<PhysicalRecord> findByEmployeeId(long employeeId, Pageable pageable){ return physicalRecordRepository.findByEmployeeId(employeeId, pageable); } @Transactional(readOnly=true) public List<PhysicalRecord> findByEmployeeId(long employeeId){ return physicalRecordRepository.findAllByEmployeeId(employeeId); } /** * 查询 */ @Transactional(readOnly=true) public PhysicalRecord findById(long id){ return physicalRecordRepository.findOne(id); } }
[ "wpt1225@126.com" ]
wpt1225@126.com
9bd0b8cd149f1a627cfe93c5b6485495b48118aa
c95ca5eeeb81f492383514d4a54e5f066d2ac08f
/xiaoyaoji-web/src/main/java/cn/com/xiaoyaoji/utils/JdbcUtils.java
e934a0119b4569afef2d5d59fd22a1d567ae1af8
[]
no_license
Jsonlu/api
679bc5fa6a54f732d98cadf3c07c0a4cfbcaaa58
a6695c46c5af22be06b4cfcc95286d3181e57b81
refs/heads/master
2021-01-01T19:38:09.510476
2017-07-29T07:25:44
2017-07-29T07:25:44
98,634,690
0
0
null
null
null
null
UTF-8
Java
false
false
1,565
java
package cn.com.xiaoyaoji.utils; import java.sql.Connection; import java.sql.SQLException; import org.apache.commons.dbutils.DbUtils; import com.alibaba.druid.pool.DruidDataSource; /** * @author: zhoujingjie * @Date: 16/5/2 */ public class JdbcUtils { private static DruidDataSource ds; static { ds = new DruidDataSource(); ds.setDriverClassName(ConfigUtils.getJdbcDriverclass()); ds.setUsername(ConfigUtils.getJdbcUsername()); ds.setPassword(ConfigUtils.getJdbcPassword()); ds.setUrl(ConfigUtils.getJdbcURL()); ds.setInitialSize(Integer.parseInt(ConfigUtils.getJdbcInitSize())); ds.setMaxWait(Long.parseLong(ConfigUtils.getJdbcMaxWait())); ds.setMaxActive(100); ds.setMinIdle(Integer.parseInt(ConfigUtils.getJdbcMinIdle())); ds.setTimeBetweenEvictionRunsMillis(10000); ds.setValidationQuery("select 'x'"); ds.setPoolPreparedStatements(true); try { ds.setFilters("stat"); } catch (SQLException e) { e.printStackTrace(); } } public static Connection getConnect() throws SQLException { Connection connection= ds.getConnection(); connection.setAutoCommit(false); return connection; } public static void close(Connection connection){ DbUtils.closeQuietly(connection); } public static void commit(Connection connection){ try { connection.commit(); } catch (SQLException e) { e.printStackTrace(); } } }
[ "a12345678" ]
a12345678
6c8b18c8e4efabf06771f592988066596372ac8f
ea4da81a69a300624a46fce9e64904391c37267c
/src/main/java/com/alipay/api/domain/AlipayOpenServicemarketInstanceSyncModel.java
dc94e028eefb2d3de2cd2fc0ecd50b90721788b8
[ "Apache-2.0" ]
permissive
shiwei1024/alipay-sdk-java-all
741cc3cb8cf757292b657ce05958ff9ad8ecf582
d6a051fd47836c719a756607e6f84fee2b26ecb4
refs/heads/master
2022-12-29T18:46:53.195585
2020-10-09T06:34:30
2020-10-09T06:34:30
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,981
java
package com.alipay.api.domain; import com.alipay.api.AlipayObject; import com.alipay.api.internal.mapping.ApiField; /** * 服务市场实例同步 * * @author auto create * @since 1.0, 2019-11-18 13:30:28 */ public class AlipayOpenServicemarketInstanceSyncModel extends AlipayObject { private static final long serialVersionUID = 4441873247631581169L; /** * 2088101118588888 */ @ApiField("consumer_uid") private String consumerUid; /** * 生效时间,格式yyyy-MM-dd HH:mm:ss */ @ApiField("effect_date") private String effectDate; /** * 事件类型 */ @ApiField("event") private String event; /** * 过期时间,格式yyyy-MM-dd HH:mm:ss */ @ApiField("expire_date") private String expireDate; /** * 金融科技产品码 */ @ApiField("fin_tech_product_code") private String finTechProductCode; /** * 最后修改时间,用做防请求乱序,针对同一条数据的更新,如果值小于上一个请求的值,该次请求会被丢弃。建议使用数据的修改时间,或者乐观锁的version作为参数值。 */ @ApiField("gmt_modified") private Long gmtModified; /** * 实例标识 */ @ApiField("instance_id") private String instanceId; /** * 金融科技实例状态 */ @ApiField("instance_status") private String instanceStatus; /** * 比如某种业务标准外部订单号,比如交易外部订单号,代表商户端自己订单号 */ @ApiField("out_biz_no") private String outBizNo; public String getConsumerUid() { return this.consumerUid; } public void setConsumerUid(String consumerUid) { this.consumerUid = consumerUid; } public String getEffectDate() { return this.effectDate; } public void setEffectDate(String effectDate) { this.effectDate = effectDate; } public String getEvent() { return this.event; } public void setEvent(String event) { this.event = event; } public String getExpireDate() { return this.expireDate; } public void setExpireDate(String expireDate) { this.expireDate = expireDate; } public String getFinTechProductCode() { return this.finTechProductCode; } public void setFinTechProductCode(String finTechProductCode) { this.finTechProductCode = finTechProductCode; } public Long getGmtModified() { return this.gmtModified; } public void setGmtModified(Long gmtModified) { this.gmtModified = gmtModified; } public String getInstanceId() { return this.instanceId; } public void setInstanceId(String instanceId) { this.instanceId = instanceId; } public String getInstanceStatus() { return this.instanceStatus; } public void setInstanceStatus(String instanceStatus) { this.instanceStatus = instanceStatus; } public String getOutBizNo() { return this.outBizNo; } public void setOutBizNo(String outBizNo) { this.outBizNo = outBizNo; } }
[ "ben.zy@antfin.com" ]
ben.zy@antfin.com
15fc0e48182570496f3a7b12dab0a2e62c29b14a
0016005ee6a22429433a4e0e66ff1303147179ec
/src/day21_MultiDimensionalArrays/DeepToString.java
8e8f5b3ae5305c61b3db7360314a19b2f43f38f0
[]
no_license
OrkhanMusayev/B18_JavaCourse
7d1fee404169ec7f45b20efc42456f0173577327
017a6cfca170ec0c0ace15fa5d5fb319529f2921
refs/heads/master
2022-12-10T06:03:38.178027
2020-08-22T23:31:10
2020-08-22T23:31:10
286,326,298
0
0
null
null
null
null
UTF-8
Java
false
false
823
java
package day21_MultiDimensionalArrays; import java.util.Arrays; import java.util.Arrays; public class DeepToString { public static void main(String[] args) { int[] arr1D = {1,2,3}; System.out.println(Arrays.toString(arr1D)); int[][] arr2D = {{1,2,3},{4,5,6}}; System.out.println( Arrays.toString(arr2D)); System.out.println( Arrays.deepToString(arr2D)); // 0 1 0 1 int[][][] arr3D = { {{1,2,3},{4,5,6}} , {{7,8,9},{10,11,12}} }; // 0 1 System.out.println( Arrays.deepToString( arr3D[1] ) ); System.out.println( Arrays.toString( arr3D[0][1] ) ); System.out.println( arr3D[1][1][2] ); } }
[ "mussayevorkhan@gmail.com" ]
mussayevorkhan@gmail.com
f083e49cf7aa7410215d813eee6e586de4067bfa
52280cf6517f27bde1ad70037bc20f9aaa01d6c5
/src/com/jd/lottery/lib/data/CurrIssueManager.java
61946c95b4f1c94e5e55ca033e246b242d03bfff
[]
no_license
xiangyong/JDMall
7730ae3395a44d03387f4d4075a1b2c8870c23be
5ce5a7870e87a67cad500903bc169cd266b5a2e9
refs/heads/master
2021-01-16T18:13:41.254336
2014-02-26T09:59:08
2014-02-26T09:59:08
null
0
0
null
null
null
null
UTF-8
Java
false
false
857
java
package com.jd.lottery.lib.data; import android.content.Context; import com.jd.droidlib.persist.sql.EntityManager; import com.jd.lottery.lib.model.CurrIssueEntity; public class CurrIssueManager extends EntityManager<CurrIssueEntity> { public CurrIssueManager(Context paramContext) { super(CurrIssueEntity.class, paramContext); } public boolean create(CurrIssueEntity paramCurrIssueEntity) { paramCurrIssueEntity.id = 0L; return super.create(paramCurrIssueEntity); } public boolean update(CurrIssueEntity paramCurrIssueEntity) { paramCurrIssueEntity.id = 0L; return super.update(paramCurrIssueEntity); } } /* Location: C:\Users\yepeng\Documents\classes-dex2jar.jar * Qualified Name: com.jd.lottery.lib.data.CurrIssueManager * JD-Core Version: 0.7.0.1 */
[ "13718868826@163.com" ]
13718868826@163.com