blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
7
410
content_id
stringlengths
40
40
detected_licenses
listlengths
0
51
license_type
stringclasses
2 values
repo_name
stringlengths
5
132
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringlengths
4
80
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
684M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
22 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
132 values
src_encoding
stringclasses
34 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
3
9.45M
extension
stringclasses
28 values
content
stringlengths
3
9.45M
authors
listlengths
1
1
author_id
stringlengths
0
352
e51e9147f892d2cb0b087801325e141ee9259370
bf6ad729fcb5fa7ca39ce8235f4ece4074f7beab
/models/src/main/java/com/trackme/models/payload/request/project/AssignRemoveRequest.java
0ba9f2560c0c03d705915eea86b27e899b197f5a
[]
no_license
MichaelAbouKhalil/TrackMe
22c28356532d6dd64a5f667a8ec2b2084acad4b7
745188e1a628d29aa5280921176f58bfad0c5670
refs/heads/master
2023-04-21T06:55:31.254379
2021-05-25T12:53:04
2021-05-25T12:53:04
360,894,555
1
0
null
null
null
null
UTF-8
Java
false
false
575
java
package com.trackme.models.payload.request.project; import com.trackme.models.constants.RegexValidationConstants; import lombok.*; import javax.validation.constraints.Email; import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotNull; @Data @NoArgsConstructor @AllArgsConstructor @ToString @Builder public class AssignRemoveRequest { @NotNull(message = "project id cannot be null") private Long projectId; @Email(regexp = RegexValidationConstants.EMAIL_REGEX, message = "email format is incorrect") private String email; }
[ "aboukhalil.michael@gmail.com" ]
aboukhalil.michael@gmail.com
1c42db80935e7b7091802130117ff3b398f660fe
2870a300ca7ae1950a5b10d953086595ffcc47f2
/src/SS18/PROG2/MusicLandscape/util/comparators/MyEventAttendeesComparator.java
877904b4394d266e936ba94f58030875ded3ea79
[]
no_license
annebond/BWI
d27f4f31a5a034dc83a394afa45a832087fd8961
46d04b9eb13082e966f7fa9391dd5356f8c09bfc
refs/heads/master
2018-09-11T00:15:35.706289
2018-07-04T07:15:19
2018-07-04T07:15:19
108,734,329
0
0
null
null
null
null
UTF-8
Java
false
false
539
java
package SS18.PROG2.MusicLandscape.util.comparators; import SS18.PROG2.MusicLandscape.entities.Event; public class MyEventAttendeesComparator extends MyEventComparator { @Override public int compare(Event e1, Event e2) { // TODO Auto-generated method stub if(e1==null && e2==null) { return 0; } if(e1==null && e2 != null) { return -e2.getAttendees(); } if(e2==null && e1 != null) { return e1.getAttendees(); } return e1.getAttendees()-e2.getAttendees(); } public MyEventAttendeesComparator() { } }
[ "anne.bondova@gmail.com" ]
anne.bondova@gmail.com
64b18d948e09fea4d859d7bce729c6b0be42dc9e
19da0a2fcf31e649ad586a802b592cf19b79513a
/src/LeftistHeap.java
be9246c61746657370983583233fc9b857f6d6ef
[]
no_license
jaxonwillard/CS2420assignment5Autocomplete
ad5ea1d217bd60a2a2f1f000cdf9dfbf2a875ab1
fb75ddc8ef7935975469aad96e41b88a67a54cdf
refs/heads/master
2020-08-30T12:47:22.800027
2019-11-05T19:13:18
2019-11-05T19:13:18
218,385,031
0
0
null
null
null
null
UTF-8
Java
false
false
6,270
java
// LeftistHeap class // // CONSTRUCTION: with a negative infinity sentinel // // ******************PUBLIC OPERATIONS********************* // void insert( x ) --> Insert x // Comparable deleteMin( )--> Return and remove smallest item // Comparable findMin( ) --> Return smallest item // boolean isEmpty( ) --> Return true if empty; else false // void makeEmpty( ) --> Remove all items // void merge( rhs ) --> Absorb rhs into this heap // ******************ERRORS******************************** // Throws UnderflowException as appropriate import java.nio.BufferUnderflowException; /** * Implements a leftist heap. * Note that all "matching" is based on the compareTo method. * @author Mark Allen Weiss */ public class LeftistHeap<AnyType extends Comparable<? super AnyType>> { int size = 0; /** * Construct the leftist heap. */ public LeftistHeap() { root = null; } /** * Merge rhs into the priority queue. * rhs becomes empty. rhs must be different from this. * * @param rhs the other leftist heap. */ public void merge(LeftistHeap<AnyType> rhs) { if (this == rhs) // Avoid aliasing problems return; root = merge(root, rhs.root); rhs.root = null; } /** * Internal method to merge two roots. * Deals with deviant cases and calls recursive merge1. */ private LeftistNode<AnyType> merge(LeftistNode<AnyType> h1, LeftistNode<AnyType> h2) { if (h1 == null) return h2; if (h2 == null) return h1; if (h1.element.compareTo(h2.element) > 0) return merge1(h1, h2); else return merge1(h2, h1); } /** * Internal method to merge two roots. * Assumes trees are not empty, and h1's root contains smallest item. */ private LeftistNode<AnyType> merge1(LeftistNode<AnyType> h1, LeftistNode<AnyType> h2) { if (h1.left == null) { // Single node h1.left = h2; // Other fields in h1 already accurate // swapChildren(h1); } else { h1.right = merge(h1.right, h2); // if (h1.left.npl < h1.right.npl) swapChildren(h1); // h1.npl = h1.right.npl + 1; } return h1; } /** * Swaps t's two children. */ private static <AnyType> void swapChildren(LeftistNode<AnyType> t) { LeftistNode<AnyType> tmp = t.left; t.left = t.right; t.right = tmp; } /** * Insert into the priority queue, maintaining heap order. * * @param x the item to insert. */ public void insert(AnyType x) { this.size++; root = merge(new LeftistNode<>(x), root); } /** * Find the smallest item in the priority queue. * * @return the smallest item, or throw UnderflowException if empty. */ public AnyType findMin() { if (isEmpty()) throw new BufferUnderflowException(); return root.element; } /** * Remove the smallest item from the priority queue. * * @return the smallest item, or throw UnderflowException if empty. */ public AnyType deleteMax() { if (isEmpty()) throw new BufferUnderflowException(); size--; AnyType minItem = root.element; root = merge(root.left, root.right); return minItem; } /** * Test if the priority queue is logically empty. * * @return true if empty, false otherwise. */ public boolean isEmpty() { return root == null; } /** * Make the priority queue logically empty. */ public void makeEmpty() { root = null; } /** * @param node * @param toReturn * @param recLevel * @param parentElement * @return Tree as formatted string. */ private String toString(LeftistNode node, String toReturn, String recLevel, String parentElement) { recLevel = recLevel + "-- "; if (parentElement == "") { parentElement = "no parent"; } if (node.right != null) { toReturn = toString(node.right, toReturn, recLevel, node.element.toString()); } // System.out.println(node.element); toReturn = toReturn + recLevel + node.element.toString() + "[" + parentElement + "]" + recLevel + "\n"; if (node.left != null) { // toStrong(node.left); toReturn = toString(node.left, toReturn, recLevel, node.element.toString()); } return toReturn; } public String toString(){ return toString(this.root, "" , "", ""); } private static class LeftistNode<AnyType> { // Constructors LeftistNode(AnyType theElement) { this(theElement, null, null); } LeftistNode(AnyType theElement, LeftistNode<AnyType> lt, LeftistNode<AnyType> rt) { element = theElement; left = lt; right = rt; npl = 0; } AnyType element; // The data in the node LeftistNode<AnyType> left; // Left child LeftistNode<AnyType> right; // Right child int npl; // null path length } private LeftistNode<AnyType> root; // root public static void main(String[] args) { String accou = "accou"; String account = "account"; System.out.println(); // int numItems = 100; // LeftistHeap<Integer> h = new LeftistHeap<>(); // LeftistHeap<Integer> h1 = new LeftistHeap<>(); // int i = 37; // for (i = 37; i != 0; i = (i + 37) % numItems) // if (i % 2 == 0) // h1.insert(i); // else // h.insert(i); // h.merge(h1); // System.out.println(h.toString(h.root, "", "", "")); // int deleted = 0; // for (i = 1; i < numItems; i++) // deleted = h.deleteMin(); // if (h.deleteMin() != i) // System.out.println("Oops! " + i); // else { // System.out.println(i);} // System.out.println(h.deleteMin()); } }
[ "jaxon.willard@aggiemail.usu.edu" ]
jaxon.willard@aggiemail.usu.edu
434aaeda1e80edf3ae5b346e71ab72d82ff7dc05
c329326b13fe47a919c9ef6f596413e39e24ef05
/yntd-web/src/main/java/cn/hxz/webapp/syscore/controller/CacheRestController.java
f5b551cb2009752093aa03b24108d5b6372fadcc
[]
no_license
nemoisfash/yntd_web
62447c645936e299fe81a1a5818ac66357122a2c
94e8d5f51e4a4dff95fdb44a87fd1926539fb568
refs/heads/master
2022-12-23T10:14:37.766156
2020-05-06T01:29:59
2020-05-06T01:29:59
200,809,274
0
0
null
2022-12-16T08:06:34
2019-08-06T08:27:26
JavaScript
UTF-8
Java
false
false
1,080
java
package cn.hxz.webapp.syscore.controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RestController; import cn.hxz.webapp.util.CacheUtils; import net.chenke.playweb.JsonResult; /** * * @author chenke * */ @RestController @RequestMapping("${adminPath}/cache") public class CacheRestController { @RequestMapping(value = "/clear", method = RequestMethod.POST) public Object clearCache(String name) { boolean success = false; String message = "未找到对应缓存"; if ("sys".equalsIgnoreCase(name)){ CacheUtils.clear(CacheUtils.CACHE_SYS); success = true; message = "系统缓存已清理"; } if ("cms".equalsIgnoreCase(name)){ CacheUtils.clear(CacheUtils.CACHE_CMS); success = true; message = "内容缓存已清理"; } if ("app".equalsIgnoreCase(name)){ CacheUtils.clear(CacheUtils.CACHE_EXT); success = true; message = "应用缓存已清理"; } return new JsonResult(success, message); } }
[ "Administrator@WIN-KS80K6FVBS5" ]
Administrator@WIN-KS80K6FVBS5
bf7b9f82e9d6b0ad7b1e33a6aa4bfe0b565c5e38
b8e76bfc981176fd83ef415963a714c298537ed4
/CBP/plugin/contract/fermat-cbp-plugin-contract-customer-broker-crypto-money-sale-bitdubai/src/main/java/com/bitdubai/fermat_cbp_plugin/layer/contract/customer_broker_crypto_money_sale/developer/bitdubai/version_1/exceptions/CantInitializeCustomerBrokerCryptoMoneySaleContractDatabaseException.java
47f8f4d6af9f7f7d8c47f2b1fb19a8c4697366e2
[ "MIT" ]
permissive
jadzalla/fermat-unused
827b9c8ccb805be934acb14479b28fbddf56306c
d5e9633109caac3e88e9e3109862ae40d962cd96
refs/heads/master
2020-03-17T00:49:29.989918
2015-10-06T04:51:46
2015-10-06T04:51:46
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,498
java
package com.bitdubai.fermat_cbp_plugin.layer.contract.customer_broker_crypto_money_sale.developer.bitdubai.version_1.exceptions; import com.bitdubai.fermat_api.FermatException; /** * The Class <code>package com.bitdubai.fermat_cbp_plugin.layer.contract.customer_broker_crypto_money_sale.developer.bitdubai.version_1.exceptions.CantInitializeCustomerBrokerCryptoMoneySaleContractDatabaseException</code> * is thrown when an error occurs initializing database * <p/> * * Created by Angel Veloz - (vlzangel91@gmail.com) on 28/09/15. * * @version 1.0 * @since Java JDK 1.7 */ public class CantInitializeCustomerBrokerCryptoMoneySaleContractDatabaseException extends FermatException { public static final String DEFAULT_MESSAGE = "CAN'T INTIALIZE CUSTOMER BROKER CRYPTO MONEY SALE CONTRACT DATABASE EXCEPTION"; public CantInitializeCustomerBrokerCryptoMoneySaleContractDatabaseException(final String message, final Exception cause, final String context, final String possibleReason) { super(message, cause, context, possibleReason); } public CantInitializeCustomerBrokerCryptoMoneySaleContractDatabaseException(final String message, final Exception cause) { this(message, cause, "", ""); } public CantInitializeCustomerBrokerCryptoMoneySaleContractDatabaseException(final String message) { this(message, null); } public CantInitializeCustomerBrokerCryptoMoneySaleContractDatabaseException() { this(DEFAULT_MESSAGE); } }
[ "vlzangel@gmail.com" ]
vlzangel@gmail.com
789913000bb6c613b010f8103d509f36d4a30ec9
f2e744082c66f270d606bfc19d25ecb2510e337c
/sources/androidx/core/app/ActivityCompat.java
44fc1c7e227d915020da58bac76c88beef9e3e5e
[]
no_license
AshutoshSundresh/OnePlusSettings-Java
365c49e178612048451d78ec11474065d44280fa
8015f4badc24494c3931ea99fb834bc2b264919f
refs/heads/master
2023-01-22T12:57:16.272894
2020-11-21T16:30:18
2020-11-21T16:30:18
314,854,903
4
2
null
null
null
null
UTF-8
Java
false
false
3,896
java
package androidx.core.app; import android.app.Activity; import android.content.Intent; import android.content.IntentSender; import android.content.pm.PackageManager; import android.os.Build; import android.os.Bundle; import android.os.Handler; import android.os.Looper; import android.text.TextUtils; import androidx.core.content.ContextCompat; import java.util.Arrays; public class ActivityCompat extends ContextCompat { private static PermissionCompatDelegate sDelegate; public interface OnRequestPermissionsResultCallback { void onRequestPermissionsResult(int i, String[] strArr, int[] iArr); } public interface PermissionCompatDelegate { boolean requestPermissions(Activity activity, String[] strArr, int i); } public interface RequestPermissionsRequestCodeValidator { void validateRequestPermissionsRequestCode(int i); } public static void startActivityForResult(Activity activity, Intent intent, int i, Bundle bundle) { if (Build.VERSION.SDK_INT >= 16) { activity.startActivityForResult(intent, i, bundle); } else { activity.startActivityForResult(intent, i); } } public static void startIntentSenderForResult(Activity activity, IntentSender intentSender, int i, Intent intent, int i2, int i3, int i4, Bundle bundle) throws IntentSender.SendIntentException { if (Build.VERSION.SDK_INT >= 16) { activity.startIntentSenderForResult(intentSender, i, intent, i2, i3, i4, bundle); } else { activity.startIntentSenderForResult(intentSender, i, intent, i2, i3, i4); } } public static void finishAffinity(Activity activity) { if (Build.VERSION.SDK_INT >= 16) { activity.finishAffinity(); } else { activity.finish(); } } public static void requestPermissions(final Activity activity, final String[] strArr, final int i) { PermissionCompatDelegate permissionCompatDelegate = sDelegate; if (permissionCompatDelegate == null || !permissionCompatDelegate.requestPermissions(activity, strArr, i)) { for (String str : strArr) { if (TextUtils.isEmpty(str)) { throw new IllegalArgumentException("Permission request for permissions " + Arrays.toString(strArr) + " must not contain null or empty values"); } } if (Build.VERSION.SDK_INT >= 23) { if (activity instanceof RequestPermissionsRequestCodeValidator) { ((RequestPermissionsRequestCodeValidator) activity).validateRequestPermissionsRequestCode(i); } activity.requestPermissions(strArr, i); } else if (activity instanceof OnRequestPermissionsResultCallback) { new Handler(Looper.getMainLooper()).post(new Runnable() { /* class androidx.core.app.ActivityCompat.AnonymousClass1 */ public void run() { int[] iArr = new int[strArr.length]; PackageManager packageManager = activity.getPackageManager(); String packageName = activity.getPackageName(); int length = strArr.length; for (int i = 0; i < length; i++) { iArr[i] = packageManager.checkPermission(strArr[i], packageName); } ((OnRequestPermissionsResultCallback) activity).onRequestPermissionsResult(i, strArr, iArr); } }); } } } public static void recreate(Activity activity) { if (Build.VERSION.SDK_INT >= 28) { activity.recreate(); } else if (!ActivityRecreator.recreate(activity)) { activity.recreate(); } } }
[ "ashutoshsundresh@gmail.com" ]
ashutoshsundresh@gmail.com
49b03c906647ffc6ae5e726beab80a6d07d5147d
df66e853559a888f16ce09c8f4fd0b13469a339d
/app/src/main/java/com/straw/lession/physical/vo/db/Course.java
2047c2260970838526dfee9c451690e733d52859
[]
no_license
jyozq/physical
cfaeb3d43ec118cb2e8d99014c042bd281c68303
d45e67ef927584035c66551dd47efeb33ae4271f
refs/heads/master
2021-01-20T20:41:39.687560
2016-08-09T09:07:42
2016-08-09T09:07:42
62,551,803
0
0
null
null
null
null
UTF-8
Java
false
false
6,471
java
package com.straw.lession.physical.vo.db; import org.greenrobot.greendao.annotation.*; import com.straw.lession.physical.db.DaoSession; import org.greenrobot.greendao.DaoException; import com.straw.lession.physical.db.CourseDao; import com.straw.lession.physical.db.CourseDefineDao; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. Enable "keep" sections if you want to edit. /** * Entity mapped to table "COURSE". */ @Entity(active = true) public class Course { @Id private Long id; private java.util.Date date; private Integer useOnce; private Integer weekday; private Integer status; private Long instituteIdR; private Long teacherIdR; private java.util.Date startTime; private java.util.Date endTime; private java.util.Date courseIdR; private String syncMsg; private Boolean isUploaded; private Long courseDefineIdR; /** Used to resolve relations */ @Generated private transient DaoSession daoSession; /** Used for active entity operations. */ @Generated private transient CourseDao myDao; @ToOne(joinProperty = "courseDefineIdR") private CourseDefine courseDefine; @Generated private transient Long courseDefine__resolvedKey; @Generated public Course() { } public Course(Long id) { this.id = id; } @Generated public Course(Long id, java.util.Date date, Integer useOnce, Integer weekday, Integer status, Long instituteIdR, Long teacherIdR, java.util.Date startTime, java.util.Date endTime, java.util.Date courseIdR, String syncMsg, Boolean isUploaded, Long courseDefineIdR) { this.id = id; this.date = date; this.useOnce = useOnce; this.weekday = weekday; this.status = status; this.instituteIdR = instituteIdR; this.teacherIdR = teacherIdR; this.startTime = startTime; this.endTime = endTime; this.courseIdR = courseIdR; this.syncMsg = syncMsg; this.isUploaded = isUploaded; this.courseDefineIdR = courseDefineIdR; } /** called by internal mechanisms, do not call yourself. */ @Generated public void __setDaoSession(DaoSession daoSession) { this.daoSession = daoSession; myDao = daoSession != null ? daoSession.getCourseDao() : null; } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public java.util.Date getDate() { return date; } public void setDate(java.util.Date date) { this.date = date; } public Integer getUseOnce() { return useOnce; } public void setUseOnce(Integer useOnce) { this.useOnce = useOnce; } public Integer getWeekday() { return weekday; } public void setWeekday(Integer weekday) { this.weekday = weekday; } public Integer getStatus() { return status; } public void setStatus(Integer status) { this.status = status; } public Long getInstituteIdR() { return instituteIdR; } public void setInstituteIdR(Long instituteIdR) { this.instituteIdR = instituteIdR; } public Long getTeacherIdR() { return teacherIdR; } public void setTeacherIdR(Long teacherIdR) { this.teacherIdR = teacherIdR; } public java.util.Date getStartTime() { return startTime; } public void setStartTime(java.util.Date startTime) { this.startTime = startTime; } public java.util.Date getEndTime() { return endTime; } public void setEndTime(java.util.Date endTime) { this.endTime = endTime; } public java.util.Date getCourseIdR() { return courseIdR; } public void setCourseIdR(java.util.Date courseIdR) { this.courseIdR = courseIdR; } public String getSyncMsg() { return syncMsg; } public void setSyncMsg(String syncMsg) { this.syncMsg = syncMsg; } public Boolean getIsUploaded() { return isUploaded; } public void setIsUploaded(Boolean isUploaded) { this.isUploaded = isUploaded; } public Long getCourseDefineIdR() { return courseDefineIdR; } public void setCourseDefineIdR(Long courseDefineIdR) { this.courseDefineIdR = courseDefineIdR; } /** To-one relationship, resolved on first access. */ @Generated public CourseDefine getCourseDefine() { Long __key = this.courseDefineIdR; if (courseDefine__resolvedKey == null || !courseDefine__resolvedKey.equals(__key)) { if (daoSession == null) { throw new DaoException("Entity is detached from DAO context"); } CourseDefineDao targetDao = daoSession.getCourseDefineDao(); CourseDefine courseDefineNew = targetDao.load(__key); synchronized (this) { courseDefine = courseDefineNew; courseDefine__resolvedKey = __key; } } return courseDefine; } @Generated public void setCourseDefine(CourseDefine courseDefine) { synchronized (this) { this.courseDefine = courseDefine; courseDefineIdR = courseDefine == null ? null : courseDefine.getCourseDefineIdR(); courseDefine__resolvedKey = courseDefineIdR; } } /** * Convenient call for {@link org.greenrobot.greendao.AbstractDao#delete(Object)}. * Entity must attached to an entity context. */ @Generated public void delete() { if (myDao == null) { throw new DaoException("Entity is detached from DAO context"); } myDao.delete(this); } /** * Convenient call for {@link org.greenrobot.greendao.AbstractDao#update(Object)}. * Entity must attached to an entity context. */ @Generated public void update() { if (myDao == null) { throw new DaoException("Entity is detached from DAO context"); } myDao.update(this); } /** * Convenient call for {@link org.greenrobot.greendao.AbstractDao#refresh(Object)}. * Entity must attached to an entity context. */ @Generated public void refresh() { if (myDao == null) { throw new DaoException("Entity is detached from DAO context"); } myDao.refresh(this); } }
[ "maiposuto@126.com" ]
maiposuto@126.com
c7fd37112e690e10f951ba8431911d26f3f42190
bc3274c2360e92c439aef3538660d1526e8ba5fa
/radius-invoicing/src/java/com/radius/invoicing/ibatis/model/SalesInquiryGrd.java
b08a00487fad770503f8320a4fb3f1ae9d974bfb
[]
no_license
logochao/imsr
8cbc15495cc295835f5747c8e671a05caa0d7108
b991fbafc623069b956815088fac4d94a9631128
refs/heads/master
2016-09-07T03:33:57.548159
2014-05-30T02:50:36
2014-05-30T02:50:36
38,575,754
1
1
null
null
null
null
UTF-8
Java
false
false
2,168
java
package com.radius.invoicing.ibatis.model; /** * @author <a href="mailto:goodluck.sunlight@gmail.com">陈波宁</a> * @version 创建时间:2013-12-8 下午12:53:04<br/> * Copyright (c) 2013 by 陈波宁.<br/> * 类说明 销售询价列表 */ public class SalesInquiryGrd extends ExtInfo { private String salesInquiryId="";//销售询价单编号 private String goodsId="";//商品编号 private String goodsName="";//商品名称 private Integer specId;//规格编码 private Integer unit;//单位(规格) private Integer quantityUnit;//数量 private Integer quantityEuPerUnit;//包装单位折合数量 private String status;//状态 private String memo="";//备注 public SalesInquiryGrd() { } public SalesInquiryGrd(String salesInquiryId, String goodsId) { super(); this.salesInquiryId = salesInquiryId; this.goodsId = goodsId; } public String getGoodsId() { return goodsId; } public void setGoodsId(String goodsId) { this.goodsId = goodsId; } public String getGoodsName() { return goodsName; } public void setGoodsName(String goodsName) { this.goodsName = goodsName; } public String getMemo() { return memo; } public void setMemo(String memo) { this.memo = memo; } public Integer getQuantityEuPerUnit() { return quantityEuPerUnit; } public void setQuantityEuPerUnit(Integer quantityEuPerUnit) { this.quantityEuPerUnit = quantityEuPerUnit; } public Integer getQuantityUnit() { return quantityUnit; } public void setQuantityUnit(Integer quantityUnit) { this.quantityUnit = quantityUnit; } public String getSalesInquiryId() { return salesInquiryId; } public void setSalesInquiryId(String salesInquiryId) { this.salesInquiryId = salesInquiryId; } public Integer getSpecId() { return specId; } public void setSpecId(Integer specId) { this.specId = specId; } public String getStatus() { return status; } public void setStatus(String status) { this.status = status; } public Integer getUnit() { return unit; } public void setUnit(Integer unit) { this.unit = unit; } }
[ "goodluck.sunlight@gmail.com" ]
goodluck.sunlight@gmail.com
9a2389ec328a7dcb082c22043d41661c471db1d3
49ef7f84154f305aed2e50390e31e334cdf2e2cc
/ble_test/src/main/java/reeiss/bonree/ble_test/smarthardware/MainActivity3.java
549c7a74d2d63369cb8d05cd9ac890b83a9566ce
[]
no_license
GodManRui/Crawler
4ea894c3941566f0c33a79e947cfad14e392f5c6
63adb001a96c3427288453051bef0b31d6b6605b
refs/heads/master
2020-03-15T02:48:26.675976
2019-01-06T09:03:15
2019-01-06T09:03:15
131,926,624
0
1
null
null
null
null
UTF-8
Java
false
false
2,004
java
package reeiss.bonree.ble_test.smarthardware; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import java.util.ArrayList; import java.util.List; import reeiss.bonree.ble_test.R; public class MainActivity3 extends AppCompatActivity { private RecyclerView Rv; private DoorAdapter myAdapter; private List<DataBean> listItem; @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.recy);// 初始化显示的数据 initData(); initView(); } // 初始化显示的数据 public void initData() { listItem = new ArrayList<>();/*在数组中存放数据*/ for (int i = 0; i < 100; i++) { DataBean dataBean = new DataBean(); if (i % 2 == 0) { dataBean.setStatus("门窗打开"); dataBean.setAlert(true); dataBean.setOpen(1); dataBean.setTime("十点半"); } else { dataBean.setStatus("门窗关闭"); dataBean.setAlert(false); dataBean.setOpen(0); dataBean.setTime("十一点半"); } listItem.add(dataBean); } } // 绑定数据到RecyclerView public void initView() { Rv = (RecyclerView) findViewById(R.id.my_recycler_view); //使用线性布局 LinearLayoutManager layoutManager = new LinearLayoutManager(this); Rv.setLayoutManager(layoutManager); Rv.setHasFixedSize(true); // //用自定义分割线类设置分割线 // Rv.addItemDecoration(new DividerItemDecoration(this)); //为ListView绑定适配器 myAdapter = new DoorAdapter(this, listItem); Rv.setAdapter(myAdapter); } }
[ "854463112@qq.com" ]
854463112@qq.com
d8c41eeca3193fb69321aa65c879590cc9335c64
88c841a7e3433b0afbefa4d95f8d06f38484fbbf
/lecshop_base_modules/lecshop_system/src/main/java/com/lecshop/storemenu/service/StoreMenuService.java
c3347b1148d775cd1b4efb74b5e8c23f15e74f39
[]
no_license
chocoai/Shop_V2
751ebe841b979260d5f2a4718d06be86f04543bd
c2d8b2fb17727539e4bcaf5d1dfce15716197ba5
refs/heads/master
2020-04-14T19:29:51.673436
2017-11-01T04:25:10
2017-11-01T04:38:14
null
0
0
null
null
null
null
UTF-8
Java
false
false
858
java
package com.lecshop.storemenu.service; import com.lecshop.storemenu.bean.StoreMenu; import java.util.List; /** * @author sunluyang on 2017/6/7. */ public interface StoreMenuService { /** * 根据管理员id查询菜单 * * @param customerId 会员id * @return 管理员菜单实体类 */ List<StoreMenu> queryStoreMenu(Long customerId); /** * 根据管理员id所有菜单 * * @param customerId 会员id * @return 管理员菜单实体类 */ List<StoreMenu> queryAllStoreMenu(Long customerId); /** * 根据管理员id查询菜单-公共方法 * * @param customerId 会员id * @param isMenu 是否是用于后台菜单 * @return 管理员菜单实体类 递归返回一级 */ List<StoreMenu> storeMenuCommon(Long customerId, boolean isMenu); }
[ "Sun_Masily@163.com" ]
Sun_Masily@163.com
20df90938c73f8481d3ccf2d0b8dd6b9be1238ee
51d75a77296544b2279c9f0766536bc9cc5f1f52
/mrobotics/assignment1/src/behaviors/Stop.java
5f2ddec6409f11d025189d2362d1a6e5c3771669
[ "MIT" ]
permissive
alepmaros/dit
3c205c8f0522553bb9a0548f1b7b94479790fb34
9135f09ef6449b48fc204f9540e8a2261ff16af4
refs/heads/master
2021-06-07T14:46:04.592042
2016-09-12T14:09:08
2016-09-12T14:09:08
null
0
0
null
null
null
null
UTF-8
Java
false
false
920
java
/* * Mobile Robotics - Assignment 1 * * Dublin Institute of Technology * Students: * - Alexandre Maros - D14128553 * - Fábio Dayrell Rosa - D14128448 * */ package assignment1; import lejos.nxt.*; import lejos.robotics.navigation.DifferentialPilot; import lejos.robotics.subsumption.Behavior; import assignment1.Robot; public class Stop implements Behavior { private boolean suppressed; private static Robot robot; public Stop(Robot r) { suppressed = false; robot = r; } public boolean takeControl() { return robot.bump.isPressed(); } public void suppress() { suppressed = true; } public void action() { LCD.clear(); LCD.drawString("STOP!", 0, 0); while( !suppressed && !Button.ESCAPE.isDown() ) { // Wait } // Exit the program LCD.clear(); System.exit(0); } }
[ "alehstk@gmail.com" ]
alehstk@gmail.com
67a3ff2d8ec8eac61d90d9b3a912cdd6dbe752d2
e8afec2d7f3433862eba4de9085082bf803d754a
/app/src/main/java/cn/xuexuan/newui/ui/AboutFragment.java
51899c24d3e845051650129694023213ab8e8fae
[ "Apache-2.0" ]
permissive
JantHsueh/Arsenal
d99c36484b27af701cccc99961c05e5249c25eaa
d3b05e440c7963740d9b66a03921ab3ad68df7ee
refs/heads/master
2021-01-23T05:34:55.730077
2017-11-14T09:53:12
2017-11-14T09:53:12
86,317,440
8
0
null
null
null
null
UTF-8
Java
false
false
852
java
package cn.xuexuan.newui.ui; import butterknife.OnClick; import cn.xuexuan.newui.R; import cn.xuexuan.newui.app.Constants; import cn.xuexuan.newui.base.SimpleFragment; import cn.xuexuan.newui.util.AlipayUtil; import cn.xuexuan.newui.util.SnackbarUtil; /** * Created by Jant on 2017/5/3. */ public class AboutFragment extends SimpleFragment { @Override public int getLayout() { return R.layout.fragment_about; } @Override public void initEventAndData() { } @OnClick(R.id.card_award) public void onAward() { if (AlipayUtil.hasInstalledAlipayClient(mContext)) { AlipayUtil.startAlipayClient(getActivity(), Constants.KEY_ALIPAY); } else { SnackbarUtil.showShort(getActivity().getWindow().getDecorView(), "木有检测到支付宝客户端 T T"); } } }
[ "384324069@qq.com" ]
384324069@qq.com
fc0ea32fdabe016cb7e7563007bbcf7296d8ad22
c9f86fc93ec8b16b058c2d6258685b7bc885f438
/UrbanSpoon/src/com/talentsprint/us/model/Branch.java
907153fc731c43e76c03a4f2e73bd0c2d0ab132b
[]
no_license
Nagasreeteja/UrbanSpoon
4000d01c97debc3e787634fc1da1ff19c83a2cb8
48636f26119e0774e92fa40fad4649905228f719
refs/heads/master
2021-06-17T16:36:07.382652
2017-05-17T12:13:14
2017-05-17T12:13:14
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,507
java
package com.talentsprint.us.model; public class Branch { private int branchId; private String location; private String city; private String state; private String imagePath; private String postalCode; private int restaurntId; private long phoneNumber; private String emailId; private String country; public int getBranchId() { return branchId; } public void setBranchId(int branchId) { this.branchId = branchId; } public String getLocation() { return location; } public void setLocation(String location) { this.location = location; } public String getCity() { return city; } public void setCity(String city) { this.city = city; } public String getState() { return state; } public void setState(String state) { this.state = state; } public String getImagePath() { return imagePath; } public void setImagePath(String imagePath) { this.imagePath = imagePath; } public String getPostalCode() { return postalCode; } public void setPostalCode(String postalCode) { this.postalCode = postalCode; } public int getRestaurntId() { return restaurntId; } public void setRestaurntId(int restaurntId) { this.restaurntId = restaurntId; } public long getPhoneNumber() { return phoneNumber; } public void setPhoneNumber(long phoneNumber) { this.phoneNumber = phoneNumber; } public String getEmailId() { return emailId; } public void setEmailId(String emailId) { this.emailId = emailId; } public String getCountry() { return country; } public void setCountry(String country) { this.country = country; } }
[ "chpriyanka1729@gmail.com" ]
chpriyanka1729@gmail.com
d8363611864c6b96587a024d1e30d8ba10f1b5bd
86b55c5bfd3cbce99db30907ecc63c0038b0f1e2
/chrome/browser/download/android/java/src/org/chromium/chrome/browser/download/dialogs/DownloadLaterDialogHelper.java
c03e85b59c59bf2683eccba67bc83225cb6e14c8
[ "BSD-3-Clause" ]
permissive
Claw-Lang/chromium
3ed8160ea3f2b5d51fdc2a7d764aadd5b443eb3f
651cebac57fcd0ce2c7c974494602cc098fe7348
refs/heads/master
2022-11-19T07:46:03.573023
2020-07-28T06:45:27
2020-07-28T06:45:27
283,134,740
1
0
BSD-3-Clause
2020-07-28T07:26:49
2020-07-28T07:26:48
null
UTF-8
Java
false
false
6,318
java
// Copyright 2020 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. package org.chromium.chrome.browser.download.dialogs; import android.content.Context; import androidx.annotation.IntDef; import androidx.annotation.Nullable; import org.chromium.base.Callback; import org.chromium.chrome.browser.download.DownloadLaterMetrics; import org.chromium.chrome.browser.download.DownloadLaterMetrics.DownloadLaterUiEvent; import org.chromium.components.offline_items_collection.OfflineItemSchedule; import org.chromium.components.prefs.PrefService; import org.chromium.ui.modaldialog.ModalDialogManager; import org.chromium.ui.modelutil.PropertyModel; /** * A wrapper of {@link DownloadLaterDialogCoordinator}, always use the same Android {@link Context} * and relevant dependencies, and supports to show dialog based on a {@link * org.chromium.components.offline_items_collection.OfflineItem}. */ public class DownloadLaterDialogHelper implements DownloadLaterDialogController { /** * Defines the caller of {@link DownloadLaterDialogHelper}. Used in metrics recording. */ @IntDef({Source.DOWNLOAD_HOME, Source.DOWNLOAD_INFOBAR}) public @interface Source { int DOWNLOAD_HOME = 0; int DOWNLOAD_INFOBAR = 1; } private final Context mContext; private final ModalDialogManager mModalDialogManager; private final PrefService mPrefService; private final DownloadLaterDialogCoordinator mDownloadLaterDialog; private Callback<OfflineItemSchedule> mCallback; private @Source int mSource; /** * Creates the download later dialog helper. * @param context The {@link Context} associated with the dialog. * @param manager The {@link ModalDialogManager} to show the modal dialog. * @param prefService Used to update user preferences. * @return The download later dialog helper. */ public static DownloadLaterDialogHelper create( Context context, ModalDialogManager manager, PrefService prefService) { DownloadDateTimePickerDialog dateTimePicker = new DownloadDateTimePickerDialogImpl(); DownloadLaterDialogCoordinator dialog = new DownloadLaterDialogCoordinator(dateTimePicker); dateTimePicker.initialize(dialog); return new DownloadLaterDialogHelper(context, manager, prefService, dialog); } DownloadLaterDialogHelper(Context context, ModalDialogManager manager, PrefService prefService, DownloadLaterDialogCoordinator downloadLaterDialog) { mContext = context; mModalDialogManager = manager; mPrefService = prefService; mDownloadLaterDialog = downloadLaterDialog; mDownloadLaterDialog.initialize(this); } /** * Shows a download later dialog when the user wants to change the {@link OfflineItemSchedule}. * @param currentSchedule The current {@link OfflineItemSchedule}. * @param source The caller of this function, used to collect metrics. * @param callback The callback to reply the new schedule selected by the user. May reply null * if the user cancels the dialog. */ public void showChangeScheduleDialog(@Nullable final OfflineItemSchedule currentSchedule, @Source int source, Callback<OfflineItemSchedule> callback) { @DownloadLaterDialogChoice int initialChoice = DownloadLaterDialogChoice.DOWNLOAD_NOW; if (currentSchedule != null) { initialChoice = currentSchedule.onlyOnWifi ? DownloadLaterDialogChoice.ON_WIFI : DownloadLaterDialogChoice.DOWNLOAD_LATER; } mCallback = callback; mSource = source; PropertyModel model = new PropertyModel.Builder(DownloadLaterDialogProperties.ALL_KEYS) .with(DownloadLaterDialogProperties.CONTROLLER, mDownloadLaterDialog) .with(DownloadLaterDialogProperties.DOWNLOAD_TIME_INITIAL_SELECTION, initialChoice) .build(); mDownloadLaterDialog.showDialog(mContext, mModalDialogManager, mPrefService, model); } /** * Destroys the download later dialog. */ public void destroy() { mDownloadLaterDialog.destroy(); } // DownloadLaterDialogController implementation. @Override public void onDownloadLaterDialogComplete(int choice, long startTime) { if (mCallback == null) return; recordDialogMetrics(true /*complete*/, choice); OfflineItemSchedule schedule = new OfflineItemSchedule(choice == DownloadLaterDialogChoice.ON_WIFI, startTime); mCallback.onResult(schedule); mCallback = null; } @Override public void onDownloadLaterDialogCanceled() { if (mCallback == null) return; recordDialogMetrics(false /*complete*/, -1); mCallback.onResult(null); mCallback = null; } @Override public void onEditLocationClicked() { // Do nothing, no edit location text for the change schedule dialog. } // Collect complete or cancel metrics based on the source of the dialog. private void recordDialogMetrics(boolean complete, @DownloadLaterDialogChoice int choice) { switch (mSource) { case Source.DOWNLOAD_HOME: if (complete) { DownloadLaterMetrics.recordDownloadHomeChangeScheduleChoice(choice); } else { DownloadLaterMetrics.recordDownloadLaterUiEvent( DownloadLaterUiEvent.DOWNLOAD_HOME_CHANGE_SCHEDULE_CANCEL); } break; case Source.DOWNLOAD_INFOBAR: if (complete) { DownloadLaterMetrics.recordInfobarChangeScheduleChoice(choice); } else { DownloadLaterMetrics.recordDownloadLaterUiEvent( DownloadLaterUiEvent.DOWNLOAD_INFOBAR_CHANGE_SCHEDULE_CANCEL); } break; default: assert false : "Unknown source, can't collect metrics."; return; } } }
[ "commit-bot@chromium.org" ]
commit-bot@chromium.org
ed257711f36b21c9efebc738103602c2ea684ffd
157a52623024602395e1eb7d1933f98f8ff4fade
/ws-handlers/src/main/java/example/ws/handler/SigningHandler.java
025997c6f8dcdca9477abdfa0ce645c7f5ba7469
[]
no_license
tiagocsantos/Upa-Transportes
f1c3b1f2bb7bd2a96c50351c8c97f2e4e091e061
43fcb41bf2bcf4d4237f3bf9ce02db83e933d49a
refs/heads/master
2021-01-17T17:37:07.132870
2016-06-17T21:53:28
2016-06-17T21:53:28
61,404,148
0
0
null
null
null
null
UTF-8
Java
false
false
10,751
java
package example.ws.handler; import java.io.BufferedInputStream; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.StringWriter; import java.security.InvalidKeyException; import java.security.KeyStore; import java.security.NoSuchAlgorithmException; import java.security.NoSuchProviderException; import java.security.PrivateKey; import java.security.PublicKey; import java.security.Signature; import java.security.SignatureException; import java.security.cert.Certificate; import java.security.cert.CertificateException; import java.security.cert.CertificateFactory; import java.util.Iterator; import java.util.Set; import javax.xml.bind.DatatypeConverter; import javax.xml.namespace.QName; import javax.xml.soap.Name; import javax.xml.soap.SOAPBody; import javax.xml.soap.SOAPElement; import javax.xml.soap.SOAPEnvelope; import javax.xml.soap.SOAPHeader; import javax.xml.soap.SOAPHeaderElement; import javax.xml.soap.SOAPMessage; import javax.xml.soap.SOAPPart; import javax.xml.transform.TransformerFactory; import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stream.StreamResult; import javax.xml.ws.handler.MessageContext; import javax.xml.ws.handler.soap.SOAPHandler; import javax.xml.ws.handler.soap.SOAPMessageContext; import ca.ws.cli.CAClient; public class SigningHandler implements SOAPHandler<SOAPMessageContext> { public static final String NS = "urn:example"; @Override public boolean handleMessage(SOAPMessageContext smc) { String senderName = getName(smc, "Sender"); Boolean outboundElement = (Boolean) smc.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY); if (outboundElement.booleanValue()) { //outbund try { byte[] messageBytes = getMessageBytes(smc); //gerar e assinar resumo byte[] signedDigest = signDigest(messageBytes, senderName); //poe resumo na mensagem SOAPMessage msg = smc.getMessage(); SOAPPart sp = msg.getSOAPPart(); SOAPEnvelope se = sp.getEnvelope(); SOAPHeader sh = se.getHeader(); if (sh == null) sh = se.addHeader(); Name name = se.createName("Digest", "Security", "urn:example"); SOAPHeaderElement element = sh.addHeaderElement(name); String newValue = DatatypeConverter.printBase64Binary(signedDigest); element.addTextNode(newValue); msg.saveChanges(); } catch (Exception e){ System.out.println(e.getMessage()); } } else { //inbound try { //tirar digest da mensagem SOAPMessage msg = smc.getMessage(); SOAPPart sp = msg.getSOAPPart(); SOAPEnvelope se = sp.getEnvelope(); SOAPHeader sh = se.getHeader(); Name name = se.createName("Digest", "Security", "urn:example"); Iterator it = sh.getChildElements(name); // check header element if (!it.hasNext()) { System.out.println("Security Header not Found"); return false; } SOAPElement element = (SOAPElement) it.next(); String digestString = element.getValue(); byte[] messageSignature = DatatypeConverter.parseBase64Binary(digestString); element.detachNode(); msg.saveChanges(); byte[] messageBytes = getMessageBytes(smc); String CERTIFICATE_FILE = senderName+".cer"; Certificate certificate = readCertificateFile(CERTIFICATE_FILE); PublicKey publicKey = certificate.getPublicKey(); boolean isValid = verifyDigitalSignature(messageSignature, messageBytes, publicKey); if (isValid) { System.out.println("The digital signature is valid"); } else { System.out.println("The digital signature is NOT valid"); return false; } } catch (Exception e){ System.out.println(e.getMessage()); } } return true; } private byte[] getMessageBytes(SOAPMessageContext smc) { SOAPMessage msg = smc.getMessage(); try{ SOAPBody element = msg.getSOAPBody(); DOMSource source = new DOMSource(element); StringWriter stringResult = new StringWriter(); TransformerFactory.newInstance().newTransformer().transform(source, new StreamResult(stringResult)); String message = stringResult.toString(); return message.getBytes(); } catch (Exception e){ System.out.println(e.getMessage()); } return null; } private byte[] signDigest(byte[] plainBytes, String senderName) { String KEYSTORE_FILE = senderName+".jks"; String KEYSTORE_PASSWORD = "ins3cur3"; String KEY_ALIAS = senderName; String KEY_PASSWORD = "1nsecure"; byte[] digitalSignature = null; try { digitalSignature = makeDigitalSignature(plainBytes, getPrivateKeyFromKeystore(KEYSTORE_FILE, KEYSTORE_PASSWORD.toCharArray(), KEY_ALIAS, KEY_PASSWORD.toCharArray())); } catch (Exception e) { System.out.println(e.getMessage());; } return digitalSignature; } public String getName(SOAPMessageContext smc, String className){ //para ir buscar o nome escrito pelo naminghandler try { SOAPMessage msg = smc.getMessage(); SOAPPart sp = msg.getSOAPPart(); SOAPEnvelope se = sp.getEnvelope(); SOAPHeader sh = se.getHeader(); Name name = se.createName(className, "e",NS); Iterator it = sh.getChildElements(name); // check header element if (!it.hasNext()) { System.out.printf("Header element not found"); return null; } SOAPElement element = (SOAPElement) it.next(); String headerValue = element.getValue(); // System.out.println("***\n"+className+" "+headerValue); return headerValue; } catch (Exception e){ System.out.println(e.getMessage()); } return null; } @Override public void close(MessageContext arg0) { // TODO Auto-generated method stub } @Override public boolean handleFault(SOAPMessageContext arg0) { // TODO Auto-generated method stub return false; } @Override public Set<QName> getHeaders() { // TODO Auto-generated method stub return null; } /** * Reads a PrivateKey from a key-store * * @return The PrivateKey * @throws Exception */ public static PrivateKey getPrivateKeyFromKeystore(String keyStoreFilePath, char[] keyStorePassword, String keyAlias, char[] keyPassword) throws Exception { KeyStore keystore = readKeystoreFile(keyStoreFilePath, keyStorePassword); PrivateKey key = (PrivateKey) keystore.getKey(keyAlias, keyPassword); return key; } /** * Reads a KeyStore from a file * * @return The read KeyStore * @throws Exception */ public static KeyStore readKeystoreFile(String keyStoreFilePath, char[] keyStorePassword) throws Exception { FileInputStream fis; try { fis = new FileInputStream(keyStoreFilePath); } catch (FileNotFoundException e) { System.err.println("Keystore file <" + keyStoreFilePath + "> not fount."); return null; } KeyStore keystore = KeyStore.getInstance(KeyStore.getDefaultType()); keystore.load(fis, keyStorePassword); return keystore; } /** auxiliary method to calculate digest from text and cipher it */ public static byte[] makeDigitalSignature(byte[] bytes, PrivateKey privateKey) throws Exception { // get a signature object using the SHA-1 and RSA combo // and sign the plain-text with the private key Signature sig = Signature.getInstance("SHA1WithRSA"); sig.initSign(privateKey); sig.update(bytes); byte[] signature = sig.sign(); return signature; } /** * Reads a certificate from a file * * @return * @throws Exception */ public static Certificate readCertificateFile(String certificateFilePath) throws Exception { FileInputStream fis = null; try { fis = new FileInputStream(certificateFilePath); System.out.println("Certifcate Found"); } catch (FileNotFoundException e) { System.err.println("Certificate file <" + certificateFilePath + "> not found."); System.out.println("Asking for Certificate to CA"); CAClient ca = new CAClient(); boolean ok = ca.getCertificate(certificateFilePath); if(!ok) return null; else { System.out.println("Got Certificate"); verifyCertificate(certificateFilePath); fis = new FileInputStream(certificateFilePath); } } BufferedInputStream bis = new BufferedInputStream(fis); CertificateFactory cf = CertificateFactory.getInstance("X.509"); if (bis.available() > 0) { Certificate cert = cf.generateCertificate(bis); return cert; // It is possible to print the content of the certificate file: // System.out.println(cert.toString()); } bis.close(); fis.close(); return null; } private static void verifyCertificate(String certificateFilePath) { String CA_CERTIFICATE_FILE = "ca-certificate.pem.txt"; String CERTIFICATE_FILE = certificateFilePath; Certificate certificate = null; Certificate caCertificate; PublicKey caPublicKey = null; try { certificate = readCertificateFile(CERTIFICATE_FILE); caCertificate = readCertificateFile(CA_CERTIFICATE_FILE); caPublicKey = caCertificate.getPublicKey(); } catch (Exception e){ System.out.println(e.getMessage()); } if (verifySignedCertificate(certificate, caPublicKey)) { System.out.println("The signed certificate is valid"); } else { System.err.println("The signed certificate is not valid"); } } /** * auxiliary method to calculate new digest from text and compare it to the * to deciphered digest */ public static boolean verifyDigitalSignature(byte[] cipherDigest, byte[] bytes, PublicKey publicKey) throws Exception { // verify the signature with the public key Signature sig = Signature.getInstance("SHA1WithRSA"); sig.initVerify(publicKey); sig.update(bytes); try { return sig.verify(cipherDigest); } catch (SignatureException se) { System.err.println("Caught exception while verifying signature " + se); return false; } } /** * Verifica se um certificado foi devidamente assinado pela CA * * @param certificate * certificado a ser verificado * @param caPublicKey * certificado da CA * @return true se foi devidamente assinado */ public static boolean verifySignedCertificate(Certificate certificate, PublicKey caPublicKey) { try { certificate.verify(caPublicKey); } catch (InvalidKeyException | CertificateException | NoSuchAlgorithmException | NoSuchProviderException | SignatureException e) { // O método Certifecate.verify() não retorna qualquer valor (void). // Quando um certificado é inválido, isto é, não foi devidamente // assinado pela CA // é lançada uma excepção: java.security.SignatureException: // Signature does not match. // também são lançadas excepções caso o certificado esteja num // formato incorrecto ou tenha uma // chave inválida. return false; } return true; } }
[ "tiagoc_santos@hotmail.com" ]
tiagoc_santos@hotmail.com
cdffbbf21a2b9ad619a19ccf1c3db70146d3c1dd
758df7ecfcae2a2aaa4f2b0b360268a82aff71cb
/WebProj/src/com/internousdev/webproj/action/TestAction.java
2578e69ba5a4d4d56d209bbc0fa19f2709a46b28
[]
no_license
krkr58/test
2dbe67aee2cc05b4c188e568fd2f377b14b9f98a
3a3ae34bf9adcdd918f008fda54820bac8274c50
refs/heads/master
2022-07-27T13:01:42.147239
2019-06-13T01:01:49
2019-06-13T01:01:49
186,359,704
0
0
null
2022-07-08T18:58:03
2019-05-13T06:35:58
HTML
UTF-8
Java
false
false
489
java
package com.internousdev.webproj.action; import com.opensymphony.xwork2.ActionSupport; public class TestAction extends ActionSupport{ private String username; private String password; public String execute(){ return SUCCESS; } public String getUsername(){ return username; } public void setUsername(String username){ this.username=username; } public String getPassword(){ return password; } public void setPassword(String password){ this.password=password; } }
[ "k-kazu08@rakuten.jp" ]
k-kazu08@rakuten.jp
87c603188471def5abfa3d241cbf06a8449c72e8
9c4f641b25195adb3f6be6c26ea38cdbd68a543f
/HoloSysinfoWidget/src/main/java/com/yslibrary/android/holosysinfowidget/receiver/BootReceiver.java
0e7672a9c5bb3df7ef72afb09afffd2b1328876c
[]
no_license
yshrsmz/HoloSysinfoWidgetProject
8c70792e1ca8773e297cabb3ed1a6d6ebb07651f
4440241c3c9c2cd17d8e69d507ec32e1705f5daa
refs/heads/master
2020-12-11T01:51:39.154187
2014-08-01T13:00:23
2014-08-01T13:00:23
14,227,140
0
0
null
null
null
null
UTF-8
Java
false
false
1,292
java
package com.yslibrary.android.holosysinfowidget.receiver; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.preference.PreferenceManager; import android.util.Log; import com.yslibrary.android.holosysinfowidget.R; import com.yslibrary.android.holosysinfowidget.service.BatteryNotificationService; /** * Created by A12897 on 13/11/18. */ public class BootReceiver extends BroadcastReceiver { private final static String TAG = BootReceiver.class.getSimpleName(); @Override public void onReceive(Context context, Intent intent) { Log.d(TAG, "#onReceive"); SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(context); boolean shouldServiceActivate = pref.getBoolean(context.getResources().getString(R.string.pref_key_activate_notification), true); boolean shouldServiceActivateOnBoot = pref.getBoolean(context.getResources().getString(R.string.pref_key_show_notification_on_boot), true); if (shouldServiceActivate && shouldServiceActivateOnBoot) { // start battery notification service context.startService(new Intent(context, BatteryNotificationService.class)); } } }
[ "the.phantom.bane@gmail.com" ]
the.phantom.bane@gmail.com
831b0e8da38c851d5dfbaee92824f006272c6f38
a08de6f46107354dce6dc89f9a90b853c906f4a8
/src/main/java/com/franlops/market/persistence/mapper/PurchaseMapper.java
9fd2208e5e059b0ef20292a42f5fe3fadba6e88a
[]
no_license
franlop24/franlops-market
130d2cada0f63263a0f5c2e789808990fdd3fe30
52e0ca357fb8ee8103e56e5d336863c5a425b789
refs/heads/master
2023-04-08T06:15:29.870005
2021-04-14T03:58:26
2021-04-14T03:58:26
342,745,583
0
0
null
null
null
null
UTF-8
Java
false
false
1,101
java
package com.franlops.market.persistence.mapper; import com.franlops.market.domain.Purchase; import com.franlops.market.persistence.entity.Compra; import org.mapstruct.InheritInverseConfiguration; import org.mapstruct.Mapper; import org.mapstruct.Mapping; import org.mapstruct.Mappings; import java.util.List; @Mapper(componentModel = "spring", uses = {PurshaseItemMapper.class}) public interface PurchaseMapper { @Mappings({ @Mapping(source = "idCompra", target = "purchaseId"), @Mapping(source = "idCliente", target = "clientId"), @Mapping(source = "fecha", target = "date"), @Mapping(source = "medioPago", target = "paymentMethod"), @Mapping(source = "comentario", target = "comment"), @Mapping(source = "estado", target = "state"), @Mapping(source = "productos", target = "items") }) Purchase toPurchase(Compra compra); List<Purchase> toPurchases(List<Compra> compras); @InheritInverseConfiguration @Mapping(target = "cliente", ignore = true) Compra toCompra(Purchase purchase); }
[ "franlopbri@gmail.com" ]
franlopbri@gmail.com
169160ff8555f054cdc7fc80ec013f6e7c9100e5
b9900daa4009629f00d983d4e511244c6b200404
/example/MyList/app/src/main/java/com/example/jupiter/mylist/SingeritemView.java
662addf48d2e9aae12ea184b4f499c6302b99676
[]
no_license
dbtwelve/android-study
da7a202d6263e75c00bcf9322d659edb90451132
684d3769dfe37468cfaa2aebfb3cdb7fe82ebe73
refs/heads/master
2020-03-19T07:49:33.307655
2018-07-16T15:19:58
2018-07-16T15:19:58
136,151,862
0
0
null
null
null
null
UTF-8
Java
false
false
1,300
java
package com.example.jupiter.mylist; import android.content.Context; import android.support.annotation.Nullable; import android.util.AttributeSet; import android.view.LayoutInflater; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.TextView; public class SingeritemView extends LinearLayout { TextView textView; TextView textView2; ImageView imageView; public SingeritemView(Context context) { super(context); init(context); } public SingeritemView(Context context, @Nullable AttributeSet attrs) { super(context, attrs); init(context); } private void init(Context context) { LayoutInflater inflater = (LayoutInflater) context.getSystemService(context.LAYOUT_INFLATER_SERVICE); inflater.inflate(R.layout.singer_item, this, true); textView = (TextView) findViewById(R.id.textView); textView2 = (TextView) findViewById(R.id.textView2); imageView = (ImageView) findViewById(R.id.imageView); } public void setName(String name) { textView.setText(name); } public void setMobile(String mobile) { textView2.setText(mobile); } public void setImage(int resId) { imageView.setImageResource(resId); } }
[ "" ]
b334fab7e3107056472511926dea4e14f52eac3c
bed6543b5c0fa57c5d51bef09199774da7bff840
/src/com/MianShiQuestions/OJ_03.java
539220c6fe9f32789da09443e7813679dd40dd1c
[]
no_license
Fri3ndizefia/leetcode
60bc12638e50b6fd6ea39cab4cbeb40de4d547d6
815a116c4481c687da23e823bbb40ac1de5701c1
refs/heads/main
2023-03-27T13:26:28.828727
2021-04-01T14:01:43
2021-04-01T14:01:43
345,142,778
0
0
null
null
null
null
UTF-8
Java
false
false
504
java
package com.MianShiQuestions; import java.io.BufferedReader; import java.io.InputStreamReader; public class OJ_03 { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String str; while ((str = br.readLine()) != null && !str.equals("0 0")) { String[] input = str.split(" "); System.out.println(Integer.parseInt(input[0]) + Integer.parseInt(input[1])); } } }
[ "" ]
332239a419c0954b40ac8a900b394805446547f5
36838dfcd53c4d2c73b9a6b0b7a8a28e4a331517
/cn/com/smartdevices/bracelet/weight/family/UserInfoActivity.java
a2bcd3f4291eebda1552c640271ba9b376f57390
[]
no_license
ShahmanTeh/MiFit-Java
fbb2fd578727131b9ac7150b86c4045791368fe8
93bdf88d39423893b294dec2f5bf54708617b5d0
refs/heads/master
2021-01-20T13:05:10.408158
2016-02-03T21:02:55
2016-02-03T21:02:55
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,480
java
package cn.com.smartdevices.bracelet.weight.family; import android.app.FragmentTransaction; import android.content.Intent; import android.os.Bundle; import cn.com.smartdevices.bracelet.C0596r; import cn.com.smartdevices.bracelet.ui.SystemBarTintActivity; import cn.com.smartdevices.bracelet.weight.J; public class UserInfoActivity extends SystemBarTintActivity { private static final String a = UserInfoActivity.class.getSimpleName(); private int b = -1; private h c; protected void onActivityResult(int i, int i2, Intent intent) { super.onActivityResult(i, i2, intent); h hVar = (h) getFragmentManager().findFragmentByTag(h.class.getName()); if (hVar != null) { hVar.onActivityResult(i, i2, intent); } } protected void onCreate(Bundle bundle) { super.onCreate(bundle); if (getIntent() != null) { this.b = getIntent().getIntExtra(MemberInfoBaseActivity.b, -1); C0596r.e(a, "UserInfoActivity receive the infomation uid " + this.b); C0596r.e(a, "userinfo " + J.a().a(this.b).toString()); } this.c = (h) h.a(this.b); FragmentTransaction beginTransaction = getFragmentManager().beginTransaction(); beginTransaction.add(16908290, this.c, h.class.getName()); beginTransaction.commit(); } protected void onPause() { super.onPause(); } protected void onResume() { super.onResume(); } }
[ "kasha_malaga@hotmail.com" ]
kasha_malaga@hotmail.com
c60909f5b9c1c89fcb1fa00755e384c2527226d3
6045518db77c6104b4f081381f61c26e0d19d5db
/datasets/file_version_per_commit_backup/apache-jmeter/0431342fc6b55cae74fc4b3121cae06650f31658.java
73ff7e9f6ff53a781d8d47450437de8b7a134921
[]
no_license
edisutoyo/msr16_td_removal
6e039da7fed166b81ede9b33dcc26ca49ba9259c
41b07293c134496ba1072837e1411e05ed43eb75
refs/heads/master
2023-03-22T21:40:42.993910
2017-09-22T09:19:51
2017-09-22T09:19:51
null
0
0
null
null
null
null
UTF-8
Java
false
false
19,830
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.jmeter.protocol.http.proxy; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.UnsupportedEncodingException; import java.net.MalformedURLException; import java.net.ProtocolException; import java.net.URL; import java.util.HashMap; import java.util.Iterator; import java.util.Map; import java.util.StringTokenizer; import org.apache.commons.lang.CharUtils; import org.apache.jmeter.protocol.http.config.MultipartUrlConfig; import org.apache.jmeter.protocol.http.control.Header; import org.apache.jmeter.protocol.http.control.HeaderManager; import org.apache.jmeter.protocol.http.control.gui.HttpTestSampleGui; import org.apache.jmeter.protocol.http.control.gui.HttpTestSampleGui2; import org.apache.jmeter.protocol.http.gui.HeaderPanel; import org.apache.jmeter.protocol.http.sampler.HTTPSampler2; import org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase; import org.apache.jmeter.protocol.http.sampler.HTTPSamplerFactory; import org.apache.jmeter.protocol.http.util.ConversionUtils; import org.apache.jmeter.protocol.http.util.HTTPConstants; import org.apache.jmeter.testelement.TestElement; import org.apache.jmeter.util.JMeterUtils; import org.apache.jorphan.logging.LoggingManager; import org.apache.log.Logger; //For unit tests, @see TestHttpRequestHdr /** * The headers of the client HTTP request. * */ public class HttpRequestHdr { private static final Logger log = LoggingManager.getLoggerForClass(); private static final String HTTP = "http"; // $NON-NLS-1$ private static final String HTTPS = "https"; // $NON-NLS-1$ private static final String PROXY_CONNECTION = "proxy-connection"; // $NON-NLS-1$ private static final String CONTENT_TYPE = "content-type"; // $NON-NLS-1$ private static final String CONTENT_LENGTH = "content-length"; // $NON-NLS-1$ /** * Http Request method. Such as get or post. */ private String method = ""; // $NON-NLS-1$ /** * The requested url. The universal resource locator that hopefully uniquely * describes the object or service the client is requesting. */ private String url = ""; // $NON-NLS-1$ /** * Version of http being used. Such as HTTP/1.0. */ private String version = ""; // NOTREAD // $NON-NLS-1$ private byte[] rawPostData; private final Map headers = new HashMap(); private final HTTPSamplerBase sampler; private HeaderManager headerManager; /* * Optionally number the requests */ private static final boolean numberRequests = JMeterUtils.getPropDefault("proxy.number.requests", false); // $NON-NLS-1$ private static volatile int requestNumber = 0;// running number public HttpRequestHdr() { this.sampler = HTTPSamplerFactory.newInstance(); } /** * @param sampler the http sampler */ public HttpRequestHdr(HTTPSamplerBase sampler) { this.sampler = sampler; } /** * Parses a http header from a stream. * * @param in * the stream to parse. * @return array of bytes from client. */ public byte[] parse(InputStream in) throws IOException { boolean inHeaders = true; int readLength = 0; int dataLength = 0; boolean firstLine = true; ByteArrayOutputStream clientRequest = new ByteArrayOutputStream(); ByteArrayOutputStream line = new ByteArrayOutputStream(); int x; while ((inHeaders || readLength < dataLength) && ((x = in.read()) != -1)) { line.write(x); clientRequest.write(x); if (firstLine && !CharUtils.isAscii((char) x)){// includes \n throw new IllegalArgumentException("Only ASCII supported in headers (perhaps SSL was used?)"); } if (inHeaders && (byte) x == (byte) '\n') { // $NON-NLS-1$ if (line.size() < 3) { inHeaders = false; firstLine = false; // cannot be first line either } if (firstLine) { parseFirstLine(line.toString()); firstLine = false; } else { // parse other header lines, looking for Content-Length final int contentLen = parseLine(line.toString()); if (contentLen > 0) { dataLength = contentLen; // Save the last valid content length one } } if (log.isDebugEnabled()){ log.debug("Client Request Line: " + line.toString()); } line.reset(); } else if (!inHeaders) { readLength++; } } // Keep the raw post data rawPostData = line.toByteArray(); if (log.isDebugEnabled()){ log.debug("rawPostData in default JRE encoding: " + new String(rawPostData)); log.debug("Request: " + clientRequest.toString()); } return clientRequest.toByteArray(); } private void parseFirstLine(String firstLine) { if (log.isDebugEnabled()) { log.debug("browser request: " + firstLine); } if (!CharUtils.isAsciiAlphanumeric(firstLine.charAt(0))) { throw new IllegalArgumentException("Unrecognised header line (probably used HTTPS)"); } StringTokenizer tz = new StringTokenizer(firstLine); method = getToken(tz).toUpperCase(java.util.Locale.ENGLISH); url = getToken(tz); if (url.toLowerCase(java.util.Locale.ENGLISH).startsWith(HTTPConstants.PROTOCOL_HTTPS)) { throw new IllegalArgumentException("Cannot handle https URLS: " + url); } version = getToken(tz); if (log.isDebugEnabled()) { log.debug("parser input: " + firstLine); log.debug("parsed method: " + method); log.debug("parsed url: " + url); log.debug("parsed version:" + version); } if ("CONNECT".equalsIgnoreCase(method)){ throw new IllegalArgumentException("Cannot handle CONNECT - probably used HTTPS"); } } /* * Split line into name/value pairs and store in headers if relevant * If name = "content-length", then return value as int, else return 0 */ private int parseLine(String nextLine) { StringTokenizer tz; tz = new StringTokenizer(nextLine); String token = getToken(tz); // look for termination of HTTP command if (0 == token.length()) { return 0; } String trimmed = token.trim(); String name = trimmed.substring(0, trimmed.length() - 1);// drop ':' String value = getRemainder(tz); headers.put(name.toLowerCase(java.util.Locale.ENGLISH), new Header(name, value)); if (name.equalsIgnoreCase(CONTENT_LENGTH)) { return Integer.parseInt(value); } return 0; } private HeaderManager createHeaderManager() { HeaderManager manager = new HeaderManager(); Iterator keys = headers.keySet().iterator(); while (keys.hasNext()) { String key = (String) keys.next(); if (!key.equals(PROXY_CONNECTION) && !key.equals(CONTENT_LENGTH)) { manager.add((Header) headers.get(key)); } } manager.setName("Browser-derived headers"); manager.setProperty(TestElement.TEST_CLASS, HeaderManager.class.getName()); manager.setProperty(TestElement.GUI_CLASS, HeaderPanel.class.getName()); return manager; } public HeaderManager getHeaderManager() { if(headerManager == null) { headerManager = createHeaderManager(); } return headerManager; } public HTTPSamplerBase getSampler(Map pageEncodings, Map formEncodings) throws MalformedURLException, IOException { // Damn! A whole new GUI just to instantiate a test element? // Isn't there a beter way? HttpTestSampleGui tempGui = null; // Create the corresponding gui for the sampler class if(sampler instanceof HTTPSampler2) { tempGui = new HttpTestSampleGui2(); } else { tempGui = new HttpTestSampleGui(); } sampler.setProperty(TestElement.GUI_CLASS, tempGui.getClass().getName()); // Populate the sampler populateSampler(pageEncodings, formEncodings); tempGui.configure(sampler); tempGui.modifyTestElement(sampler); // Defaults sampler.setFollowRedirects(false); sampler.setUseKeepAlive(true); if (log.isDebugEnabled()) { log.debug("getSampler: sampler path = " + sampler.getPath()); } return sampler; } /** * * @return the sampler * @throws MalformedURLException * @throws IOException * @throws ProtocolException * @deprecated use the getSampler(HashMap pageEncodings, HashMap formEncodings) instead, since * that properly handles the encodings of the page */ public HTTPSamplerBase getSampler() throws MalformedURLException, IOException, ProtocolException { return getSampler(null, null); } private String getContentType() { Header contentTypeHeader = (Header) headers.get(CONTENT_TYPE); if (contentTypeHeader != null) { return contentTypeHeader.getValue(); } return null; } private boolean isMultipart(String contentType) { if (contentType != null && contentType.startsWith(HTTPConstants.MULTIPART_FORM_DATA)) { return true; } return false; } private MultipartUrlConfig getMultipartConfig(String contentType) { if(isMultipart(contentType)) { // Get the boundary string for the multiparts from the content type String boundaryString = contentType.substring(contentType.toLowerCase(java.util.Locale.ENGLISH).indexOf("boundary=") + "boundary=".length()); return new MultipartUrlConfig(boundaryString); } return null; } private void populateSampler(Map pageEncodings, Map formEncodings) throws MalformedURLException, UnsupportedEncodingException { sampler.setDomain(serverName()); if (log.isDebugEnabled()) { log.debug("Proxy: setting server: " + sampler.getDomain()); } sampler.setMethod(method); log.debug("Proxy: setting method: " + sampler.getMethod()); sampler.setPort(serverPort()); if (log.isDebugEnabled()) { log.debug("Proxy: setting port: " + sampler.getPort()); } if (url.indexOf("//") > -1) { String protocol = url.substring(0, url.indexOf(":")); if (log.isDebugEnabled()) { log.debug("Proxy: setting protocol to : " + protocol); } sampler.setProtocol(protocol); } else if (sampler.getPort() == HTTPConstants.DEFAULT_HTTPS_PORT) { sampler.setProtocol(HTTPS); if (log.isDebugEnabled()) { log.debug("Proxy: setting protocol to https"); } } else { if (log.isDebugEnabled()) { log.debug("Proxy setting default protocol to: http"); } sampler.setProtocol(HTTP); } URL pageUrl = null; if(sampler.isProtocolDefaultPort()) { pageUrl = new URL(sampler.getProtocol(), sampler.getDomain(), getPath()); } else { pageUrl = new URL(sampler.getProtocol(), sampler.getDomain(), sampler.getPort(), getPath()); } String urlWithoutQuery = getUrlWithoutQuery(pageUrl); // Check if the request itself tells us what the encoding is String contentEncoding = null; String requestContentEncoding = ConversionUtils.getEncodingFromContentType(getContentType()); if(requestContentEncoding != null) { contentEncoding = requestContentEncoding; } else { // Check if we know the encoding of the page if (pageEncodings != null) { synchronized (pageEncodings) { contentEncoding = (String) pageEncodings.get(urlWithoutQuery); } } // Check if we know the encoding of the form if (formEncodings != null) { synchronized (formEncodings) { String formEncoding = (String) formEncodings.get(urlWithoutQuery); // Form encoding has priority over page encoding if (formEncoding != null) { contentEncoding = formEncoding; } } } } // Get the post data using the content encoding of the request String postData = null; if (log.isDebugEnabled()) { if(contentEncoding != null) { log.debug("Using encoding " + contentEncoding + " for request body"); } else { log.debug("No encoding found, using JRE default encoding for request body"); } } if (contentEncoding != null) { postData = new String(rawPostData, contentEncoding); } else { // Use default encoding postData = new String(rawPostData); } if(contentEncoding != null) { sampler.setPath(getPath(), contentEncoding); } else { // Although the spec says UTF-8 should be used for encoding URL parameters, // most browser use ISO-8859-1 for default if encoding is not known. // We use null for contentEncoding, then the url parameters will be added // with the value in the URL, and the "encode?" flag set to false sampler.setPath(getPath(), null); } if (log.isDebugEnabled()) { log.debug("Proxy: setting path: " + sampler.getPath()); } if (numberRequests) { requestNumber++; sampler.setName(requestNumber + " " + sampler.getPath()); } else { sampler.setName(sampler.getPath()); } // Set the content encoding if(contentEncoding != null) { sampler.setContentEncoding(contentEncoding); } // If it was a HTTP GET request, then all parameters in the URL // has been handled by the sampler.setPath above, so we just need // to do parse the rest of the request if it is not a GET request if(!HTTPConstants.GET.equals(method)) { // Check if it was a multipart http post request final String contentType = getContentType(); MultipartUrlConfig urlConfig = getMultipartConfig(contentType); if (urlConfig != null) { urlConfig.parseArguments(postData); // Tell the sampler to do a multipart post sampler.setDoMultipartPost(true); // Remove the header for content-type and content-length, since // those values will most likely be incorrect when the sampler // performs the multipart request, because the boundary string // will change getHeaderManager().removeHeaderNamed(CONTENT_TYPE); getHeaderManager().removeHeaderNamed(CONTENT_LENGTH); // Set the form data sampler.setArguments(urlConfig.getArguments()); // Set the file uploads sampler.setHTTPFiles(urlConfig.getHTTPFileArgs().asArray()); } else if (postData.trim().startsWith("<?")) { // Not sure if this is needed anymore. I assume these requests // do not have HTTPConstants.APPLICATION_X_WWW_FORM_URLENCODED as content type, // and they would therefore be catched by the last else if of these if else if tests sampler.addNonEncodedArgument("", postData, ""); //used when postData is pure xml (ex. an xml-rpc call) } else if (contentType == null || contentType.startsWith(HTTPConstants.APPLICATION_X_WWW_FORM_URLENCODED) ){ // It is the most common post request, with parameter name and values // We also assume this if no content type is present, to be most backwards compatible, // but maybe we should only parse arguments if the content type is as expected sampler.parseArguments(postData.trim(), contentEncoding); //standard name=value postData } else if (postData.length() > 0) { // Just put the whole postbody as the value of a parameter sampler.addNonEncodedArgument("", postData, ""); //used when postData is pure xml (ex. an xml-rpc call) } } if (log.isDebugEnabled()) { log.debug("sampler path = " + sampler.getPath()); } } // // Parsing Methods // /** * Find the //server.name from an url. * * @return server's internet name */ private String serverName() { // chop to "server.name:x/thing" String str = url; int i = str.indexOf("//"); // $NON-NLS-1$ if (i > 0) { str = str.substring(i + 2); } // chop to server.name:xx i = str.indexOf("/"); // $NON-NLS-1$ if (0 < i) { str = str.substring(0, i); } // chop to server.name i = str.indexOf(":"); // $NON-NLS-1$ if (0 < i) { str = str.substring(0, i); } return str; } // TODO replace repeated substr() above and below with more efficient method. /** * Find the :PORT from http://server.ect:PORT/some/file.xxx * * @return server's port (or UNSPECIFIED if not found) */ private int serverPort() { String str = url; // chop to "server.name:x/thing" int i = str.indexOf("//"); if (i > 0) { str = str.substring(i + 2); } // chop to server.name:xx i = str.indexOf("/"); if (0 < i) { str = str.substring(0, i); } // chop XX i = str.indexOf(":"); if (0 < i) { return Integer.parseInt(str.substring(i + 1).trim()); } return HTTPSamplerBase.UNSPECIFIED_PORT; } /** * Find the /some/file.xxxx from http://server.ect:PORT/some/file.xxx * * @return the path */ private String getPath() { String str = url; int i = str.indexOf("//"); if (i > 0) { str = str.substring(i + 2); } i = str.indexOf("/"); if (i < 0) { return ""; } return str.substring(i); } /** * Returns the url string extracted from the first line of the client request. * * @return the url */ public String getUrl(){ return url; } /** * Returns the next token in a string. * * @param tk * String that is partially tokenized. * @return The remainder */ private String getToken(StringTokenizer tk) { if (tk.hasMoreTokens()) { return tk.nextToken(); } return "";// $NON-NLS-1$ } /** * Returns the remainder of a tokenized string. * * @param tk * String that is partially tokenized. * @return The remainder */ private String getRemainder(StringTokenizer tk) { StringBuffer strBuff = new StringBuffer(); if (tk.hasMoreTokens()) { strBuff.append(tk.nextToken()); } while (tk.hasMoreTokens()) { strBuff.append(" "); // $NON-NLS-1$ strBuff.append(tk.nextToken()); } return strBuff.toString(); } private String getUrlWithoutQuery(URL _url) { String fullUrl = _url.toString(); String urlWithoutQuery = fullUrl; String query = _url.getQuery(); if(query != null) { // Get rid of the query and the ? urlWithoutQuery = urlWithoutQuery.substring(0, urlWithoutQuery.length() - query.length() - 1); } return urlWithoutQuery; } }
[ "everton.maldonado@gmail.com" ]
everton.maldonado@gmail.com
07100b241dd0112099cd15a1899dcb94cd1b98e8
534409d21c3bb5e80983b4836fb8e2fcf931bd26
/app/src/main/java/com/nilhcem/droidconit/ui/schedule/pager/SchedulePagerPresenter.java
7c275a522c17925d6b513be7debf1e99e9c6c5d4
[ "Apache-2.0" ]
permissive
Nilhcem/droidconit-2016
76701403d56849069003f9e5af53050f82a39ba6
b5feb0807f500cccf1168e50d5aa01af17496995
refs/heads/master
2016-08-12T15:59:11.490731
2016-04-07T19:34:25
2016-04-07T19:34:25
53,884,862
0
1
null
null
null
null
UTF-8
Java
false
false
1,924
java
package com.nilhcem.droidconit.ui.schedule.pager; import android.os.Bundle; import android.support.annotation.Nullable; import android.view.View; import com.nilhcem.droidconit.data.app.DataProvider; import com.nilhcem.droidconit.data.app.model.Schedule; import com.nilhcem.droidconit.ui.BaseFragmentPresenter; import icepick.State; import rx.Subscription; import rx.android.schedulers.AndroidSchedulers; import rx.schedulers.Schedulers; import timber.log.Timber; public class SchedulePagerPresenter extends BaseFragmentPresenter<SchedulePagerView> { @State Schedule schedule; private final DataProvider dataProvider; private Subscription scheduleSubscription; public SchedulePagerPresenter(SchedulePagerView view, DataProvider dataProvider) { super(view); this.dataProvider = dataProvider; } @Override public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); if (schedule == null) { loadData(); } else { this.view.displaySchedule(schedule); } } public void reloadData() { loadData(); } @Override public void onStop() { if (scheduleSubscription != null) { scheduleSubscription.unsubscribe(); } super.onStop(); } private void loadData() { scheduleSubscription = dataProvider.getSchedule() .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(scheduleDays -> { schedule = scheduleDays; view.displaySchedule(schedule); }, throwable -> Timber.e(throwable, "Error getting schedule"), () -> { if (schedule == null) { view.displayLoadingError(); } }); } }
[ "nilhcem@gmail.com" ]
nilhcem@gmail.com
0d578240abfe3e9574f1aa08f942f8d79e5f058e
07fcf86c4790cae251e2da421e6dbe5f1c034dc1
/app/src/main/java/com/albertoserver/fragments_1/Fragments/SlideShowFragment.java
cafadc3d2844a6e2cc7f963cc4feedee424fd555
[]
no_license
albertoserver/NavigationAndFragments
c09bc68d4fda195aeaf212fe2f9b37cfbfb3a797
0ffae94a1c595e2ae5e54fee9252a1feb60aef71
refs/heads/master
2020-04-07T12:32:06.812131
2018-11-20T10:46:57
2018-11-20T10:46:57
158,371,242
0
0
null
null
null
null
UTF-8
Java
false
false
724
java
package com.albertoserver.fragments_1.Fragments; import android.content.Context; import android.net.Uri; import android.os.Bundle; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import com.albertoserver.fragments_1.R; public class SlideShowFragment extends Fragment { public SlideShowFragment() { // Required empty public constructor } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Inflate the layout for this fragment return inflater.inflate(R.layout.fragment_slide_show, container, false); } }
[ "alberto.server.piqueras@cieep.com" ]
alberto.server.piqueras@cieep.com
8cf762a3ab0e18b11d9535ac2d6226de768259c8
cd505d3d2a26878a1bf4b0a0c335d44a93dcf873
/Reliable-Transfer-Protocol-with-UDP/Sender.java
f6dd728d77f8363dfcff1613b475aaf793c5fc35
[]
no_license
denizyuksel/Computer_Networks_Assignments
8c4c79e84e2ab847f7deef08c92ed12ff746e069
b78e6cf0bbaab13329ea8920434edafb52d11c35
refs/heads/master
2023-03-29T18:10:01.280153
2021-04-02T07:19:03
2021-04-02T07:19:03
353,939,153
0
0
null
null
null
null
UTF-8
Java
false
false
6,520
java
import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.net.DatagramPacket; import java.net.DatagramSocket; import java.net.InetAddress; import java.util.*; /* * Sender class for simulating the operation of a Selective Repeat sender * over a lossy network layer and the code for transferring a specified file * as an application-layer program. * Bartu Atabek - 21602229 * Deniz Yüksel - 21600880 */ public class Sender { public static void main(String[] args) throws Exception { if (args.length != 4) { System.out.println("Invalid program arguments."); System.out.println("Arguments should follow the pattern below."); System.out.println("java Sender <file_path> <receiver_port> <window_size_N> <retransmission_timeout>"); return; } // Program arguments String file_path = args[0]; int receiver_port = Integer.parseInt(args[1]); int window_size = Integer.parseInt(args[2]); int retransmission_timeout = Integer.parseInt(args[3]); // Divides the file and constructs chunks with size 1022 Bytes byte[][] segments = constructSegments(readBytesFromFile(file_path), 1022); // Variables Map<Integer, Thread> threadMap = new HashMap<>(); TreeSet<Integer> ACKS = new TreeSet<>(); for (byte[] segment: segments) { int val = ((segment[0] & 0xff) << 8) | (segment[1] & 0xff); ACKS.add(val); } // Create Datagram Socket InetAddress IPAddress = InetAddress.getByName("127.0.0.1"); DatagramSocket socket = new DatagramSocket(); byte[] receiveData = new byte[2]; int send_base = 1; int nextseqnum = 1; boolean transfer = true; // RunnableSegment Inner class for sending segments class RunnableSegment implements Runnable { // DatagramPacket to be sent private DatagramPacket packet; public RunnableSegment(DatagramPacket packet) { this.packet = packet; } @Override public void run() { try { while(true) { // Send packet socket.send(packet); // Wait for main thread notification or timeout Thread.sleep(retransmission_timeout); } } // Stop if main thread interrupts this thread catch (InterruptedException | IOException e) { } } } System.out.println("Starting transmission..."); // Loop until all packets are sent and all ACK are received while (transfer) { for (int segment_no = nextseqnum; segment_no <= send_base + window_size -1 && segment_no <= segments.length; segment_no++) { DatagramPacket sendPacket = new DatagramPacket(segments[segment_no - 1],segments[segment_no-1].length, IPAddress, receiver_port); Thread thread = new Thread(new RunnableSegment(sendPacket)); thread.start(); threadMap.put(segment_no, thread); nextseqnum++; } // Receive ACK DatagramPacket receivePacket = new DatagramPacket(receiveData, receiveData.length); socket.receive(receivePacket); int ACKNo = ((receiveData[0] & 0xff) << 8) | (receiveData[1] & 0xff); if (ACKNo >= send_base && ACKNo <= send_base + window_size -1) { if (threadMap.get(ACKNo) != null) { threadMap.get(ACKNo).interrupt(); threadMap.remove(ACKNo); // Advance send_base ACKS.remove(ACKNo); // Send 2 Bytes of 0's to indicate that the transfer is over if (ACKS.isEmpty()) { byte[] endBytes = new byte[2]; endBytes[0] = (byte) (0 & 0xFF); endBytes[1] = (byte) (0 & 0xFF); DatagramPacket sendPacket = new DatagramPacket(endBytes, endBytes.length, IPAddress, receiver_port); socket.send(sendPacket); transfer = false; } else { send_base = ACKS.first(); } } } } System.out.println("Transmission completed."); } public static byte[] readBytesFromFile(String file_path) { FileInputStream fileInputStream = null; byte[] bytesArray = null; try { File file = new File(file_path); bytesArray = new byte[(int) file.length()]; // read file into bytes[] fileInputStream = new FileInputStream(file); fileInputStream.read(bytesArray); } catch (IOException e) { e.printStackTrace(); } finally { if (fileInputStream != null) { try { fileInputStream.close(); } catch (IOException e) { e.printStackTrace(); } } } return bytesArray; } public static byte[][] constructSegments(byte[] source, int chunkSize) { byte[][] segments = new byte[(int)Math.ceil(source.length / (double) chunkSize)][]; int start = 0; int sequenceNo = 1; for (int i = 0; i < segments.length; i++) { if(start + chunkSize > source.length) { segments[i] = new byte[source.length - start]; System.arraycopy(source, start, segments[i], 0, source.length - start); } else { segments[i] = new byte[chunkSize]; System.arraycopy(source, start, segments[i], 0, chunkSize); } segments[i] = append(segments[i], (byte) (sequenceNo & 0xFF)); segments[i] = append(segments[i], (byte) ((sequenceNo >> 8) & 0xFF)); start += chunkSize ; sequenceNo++; } return segments; } public static byte[] append(byte[] elements, byte element) { byte[] newArray = Arrays.copyOf(elements, elements.length + 1); newArray[0] = element; System.arraycopy(elements, 0, newArray, 1, elements.length); return newArray; } }
[ "yukseldeniz.yb@gmail.com" ]
yukseldeniz.yb@gmail.com
5d0bdf179d046a91554a1014cb9670185f40310f
dc872f15afe26843371d7219b673898387aabc22
/OpenEdXMobile/src/main/java/sa/gov/moe/etraining/whatsnew/WhatsNewFragment.java
7173e62ea2877c22e13c76adc633699dc8e5e9d4
[ "Apache-2.0", "LicenseRef-scancode-warranty-disclaimer", "LicenseRef-scancode-proprietary-license", "LicenseRef-scancode-unknown-license-reference" ]
permissive
ilearninteractive/mob-app-android
ddd4b5e1ebfba23efe594d4d0ccc1d1c6efa6543
d661b8aecb871e21378f317665dfdd97217b633d
refs/heads/master
2020-03-23T22:00:47.534494
2018-08-15T13:04:38
2018-08-15T13:04:38
142,147,439
1
1
Apache-2.0
2018-11-02T17:36:42
2018-07-24T11:13:12
Java
UTF-8
Java
false
false
6,168
java
package sa.gov.moe.etraining.whatsnew; import android.databinding.DataBindingUtil; import android.os.Bundle; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentStatePagerAdapter; import android.support.v4.view.ViewPager; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import com.google.gson.Gson; import com.google.gson.reflect.TypeToken; import com.google.inject.Inject; import sa.gov.moe.etraining.BuildConfig; import sa.gov.moe.etraining.R; import sa.gov.moe.etraining.databinding.FragmentWhatsNewBinding; import java.io.IOException; import java.lang.reflect.Type; import java.util.HashMap; import java.util.List; import java.util.Map; import sa.gov.moe.etraining.base.BaseFragment; import sa.gov.moe.etraining.core.IEdxEnvironment; import sa.gov.moe.etraining.logger.Logger; import sa.gov.moe.etraining.module.analytics.Analytics; import sa.gov.moe.etraining.util.FileUtil; import sa.gov.moe.etraining.util.ResourceUtil; import sa.gov.moe.etraining.util.WhatsNewUtil; import sa.gov.moe.etraining.view.custom.IndicatorController; public class WhatsNewFragment extends BaseFragment { private final Logger logger = new Logger(getClass().getName()); @Inject protected IEdxEnvironment environment; private FragmentWhatsNewBinding binding; private IndicatorController indicatorController; private int noOfPages = 0; private int totalPagesViewed = 1; @Nullable @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { binding = DataBindingUtil.inflate(inflater, R.layout.fragment_whats_new, container, false); return binding.getRoot(); } @Override public void onViewCreated(View view, Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); final CharSequence title = ResourceUtil.getFormattedString(getResources(), R.string.whats_new_title, "version_number", BuildConfig.VERSION_NAME); // Setting activity's title for accessibility getActivity().setTitle(title); binding.screenTitle.setText(title); initViewPager(); initButtons(); initProgressIndicator(); final Map<String, String> map = new HashMap<>(); map.put(Analytics.Keys.APP_VERSION, BuildConfig.VERSION_NAME); environment.getAnalyticsRegistry().trackScreenView(Analytics.Screens.WHATS_NEW, null, null, map); } private void initViewPager() { try { final String whatsNewJson = FileUtil.loadTextFileFromResources(getContext(), R.raw.whats_new); final Type type = new TypeToken<List<WhatsNewModel>>() {}.getType(); final List<WhatsNewModel> whatsNewModels = new Gson().fromJson(whatsNewJson, type); final List<WhatsNewItemModel> items = WhatsNewUtil.getWhatsNewItems(BuildConfig.VERSION_NAME, whatsNewModels); if (items == null) { getActivity().finish(); return; } noOfPages = items.size(); binding.viewPager.setAdapter(new WhatsNewAdapter(getFragmentManager(), items)); binding.viewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() { @Override public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) { } @Override public void onPageSelected(int position) { indicatorController.selectPosition(position); if (position == noOfPages - 1) { binding.doneBtn.setVisibility(View.VISIBLE); } else { binding.doneBtn.setVisibility(View.GONE); } final int pageNumber = position + 1; if (pageNumber >= totalPagesViewed) { totalPagesViewed = pageNumber; } } @Override public void onPageScrollStateChanged(int state) { } }); } catch (IOException e) { // Submit crash report and end the activity logger.error(e, true); getActivity().finish(); } } private void initButtons() { binding.closeBtn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { environment.getAnalyticsRegistry().trackWhatsNewClosed(BuildConfig.VERSION_NAME, totalPagesViewed, binding.viewPager.getCurrentItem() + 1, noOfPages); getActivity().finish(); } }); binding.doneBtn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { environment.getAnalyticsRegistry().trackWhatsNewSeen(BuildConfig.VERSION_NAME, noOfPages); getActivity().finish(); } }); if (noOfPages == 1) { binding.doneBtn.setVisibility(View.VISIBLE); } } private void initProgressIndicator() { indicatorController = new IndicatorController(); binding.indicatorContainer.addView(indicatorController.newInstance(getContext())); indicatorController.initialize(noOfPages); } private class WhatsNewAdapter extends FragmentStatePagerAdapter { @NonNull final List<WhatsNewItemModel> list; public WhatsNewAdapter(@NonNull FragmentManager fm, @NonNull List<WhatsNewItemModel> list) { super(fm); this.list = list; } @Override public Fragment getItem(int position) { return WhatsNewItemFragment.newInstance(list.get(position)); } @Override public int getCount() { return list.size(); } } }
[ "anton.korobko@raccoongang.com" ]
anton.korobko@raccoongang.com
a6c11ac0b97f37cffe286a9ab71a7a0940438bce
1956a31e635bd9791174e582725987e5df218b6e
/ejecutor-regresion/src/main/java/co/edu/uniandes/miso4208/carreport/util/BuscadorArchivos.java
ebd4aafefaf655d8dd2eb5f3529566e141443a59
[]
no_license
jcnino11/carreport
8471090b3dcfca9c7b8e02dfbbec6963dc1b75d7
d904e45c3d67602b3b89928bc6ef9cb61658e758
refs/heads/master
2020-03-17T09:04:46.683767
2018-05-15T04:44:43
2018-05-15T04:44:43
133,460,300
0
0
null
null
null
null
UTF-8
Java
false
false
899
java
package co.edu.uniandes.miso4208.carreport.util; import java.io.File; import java.io.FilenameFilter; import java.util.ArrayList; import java.util.Arrays; import java.util.List; public class BuscadorArchivos { public static List<File> encontrarArchivosSubfolders(File path, String nombre){ List<File> archivosFolder = new ArrayList(); for(File file: path.listFiles()){ if(file.isDirectory()){ archivosFolder.addAll(encontrarArchivosSubfolders(file, nombre)); } } if(path.isDirectory()){ archivosFolder.addAll(Arrays.asList(encontrarArchivosNombre(path, nombre))); } return archivosFolder; } public static File[] encontrarArchivosNombre( final File raiz, final String nombre){ return raiz.listFiles( new FilenameFilter() { public boolean accept (File dir, String name) { return name.equals(nombre); } }); } }
[ "jc.nino11@uniandes.edu.co" ]
jc.nino11@uniandes.edu.co
5966188007d4f0fa169dd0d5fcd5058f17987f1c
5ca37767bfe094cec32098d807873b41ead2054d
/src/Generics/coffee/Americano.java
709e6fd9f47e081dfe7776c751c618b140280b84
[]
no_license
saberlgy1/ThinkingInJava
3562bb3b5134ac720b504037b4c264c02f3c915c
3c7f9bd27dbaea83646794e2481dc1d7509cda80
refs/heads/master
2020-05-07T12:52:56.925980
2020-03-12T10:16:00
2020-03-12T10:16:00
180,524,438
0
0
null
null
null
null
UTF-8
Java
false
false
107
java
//: generics/coffee/Americano.java package Generics.coffee; public class Americano extends Coffee {} ///:~
[ "liuguangyuan@neusoft.com" ]
liuguangyuan@neusoft.com
96c4ff748e043bf9b09ac60214c9ed9ef8a63d62
3fc7c3d4a697c418bad541b2ca0559b9fec03db7
/TestResult/javasource/uk/co/senab/photoview/scrollerproxy/PreGingerScroller.java
014325405a31164799ce4ce3315358e69ad182e1
[]
no_license
songxingzai/APKAnalyserModules
59a6014350341c186b7788366de076b14b8f5a7d
47cf6538bc563e311de3acd3ea0deed8cdede87b
refs/heads/master
2021-12-15T02:43:05.265839
2017-07-19T14:44:59
2017-07-19T14:44:59
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,011
java
package uk.co.senab.photoview.scrollerproxy; import android.content.Context; import android.widget.Scroller; public class PreGingerScroller extends ScrollerProxy { private final Scroller mScroller; public PreGingerScroller(Context paramContext) { mScroller = new Scroller(paramContext); } public boolean computeScrollOffset() { return mScroller.computeScrollOffset(); } public void fling(int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5, int paramInt6, int paramInt7, int paramInt8, int paramInt9, int paramInt10) { mScroller.fling(paramInt1, paramInt2, paramInt3, paramInt4, paramInt5, paramInt6, paramInt7, paramInt8); } public void forceFinished(boolean paramBoolean) { mScroller.forceFinished(paramBoolean); } public int getCurrX() { return mScroller.getCurrX(); } public int getCurrY() { return mScroller.getCurrY(); } public boolean isFinished() { return mScroller.isFinished(); } }
[ "leehdsniper@gmail.com" ]
leehdsniper@gmail.com
698b72c9bcd08060ad1839632218a8345eba13c8
d32d07ee888a44e26250050731c9b44d5089a8da
/4_Java Syntaxes/doWhile.java
25736d5834da6bee9bf68112ea0cda412ba2bae8
[]
no_license
AsithaIndrajith/java-tutorials
1eebec52e2d9a300ae07b2dfb0e04c5062e62a5d
55ea7c603a4cbb372e9488d503d49be76ca7cf01
refs/heads/master
2021-09-21T09:37:43.094481
2018-08-23T16:10:01
2018-08-23T16:10:01
null
0
0
null
null
null
null
UTF-8
Java
false
false
234
java
package javaLearning; public class doWhile { public static void main(String[] args) { int x=1; do { System.out.println(x);//this code execute undoubtly x++; }while(x<=5);//condition is mentioned here inside while } }
[ "asithaindrajithk9@gmail.com" ]
asithaindrajithk9@gmail.com
0e1f3f212634be46e68b30a06d43583a45bc8ad7
c3f316c61b206afd1979a5a7581756c9604f4d1e
/libs/sited/src/main/java/okhttp/RequestBuilder.java
bc725c2293c53027d2b0a5183f258634cddc0c36
[]
no_license
qdsfdhvh/Neiko
c5513a921c005b5e77aff0a0ae3753f412e9c892
9732a783507b54473e8042263eaeb5d959b94a62
refs/heads/master
2021-01-22T10:46:59.282356
2017-04-06T02:24:54
2017-04-06T02:24:54
87,378,194
3
2
null
null
null
null
UTF-8
Java
false
false
1,580
java
package okhttp; import java.io.IOException; import java.util.Map; import okhttp3.Call; import okhttp3.Callback; import okhttp3.FormBody; import okhttp3.Headers; import okhttp3.Request; import okhttp3.Response; /** * Created by Seiko on 2016/12/15. YiKu */ abstract class RequestBuilder<T> { protected String url; Map<String, String> params; Map<String, String> headers; protected Object tag; abstract Call enqueue(Callback callback); abstract Response execute() throws IOException; void appendHeaders(Request.Builder builder, Map<String, String> headers) { Headers.Builder headerBuilder = new Headers.Builder(); if (headers == null || headers.isEmpty()) return; for (String key : headers.keySet()) { headerBuilder.add(key, headers.get(key)); } builder.headers(headerBuilder.build()); } void appendParams(FormBody.Builder builder, Map<String, String> params) { if (params != null && !params.isEmpty()) { for (String key : params.keySet()) { builder.add(key, params.get(key)); } } } String appendParams(String url, Map<String, String> params) { StringBuilder sb = new StringBuilder(); sb.append(url + "?"); if (params != null && !params.isEmpty()) { for (String key : params.keySet()) { sb.append(key).append("=").append(params.get(key)).append("&"); } } sb = sb.deleteCharAt(sb.length() - 1); return sb.toString(); } }
[ "605590140@qq.com" ]
605590140@qq.com
e08314887c0bcc5acbf4de6cefc79b9c038b064e
62c90b50c4595617434904f4457fc01ff1e398e9
/src/main/java/moe/ksmz/rodentraid/Auth/AuthStatus.java
5c8e65a2a3d69fac5776b66c04df7e290b2a8f6a
[ "Unlicense" ]
permissive
Darren-Lim-School-Project/ICT1009
85d65b08680aff35ce7fa986193e110c645bb2b0
a35a2d1342f59e69b523a56c56f4bebd347f6b9e
refs/heads/main
2023-03-24T06:37:27.375169
2021-02-28T12:57:06
2021-02-28T12:57:06
343,819,182
0
0
Unlicense
2021-03-02T15:26:43
2021-03-02T15:23:26
Java
UTF-8
Java
false
false
809
java
package moe.ksmz.rodentraid.Auth; import java.io.Serial; import java.io.Serializable; import moe.ksmz.rodentraid.Models.User; import org.springframework.stereotype.Component; import org.springframework.web.context.annotation.SessionScope; @Component @SessionScope public class AuthStatus implements Serializable { @Serial private static final long serialVersionUID = 42069L; private User currentUser; public void setCurrentUser(User user) { this.currentUser = user; } public User getCurrentUser() { if (currentUser == null) { throw new UnauthorizedException(); } return currentUser; } public Long id() { return getCurrentUser().getId(); } public boolean isLoggedIn() { return currentUser != null; } }
[ "mao@amatsuka.me" ]
mao@amatsuka.me
f6cb5af0fe8f088cb80b18472c2860a6cfcf19ec
852c382f0dcb93f5118a9265e84892fcdf56de73
/prototypes/hibernate-prototype/trunk/dspace-xmlui/dspace-xmlui-api/src/main/java/org/dspace/app/xmlui/aspect/artifactbrowser/CommunityViewer.java
d1a408aaf6d2b054cf850d03d31bf06ab1db71dc
[]
no_license
DSpace-Labs/dspace-sandbox
101a0cf0c371a52fb78bf02d394deae1e8157d25
a17fe69a08fb629f7da574cfc95632dc0e9118a8
refs/heads/master
2020-05-17T21:33:34.009260
2009-04-17T13:43:32
2009-04-17T13:43:32
32,347,896
0
4
null
null
null
null
UTF-8
Java
false
false
15,886
java
/* * CommunityViewer.java * * Version: $Revision: 1.22 $ * * Date: $Date: 2006/08/30 19:16:56 $ * * Copyright (c) 2002, Hewlett-Packard Company and Massachusetts * Institute of Technology. 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 Hewlett-Packard Company nor the name of the * Massachusetts Institute of Technology nor the names of their * 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 * 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. */ package org.dspace.app.xmlui.aspect.artifactbrowser; import org.apache.cocoon.caching.CacheableProcessingComponent; import org.apache.cocoon.util.HashUtil; import org.apache.excalibur.source.SourceValidity; import org.apache.log4j.Logger; import org.dspace.app.xmlui.cocoon.AbstractDSpaceTransformer; import org.dspace.app.xmlui.cocoon.DSpaceFeedGenerator; import org.dspace.app.xmlui.utils.DSpaceValidity; import org.dspace.app.xmlui.utils.HandleUtil; import org.dspace.app.xmlui.utils.UIException; import org.dspace.app.xmlui.utils.URIUtil; import org.dspace.app.xmlui.wing.Message; import org.dspace.app.xmlui.wing.WingException; import org.dspace.app.xmlui.wing.element.Body; import org.dspace.app.xmlui.wing.element.Division; import org.dspace.app.xmlui.wing.element.List; import org.dspace.app.xmlui.wing.element.PageMeta; import org.dspace.app.xmlui.wing.element.Para; import org.dspace.app.xmlui.wing.element.Reference; import org.dspace.app.xmlui.wing.element.ReferenceSet; import org.dspace.authorize.AuthorizeException; import org.dspace.browse.BrowseEngine; import org.dspace.browse.BrowseException; import org.dspace.browse.BrowseIndex; import org.dspace.browse.BrowserScope; import org.dspace.content.Collection; import org.dspace.content.Community; import org.dspace.content.DSpaceObject; import org.dspace.content.Item; import org.dspace.core.ConfigurationManager; import org.dspace.sort.SortException; import org.dspace.sort.SortOption; import org.dspace.uri.IdentifierService; import org.xml.sax.SAXException; import java.io.IOException; import java.io.Serializable; import java.sql.SQLException; /** * Display a single community. This includes a full text search, browse by list, * community display and a list of recent submissions. * private static final Logger log = Logger.getLogger(DSpaceFeedGenerator.class); * @author Scott Phillips */ public class CommunityViewer //extends AbstractDSpaceTransformer implements CacheableProcessingComponent { // private static final Logger log = Logger.getLogger(DSpaceFeedGenerator.class); // // /** Language Strings */ // private static final Message T_dspace_home = // message("xmlui.general.dspace_home"); // // private static final Message T_full_text_search = // message("xmlui.ArtifactBrowser.CommunityViewer.full_text_search"); // // private static final Message T_go = // message("xmlui.general.go"); // // private static final Message T_head_browse = // message("xmlui.ArtifactBrowser.CommunityViewer.head_browse"); // // private static final Message T_browse_titles = // message("xmlui.ArtifactBrowser.CommunityViewer.browse_titles"); // // private static final Message T_browse_authors = // message("xmlui.ArtifactBrowser.CommunityViewer.browse_authors"); // // private static final Message T_browse_dates = // message("xmlui.ArtifactBrowser.CommunityViewer.browse_dates"); // // private static final Message T_head_sub_communities = // message("xmlui.ArtifactBrowser.CommunityViewer.head_sub_communities"); // // private static final Message T_head_sub_collections = // message("xmlui.ArtifactBrowser.CommunityViewer.head_sub_collections"); // // private static final Message T_head_recent_submissions = // message("xmlui.ArtifactBrowser.CommunityViewer.head_recent_submissions"); // // /** How many recient submissions to list */ // private static final int RECENT_SUBMISISONS = 5; // // /** The cache of recently submitted items */ // private java.util.List<Item> recentSubmittedItems; // // /** Cached validity object */ // private SourceValidity validity; // // /** // * Generate the unique caching key. // * This key must be unique inside the space of this component. // */ // public Serializable getKey() { // try { // DSpaceObject dso = URIUtil.resolve(objectModel); // // if (dso == null) // return "0"; // no item, something is wrong // // return HashUtil.hash(IdentifierService.getCanonicalForm(dso)); // } // catch (SQLException sqle) // { // // Ignore all errors and just return that the component is not cachable. // return "0"; // } // } // // /** // * Generate the cache validity object. // * // * This validity object includes the community being viewed, all // * sub-communites (one level deep), all sub-collections, and // * recently submitted items. // */ // public SourceValidity getValidity() // { // if (this.validity == null) // { // try { // DSpaceObject dso = URIUtil.resolve(objectModel); // // if (dso == null) // return null; // // if (!(dso instanceof Community)) // return null; // // Community community = (Community) dso; // // DSpaceValidity validity = new DSpaceValidity(); // validity.add(community); // // Community[] subCommunities = community.getSubcommunities(); // Collection[] collections = community.getCollections(); // // Sub communities // for (Community subCommunity : subCommunities) // { // validity.add(subCommunity); // } // // Sub collections // for (Collection collection : collections) // { // validity.add(collection); // } // // // Recently submitted items // for (Item item : getRecientlySubmittedIems(community)) // { // validity.add(item); // } // // this.validity = validity.complete(); // } // catch (Exception e) // { // // Ignore all errors and invalidate the cache. // } // } // return this.validity; // } // // // /** // * Add the community's title and trail links to the page's metadata // */ // public void addPageMeta(PageMeta pageMeta) throws SAXException, // WingException, UIException, SQLException, IOException, // AuthorizeException // { // DSpaceObject dso = URIUtil.resolve(objectModel); // if (!(dso instanceof Community)) // return; // // // Set up the major variables // Community community = (Community) dso; // // Set the page title // pageMeta.addMetadata("title").addContent(community.getMetadata("name")); // // // Add the trail back to the repository root. // pageMeta.addTrailLink(contextPath + "/",T_dspace_home); // HandleUtil.buildHandleTrail(community, pageMeta,contextPath); // // // Add RSS links if available // String formats = ConfigurationManager.getProperty("webui.feed.formats"); // if ( formats != null ) // { // for (String format : formats.split(",")) // { // // Remove the protocol number, i.e. just list 'rss' or' atom' // String[] parts = format.split("_"); // if (parts.length < 1) // continue; // // String feedFormat = parts[0].trim()+"+xml"; // // String feedURL = IdentifierService.getURL(community).toString() +"/"+format.trim(); // pageMeta.addMetadata("feed", feedFormat).addContent(feedURL); // } // } // } // // /** // * Display a single community (and refrence any sub communites or // * collections) // */ // public void addBody(Body body) throws SAXException, WingException, // UIException, SQLException, IOException, AuthorizeException // { // // DSpaceObject dso = URIUtil.resolve(objectModel); // if (!(dso instanceof Community)) // return; // // // Set up the major variables // Community community = (Community) dso; // Community[] subCommunities = community.getSubcommunities(); // Collection[] collections = community.getCollections(); // // // Build the community viewer division. // Division home = body.addDivision("community-home", "primary repository community"); // home.setHead(community.getMetadata("name")); // // // The search / browse box. // { // Division search = home.addDivision("community-search-browse", // "secondary search-browse"); // // // Search query // Division query = search.addInteractiveDivision("community-search", // IdentifierService.getURL(community).toString() + "/search", // Division.METHOD_POST, "secondary search"); // // Para para = query.addPara("search-query", null); // para.addContent(T_full_text_search); // para.addContent(" "); // para.addText("query"); // para.addContent(" "); // para.addButton("submit").setValue(T_go); // // // Browse by list // Division browseDiv = search.addDivision("community-browse","secondary browse"); // List browse = browseDiv.addList("community-browse", List.TYPE_SIMPLE, // "community-browse"); // browse.setHead(T_head_browse); // String url = IdentifierService.getURL(community).toString(); // browse.addItemXref(url + "/browse-title",T_browse_titles); // browse.addItemXref(url + "/browse-author",T_browse_authors); // browse.addItemXref(url + "/browse-date",T_browse_dates); // } // // // Add main reference: // { // Division viewer = home.addDivision("community-view","secondary"); // // ReferenceSet referenceSet = viewer.addReferenceSet("community-view", // ReferenceSet.TYPE_DETAIL_VIEW); // Reference communityInclude = referenceSet.addReference(community); // // // If the community has any children communities also refrence them. // if (subCommunities != null && subCommunities.length > 0) // { // ReferenceSet communityReferenceSet = communityInclude // .addReferenceSet(ReferenceSet.TYPE_SUMMARY_LIST,null,"hierarchy"); // // communityReferenceSet.setHead(T_head_sub_communities); // // // Sub communities // for (Community subCommunity : subCommunities) // { // communityReferenceSet.addReference(subCommunity); // } // } // if (collections != null && collections.length > 0) // { // ReferenceSet communityReferenceSet = communityInclude // .addReferenceSet(ReferenceSet.TYPE_SUMMARY_LIST,null,"hierarchy"); // // communityReferenceSet.setHead(T_head_sub_collections); // // // // Sub collections // for (Collection collection : collections) // { // communityReferenceSet.addReference(collection); // } // // } // }// main refrence // // // Reciently submitted items // { // java.util.List<Item> items = getRecientlySubmittedIems(community); // // Division lastSubmittedDiv = home // .addDivision("community-recent-submission","secondary recent-submission"); // lastSubmittedDiv.setHead(T_head_recent_submissions); // ReferenceSet lastSubmitted = lastSubmittedDiv.addReferenceSet( // "collection-last-submitted", ReferenceSet.TYPE_SUMMARY_LIST, // null, "recent-submissions"); // for (Item item : items) // { // lastSubmitted.addReference(item); // } // } // } // // /** // * Get the recently submitted items for the given community. // * // * @param community The community. // */ // @SuppressWarnings("unchecked") // private java.util.List<Item> getRecientlySubmittedIems(Community community) // throws SQLException // { // if (recentSubmittedItems != null) // return recentSubmittedItems; // // String source = ConfigurationManager.getProperty("recent.submissions.sort-option"); // BrowserScope scope = new BrowserScope(context); // scope.setCommunity(community); // scope.setResultsPerPage(RECENT_SUBMISISONS); // // // FIXME Exception Handling // try // { // scope.setBrowseIndex(BrowseIndex.getItemBrowseIndex()); // for (SortOption so : SortOption.getSortOptions()) // { // if (so.getName().equals(source)) // scope.setSortBy(so.getNumber()); // } // // BrowseEngine be = new BrowseEngine(context); // this.recentSubmittedItems = be.browse(scope).getResults(); // } // catch (SortException se) // { // log.error("Caught SortException", se); // } // catch (BrowseException bex) // { // log.error("Caught BrowseException", bex); // } // // return this.recentSubmittedItems; // } // // /** // * Recycle // */ // public void recycle() // { // // Clear out our item's cache. // this.recentSubmittedItems = null; // this.validity = null; // super.recycle(); // } // // }
[ "daniele.ninfo@gmail.com" ]
daniele.ninfo@gmail.com
e94ccbac58da17f75a0830acde9689b5edd71c2d
37c2e5208c0d474f3f63b9c0e8a32607850468c9
/src/main/java/br/com/react/service/dto/ClientDTO.java
36853c89e5ffb221f6f5f60bcbce182999f8aa63
[]
no_license
Pissarra/react-exercicio-back-end
1b9b57765076bf6a446ad2b318b3f0da91cfb66e
1fb203dfaa2c43c6f1860d6281ada876c829f935
refs/heads/master
2020-04-29T12:58:44.860950
2019-03-17T20:31:57
2019-03-17T20:31:57
175,986,474
0
0
null
null
null
null
UTF-8
Java
false
false
1,767
java
package br.com.react.service.dto; import br.com.react.enums.UF; import javax.validation.constraints.NotNull; import java.util.HashSet; import java.util.Set; public class ClientDTO { private Long id; @NotNull private String name; @NotNull private String cpf; @NotNull private String cep; @NotNull private String logradouro; @NotNull private String bairro; @NotNull private UF uf; private String complemento; private Set<PhoneDTO> phones = new HashSet<>(); public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getCpf() { return cpf; } public void setCpf(String cpf) { this.cpf = cpf; } public String getCep() { return cep; } public void setCep(String cep) { this.cep = cep; } public String getLogradouro() { return logradouro; } public void setLogradouro(String logradouro) { this.logradouro = logradouro; } public String getBairro() { return bairro; } public void setBairro(String bairro) { this.bairro = bairro; } public UF getUf() { return uf; } public void setUf(UF uf) { this.uf = uf; } public String getComplemento() { return complemento; } public void setComplemento(String complemento) { this.complemento = complemento; } public Set<PhoneDTO> getPhones() { return phones; } public void setPhones(Set<PhoneDTO> phones) { this.phones = phones; } }
[ "rpissarras@gmail.com" ]
rpissarras@gmail.com
cec4bb0ea569031912006b725762212f375440c8
192b32a1a884d29a689565d9f868f4d96b324495
/src/main/java/io/codeager/infra/raft/Experimental.java
54d25ea3b4b5c23df8585430e57b780404417022
[]
no_license
jiup/raft
5933b63b29053510fd654bf914a4df76b04eecf1
f01a80e365f06c871919a70b86b9456a260fc285
refs/heads/master
2020-05-16T20:53:41.401068
2019-05-06T14:01:24
2019-05-06T14:01:24
183,290,945
1
0
null
null
null
null
UTF-8
Java
false
false
327
java
package io.codeager.infra.raft; /** * @author Jiupeng Zhang * @since 04/25/2019 */ public @interface Experimental { enum Statement { NOT_FULLY_DESIGNED, NOT_FULLY_CODED, TODO_TEST, MALFUNCTIONED, TODO } Statement[] value(); Class ref() default Experimental.class; String note() default ""; }
[ "jiupeng.zhang@rochester.edu" ]
jiupeng.zhang@rochester.edu
4f2935116363f34b560b07b8915b212d53045109
03ab199d6e87428e704dbee0602a669209f195d7
/order-service/src/main/java/com/order/exception/CustomizedResponseEntityExceptionHandler.java
8727eda652e0e8ed4589ab7c2be7d5576d47dbb1
[]
no_license
ganeshpop/ShoppingMicroservicesProject
cdb7b6282f95def750a5eab1fa68889cecdf4f62
a213e86648b3f7f2c0832f52bba254d28ba08c77
refs/heads/master
2023-07-30T15:13:10.172019
2021-10-05T03:08:32
2021-10-05T03:08:32
405,632,523
1
0
null
null
null
null
UTF-8
Java
false
false
3,357
java
package com.order.exception; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.MethodArgumentNotValidException; import org.springframework.web.bind.annotation.ControllerAdvice; import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.context.request.WebRequest; import org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler; import java.util.Date; @ControllerAdvice @RestController public class CustomizedResponseEntityExceptionHandler extends ResponseEntityExceptionHandler { @ExceptionHandler(Exception.class) public final ResponseEntity<Object> handleAllExceptions(Exception exception, WebRequest request) { ExceptionResponse exceptionResponse = new ExceptionResponse(new Date(), exception.getMessage(), request.getDescription(false)); return new ResponseEntity<>(exceptionResponse, HttpStatus.INTERNAL_SERVER_ERROR); } @Override protected ResponseEntity<Object> handleMethodArgumentNotValid(MethodArgumentNotValidException exception, HttpHeaders headers, HttpStatus status, WebRequest request) { ExceptionResponse exceptionResponse = new ExceptionResponse(new Date(), "Validation Failed", exception.getBindingResult().toString()); return new ResponseEntity<>(exceptionResponse, HttpStatus.BAD_REQUEST); } @ExceptionHandler(InvalidProductQuantityException.class) public final ResponseEntity<Object> handleInvalidProductQuantityException(InvalidProductQuantityException invalidProductQuantityException, WebRequest request) { ExceptionResponse exceptionResponse = new ExceptionResponse(new Date(), invalidProductQuantityException.getMessage(), request.getDescription(false)); return new ResponseEntity<>(exceptionResponse, HttpStatus.BAD_REQUEST); } @ExceptionHandler(ProductNotFoundException.class) public final ResponseEntity<Object> handleProductNotFoundException(ProductNotFoundException productNotFoundException, WebRequest request) { ExceptionResponse exceptionResponse = new ExceptionResponse(new Date(), productNotFoundException.getMessage(), request.getDescription(false)); return new ResponseEntity<>(exceptionResponse, HttpStatus.NOT_FOUND); } @ExceptionHandler(ProductNotFoundInInventoryException.class) public final ResponseEntity<Object> handleProductNotFoundInInventoryException(ProductNotFoundInInventoryException productNotFoundInInventoryException, WebRequest request) { ExceptionResponse exceptionResponse = new ExceptionResponse(new Date(), productNotFoundInInventoryException.getMessage(), request.getDescription(false)); return new ResponseEntity<>(exceptionResponse, HttpStatus.NOT_FOUND); } @ExceptionHandler(UserNotFoundException.class) public final ResponseEntity<Object> handleUserNotFoundException(UserNotFoundException userNotFoundException, WebRequest request) { ExceptionResponse exceptionResponse = new ExceptionResponse(new Date(), userNotFoundException.getMessage(), request.getDescription(false)); return new ResponseEntity<>(exceptionResponse, HttpStatus.NOT_FOUND); } }
[ "ganeshgo1999@gmail.com" ]
ganeshgo1999@gmail.com
be705998cc47a194bd3627bc629d3b6c98e6dc02
ddf24b280c71259c5500d66b156f73812e1e7d6f
/app/src/main/java/home/smart/fly/animations/activity/WXGalleryActivity.java
22ddb3a13363cdb0c833504eb367e9db2d98a506
[ "Apache-2.0" ]
permissive
MnyZhao/AndroidAnimationExercise
70b424e11c1f35ab693f6551ff43c54b15bb73b5
c8d1434eb1777515a27d8d7e6610fce7f51e1625
refs/heads/master
2021-01-01T04:42:22.683876
2017-07-14T00:42:50
2017-07-14T00:42:50
null
0
0
null
null
null
null
UTF-8
Java
false
false
394
java
package home.smart.fly.animations.activity; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import home.smart.fly.animations.R; public class WXGalleryActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_wxgallery); } }
[ "foreverlove.zyl@163.com" ]
foreverlove.zyl@163.com
f1c1cc89bba6759c3727d2cbff8c3a506807a721
0b468290185cafef2518f74b41674734030fa838
/src/main/java/com/framework/appium/GenerateLogs.java
f16a925ec42238c5be0dbd9d2de5d80d15344517
[]
no_license
vvidyasagar1/FloowDriveTest
044b8c0393eec7dc1fba538047d135532f60ef25
cc98ee3e6926dcbe6c8d720098745b794f50ab4e
refs/heads/master
2020-03-28T10:41:33.382423
2018-09-10T12:31:50
2018-09-10T12:31:50
148,134,781
0
0
null
null
null
null
UTF-8
Java
false
false
629
java
package com.framework.appium; import java.io.FileInputStream; import java.io.IOException; import java.util.Properties; import org.apache.log4j.Logger; import org.apache.log4j.PropertyConfigurator; public class GenerateLogs { public static Logger log; public void generateLogs() throws IOException { //console //file log = Logger.getLogger(getClass()); Properties prop = new Properties(); FileInputStream file = new FileInputStream(System.getProperty("user.dir")+"\\src\\main\\resources\\config\\log4j.properties"); prop.load(file); PropertyConfigurator.configure(prop); } }
[ "vvidyasagar1@gmail.com" ]
vvidyasagar1@gmail.com
12c2806b8ec36885641de5494a29937622fe7afa
13109cf6b42e6d30725a8b73f05618b09cb0a0fa
/src/test/java/kr/or/ddit/ioc/SpringIocTest.java
315947d57223eb723c250b17ea3b53ac74eece68
[]
no_license
Joongseok/spring
eb437620f78e0d0eaa28eeb85ff334d188fce9ce
4699506f3700e4368170c672a1713e3a9886c728
refs/heads/master
2022-12-09T16:28:52.275334
2019-07-08T01:36:40
2019-07-08T01:36:40
192,683,410
0
0
null
2022-11-16T12:22:48
2019-06-19T07:40:10
Java
UTF-8
Java
false
false
1,007
java
package kr.or.ddit.ioc; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import org.junit.Test; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; import kr.or.ddit.board.service.IBoardService; public class SpringIocTest { /** * Method : springIocTest * 작성자 : PC25 * 변경이력 : * Method 설명 : 스프링 컨테이너 생성 테스트 */ @Test public void springIocTest() { /***Given***/ // 스프링 컨테이너 생성 String configLocation = "classpath:kr/or/ddit/ioc/application-ioc-test.xml"; ApplicationContext context = new ClassPathXmlApplicationContext(configLocation); /***When***/ IBoardService boardService = (IBoardService)context.getBean("boardService"); String sayHello = boardService.sayHello(); /***Then***/ assertNotNull(boardService); assertEquals("boardDao sayHello", sayHello); } }
[ "diat1450@gmail.com" ]
diat1450@gmail.com
4871515eaba118b259776999f72665ebdc55a631
ce53b5c7902bfd495ecc5399d09fa2f9ca73c2aa
/App.java
78fe9d8b8ff68bfe1a0a57a244d10da8702d1484
[]
no_license
rmit-s3491184-sam-jacobson/src
34b12ce2df5c569c6f165e38527fb62c84e8d6e9
ac40c8a53a2da833bc683491cdf91040fa923ab4
refs/heads/master
2021-01-22T13:08:38.569483
2015-05-11T04:01:53
2015-05-11T04:01:53
35,401,261
0
0
null
null
null
null
UTF-8
Java
false
false
9,369
java
/* Start up code for SEF Student Management System 2015 semester 1. * This code should be used for your initial class diagram. * You are free to adapt or completely change the code and design for the * extended class diagram and implementation as long as your design allows * for all the requirements and test cases. * */ import java.util.*; public class App { HashMap<String, Course> courses = new HashMap<String,Course>(); HashMap<String, Venue> venues = new HashMap<String, Venue>(); HashMap<String, Lecturer> lecturers = new HashMap<String, Lecturer>(); Scanner scan = new Scanner(System.in); private int year = 2015; private int semester = 1; public static void main(String[] args) { App a = new App(); String options[] = {"Add Offering","Add Lecture","Add Lecturer", "Lecturer TimeTable", "Venue TimeTable", "View Menu"}; Menu m = new Menu("Main Menu", options); int resp; do { if ((resp = m.getResponse()) == 0) break; switch (resp) { case 1: a.handleCreateOffering(); break; case 2: a.handleAddLecture(); break; case 3: a.handleAssignLecturer(); break; case 4: a.printLecturerTimetable(); break; case 5: a.printVenueTimetable(); break; case 6: String options2[] = {"View Courses","View Lecturers","View Venues"}; Menu sub = new Menu("View Submenu", options2); int n = 0; while ((n = sub.getResponse()) != 0) a.view(n); break; } } while (true); } public App() { initializeCourses(); initializeVenues(); initializeLecturers(); } public void view(int n) { if (n == 1) displayMap(courses); else if (n==2) displayMap(lecturers); else displayMap(venues); } public void displayMap(Map m) { Set keySet = m.keySet(); Iterator iterator = keySet.iterator(); while (iterator.hasNext()) { String key = (String) iterator.next(); System.out.println(key + ":" + m.get(key) ); } hold(); } public void handleCreateOffering() { System.out.print("Enter Course ID : "); String courseID = scan.nextLine(); Course course = getCourse(courseID); CourseOffering co; if (course == null) { System.out.println("Course ID is invalid"); hold(); } else { System.out.print("Enter Expected Number : "); int expectedNum = scan.nextInt(); scan.nextLine(); try { createOffering(course,expectedNum,year,semester); } catch (PreExistException pe) { System.out.println(pe); hold(); } } } public CourseOffering createOffering(Course course, int expectedNum,int year,int semester) throws PreExistException { return course.createOffering(expectedNum,year,semester); } private void hold() { System.out.print("Press enter to continue"); scan.nextLine(); } public void handleAddLecture() { System.out.print("Enter Course ID : "); String courseID = scan.nextLine(); CourseOffering courseOffering = getCourseOffering(courseID,year,semester); if ( courseOffering == null) { System.out.println("No course offering yet"); hold(); return; } System.out.print("Enter Venue Location : "); String location = scan.nextLine(); Venue venue = getVenue(location); if ( venue == null) { System.out.println("No such venue"); hold(); return; } System.out.print("Enter Day of Lecture : "); int day = scan.nextInt(); System.out.print("Enter Start Hour : "); double startHour = scan.nextInt(); System.out.print("Enter Duration : "); double duration = scan.nextInt(); scan.nextLine(); try { courseOffering.assignLecture(day, startHour, duration, venue); System.out.println(courseOffering); } catch (ClashException ce) { System.out.println(ce); } catch (PreExistException pe) { System.out.println(pe); } } public void assignLecture(CourseOffering co, int day, double startHour, double duration, Venue venue) throws ClashException, PreExistException { co.assignLecture(day, startHour, duration, venue); } public void handleAssignLecturer() { System.out.print("Enter Course ID : "); String courseID = scan.nextLine(); CourseOffering courseOffering = getCourseOffering(courseID,year,semester); if ( courseOffering == null) { System.out.println("No course offering yet"); hold(); return; } Lecture lecture = courseOffering.getLecture(); if ( lecture == null) { System.out.println("No lecture assigned to this course offering yet "); hold(); return; } System.out.print("Enter Lecturer ID : "); String lecID = scan.nextLine(); Lecturer lecturer = getLecturer(lecID); if (lecturer == null) { System.out.println("No lecturer with such ID "); hold(); return; } try { assignLecturer(lecture,lecturer); } catch (ClashException ce) { System.out.println(ce); } catch (PreExistException pe) {System.out.println(pe); } } public void assignLecturer(Lecture lecture, Lecturer lecturer) throws ClashException, PreExistException { lecturer.assign(lecture); } public void printLecturerTimetable() { System.out.print("Enter Lecturer ID : "); String lecturerID = scan.nextLine(); Lecturer lecturer = getLecturer(lecturerID); if (lecturer == null) { System.out.println("No lecturer with this ID"); return; } ArrayList<Lecture> lectures = getLectures(lecturer); if (lectures == null) return; for (int i=0; i<lectures.size(); i++) System.out.println(lectures.get(i)); } public void printVenueTimetable() { System.out.print("Enter Venue Location : "); String location = scan.nextLine(); Venue venue = getVenue(location); if (venue == null) { System.out.println("No Venue at this location"); return; } ArrayList<Lesson> lessons = getLessons(venue); if (lessons == null) return; for (int i=0; i<lessons.size(); i++) System.out.println(lessons.get(i)); } public void initializeCourses() { Course course1 = new Course("P101", "Programming 1", "Teach Basic Programming"); Course course2 = new Course("P102", "Programming 2", "Teach Intermediate Programming"); Course course3 = new Course("S101", "Software Engineering", "Teach UML and Modelling"); Course course4 = new Course("WP1", "Web Programming", "Teach Web Technologies"); Course course5 = new Course("UI1", "User Interface", "Teach UI Principles"); Course course6 = new Course("Math","Discret Maths","Teach Maths needed for CS"); Course course7 = new Course("Net1", "Networkins","Teach networking principles"); course3.addPrereq(course1); course2.addPrereq(course1); course7.addPrereq(course2); course7.addPrereq(course6); courses.put("P101",course1); courses.put("P102",course2); courses.put("S101",course3); courses.put("WP1",course4); courses.put("UI1",course5); courses.put("Math",course6); courses.put("Net1",course7); } public void initializeVenues() { venues.put("12.10.02",new Venue("12.10.02",120,"Lecture")); venues.put("12.10.03",new Venue("12.10.03",200,"Lecture")); venues.put("10.10.22",new Venue("10.10.22",36,"TuteLab")); venues.put("10.10.23",new Venue("10.10.23",36,"TuteLab")); } public void initializeLecturers() { lecturers.put("e44556",new Lecturer("e44556","Tim O'Connor","Lecturer","14.13.12")); lecturers.put("e44321",new Lecturer("e44321","Richard Cooper","Professor","14.13.12")); lecturers.put("e54321",new Lecturer("e54321","Jane Smith","Lecturer","11.9.10")); } public ArrayList <Lecture> getLectures(Lecturer lecturer) { return lecturer.getLectures(); } public ArrayList <Lesson> getLessons(Venue venue) { return venue.getLessons(); } public Lecturer getLecturer(String eNo) { return lecturers.get(eNo); } public Venue getVenue(String location) { return venues.get(location); } public Course getCourse(String ID) { return courses.get(ID); } public Lecture getLecture(CourseOffering offering) { return offering.getLecture(); } public CourseOffering getCourseOffering(String ID, int year, int sem) { Course c = courses.get(ID); if (c == null) return null; return c.getOffering(year, semester); } }
[ "s3491184@student.rmit.edu.au" ]
s3491184@student.rmit.edu.au
cc916355dcf902c4faa9fa9b05d25bfafe27e056
a3963be82e467298e0275c08de4040e555b5851c
/src/main/java/pe/com/jdmm21/demojpa3/app/demojpa3/controller/DemoController1.java
c80910b10af772fb6d3d2bd21f62aa21e027eb9d
[]
no_license
juandiego9221/demoHibernate
bdd913f21bdaa1f7d78234c986bd0ea43d46340d
4155e1cddcfae2b05c22d34219149799eb645703
refs/heads/master
2022-07-26T14:21:26.757522
2020-01-12T00:53:30
2020-01-12T00:53:30
231,138,991
0
0
null
2022-06-21T02:33:07
2019-12-31T19:36:38
Java
UTF-8
Java
false
false
1,007
java
package pe.com.jdmm21.demojpa3.app.demojpa3.controller; import org.hibernate.Session; import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.GetMapping; @Controller public class DemoController1 { Session session; DemoController1(Session session) { this.session = session; } @GetMapping("/test1") private ResponseEntity<?> hibernateTest1() { String query = "select p from Person1 p join fetch p.course1 join fetch p.games1"; return ResponseEntity.ok(session.createQuery(query).getResultList()); } @GetMapping("/test2") private ResponseEntity<?> hibernateTest2() { return ResponseEntity.ok(session.createQuery("select ph1 from Phone1 ph1").getResultList()); } @GetMapping("/test3") private ResponseEntity<?> hibernateTest3() { return ResponseEntity.ok(session.createQuery("select ph2 from Phone2 ph2").getResultList()); } }
[ "juandiego9221@gmail.com" ]
juandiego9221@gmail.com
fa776697a9c0883c6552526dd6d5968fe2d9544e
da9c190599e9ccaa29c620eb1dc3d5e4a23735f4
/Taller2/src/taller2/Nota.java
dfdab27ad2aa966cd59d335d4ff211e90d6da87a
[]
no_license
jonarosero/f-algoritmos-ej-17
8e263401e162f4fce6d5a1c78ff139b57a914f6e
c238367569aa0a9ddd146fd3c754fb754fae05ea
refs/heads/master
2021-09-05T20:58:50.007342
2018-01-31T00:53:03
2018-01-31T00:53:03
105,784,386
0
0
null
null
null
null
UTF-8
Java
false
false
1,051
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package taller2; /** * * @author USUARIO */ public class Nota { //atributos de la clase private String asignatura; private double calificacion; //constructor public Nota(String asignatura, double calificacion) { this.asignatura = asignatura; this.calificacion = calificacion; } public String getAsignatura() { return asignatura; } public void setAsignatura(String asignatura) { this.asignatura = asignatura; } public double getCalificacion() { return calificacion; } public void setCalificacion(double calificacion) { this.calificacion = calificacion; } //El metodo to String servira para dar formato a la salida por pantalla @Override public String toString() { return String.format("%.2f(%s)\t|", this.calificacion, this.asignatura); } }
[ "jars9605@hotmail.com" ]
jars9605@hotmail.com
3cfaa6ddfaa3466613bed2f4935bd35b93f4e5d6
6a721ccd1c38e79bfa308ca7e616f14a11a46a9d
/library/src/main/java/com/qks/mylibrary/utils/NotificationUtils.java
ab0db328ba6dfede8be26b795feb7d09e411a745
[]
no_license
linzhengloser/BeautyExchange
292b77319db902c9b345de439c76000cbbc33e2f
b447acbc1f25dc3163e6fe9fcdb8dc88bb1ce5c0
refs/heads/master
2020-01-23T21:49:17.054609
2017-04-24T09:16:08
2017-04-24T09:16:08
74,741,627
5
0
null
null
null
null
UTF-8
Java
false
false
366
java
package com.qks.mylibrary.utils; import java.util.concurrent.atomic.AtomicInteger; /** * Created by admin on 2016/5/18. */ public class NotificationUtils { /** * 用来获取通知的ID,防止重复 */ private final static AtomicInteger c = new AtomicInteger(0); public static int getID() { return c.incrementAndGet(); } }
[ "1007687534@qq.com" ]
1007687534@qq.com
cae140b2fab5de3e058351628a30ba325c89558f
ae66151ea895fae47ac8c9bf04a5a324bb2e254f
/Football_Scores/app/src/main/java/au/com/zacher/footballscores/MainActivity.java
e08270d45c0dea51134cbb9214830d65f0cfbe0b
[ "Apache-2.0" ]
permissive
bradzacher/NanodegreeSuperDuo
27d91ceaef3e74860ed811258e03bd9e901c50a5
ad5a63a8c9dca6e518c2414e206ad4b121c88cc3
refs/heads/master
2021-01-10T14:20:37.201611
2015-10-07T06:24:58
2015-10-07T06:24:58
43,658,373
0
0
null
null
null
null
UTF-8
Java
false
false
3,780
java
package au.com.zacher.footballscores; import android.content.Intent; import android.os.Bundle; import android.support.annotation.NonNull; import android.support.v7.app.ActionBarActivity; import android.util.Log; import android.view.Menu; import android.view.MenuItem; public class MainActivity extends ActionBarActivity { private static final String LOG_TAG = "MainActivity"; private static final String SAVE_TAG = "Save Test"; public static int selectedMatchId; public static int currentFragment = 2; private PagerFragment _myMain; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Log.d(LOG_TAG, "Reached MainActivity onCreate"); if (savedInstanceState == null) { initMyMain(); } } private void initMyMain() { _myMain = new PagerFragment(); getSupportFragmentManager().beginTransaction() .add(R.id.container, _myMain) .commit(); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.menu_main, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { // Handle action bar item clicks here. The action bar will // automatically handle clicks on the Home/Up button, so long // as you specify a parent activity in AndroidManifest.xml. int id = item.getItemId(); //noinspection SimplifiableIfStatement if (id == R.id.action_about) { Intent start_about = new Intent(this, AboutActivity.class); startActivity(start_about); return true; } return super.onOptionsItemSelected(item); } @Override protected void onSaveInstanceState(Bundle outState) { boolean isRtl = Utilities.isRTL(this); Log.v(SAVE_TAG, "will save"); Log.v(SAVE_TAG, "fragment: " + String.valueOf(_myMain.pagerHandler.getCurrentItem())); Log.v(SAVE_TAG, "selected id: " + selectedMatchId); Log.v(SAVE_TAG, "is rtl: " + isRtl); outState.putInt("Pager_Current", _myMain.pagerHandler.getCurrentItem()); outState.putInt("Selected_match", selectedMatchId); outState.putBoolean("Is_RTL", isRtl); getSupportFragmentManager().putFragment(outState, "_myMain", _myMain); super.onSaveInstanceState(outState); } @Override protected void onRestoreInstanceState(@NonNull Bundle savedInstanceState) { boolean isRtl = savedInstanceState.getBoolean("Is_RTL"); if (isRtl == Utilities.isRTL(this)) { Log.v(SAVE_TAG, "will retrive"); Log.v(SAVE_TAG, "fragment: " + String.valueOf(savedInstanceState.getInt("Pager_Current"))); Log.v(SAVE_TAG, "selected id: " + savedInstanceState.getInt("Selected_match")); currentFragment = savedInstanceState.getInt("Pager_Current"); selectedMatchId = savedInstanceState.getInt("Selected_match"); _myMain = (PagerFragment) getSupportFragmentManager().getFragment(savedInstanceState, "_myMain"); } else { Log.v(SAVE_TAG, "will not retrive - changed language state"); _myMain = (PagerFragment) getSupportFragmentManager().getFragment(savedInstanceState, "_myMain"); getSupportFragmentManager().beginTransaction().remove(_myMain).commit(); initMyMain(); } super.onRestoreInstanceState(savedInstanceState); } }
[ "brad.zacher@gmail.com" ]
brad.zacher@gmail.com
c812e202420bfc9fe16b8a923638a24acbe06338
83bf5561aa60f7deae423a54760908277bc88824
/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/http/NativeHttpRequest.java
14dbfeaee3b92dec73a6655e19ba1e920fdd00aa
[ "Apache-2.0", "BSD-2-Clause", "LicenseRef-scancode-unknown-license-reference", "LicenseRef-scancode-warranty-disclaimer", "NCSA", "ISC", "blessing", "BSD-3-Clause", "OpenSSL", "IJG", "BSL-1.0", "Zlib", "Libpng", "curl", "MIT", "LicenseRef-scancode-openssl", "LicenseRef-scancode-sslea...
permissive
FYourLove/mapbox-gl-native
9a2d0dc6e4450205dd2000c671db33b5fa67ae1c
bb55bae76db4454affa2cacca956e726a2b43a4b
refs/heads/master
2020-04-05T03:01:41.758564
2018-11-06T11:37:14
2018-11-06T16:39:13
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,631
java
package com.mapbox.mapboxsdk.http; import android.support.annotation.Keep; import com.mapbox.mapboxsdk.Mapbox; import java.util.concurrent.locks.ReentrantLock; @Keep public class NativeHttpRequest implements HttpResponder { private final HttpRequest httpRequest = Mapbox.getModuleProvider().createHttpRequest(); // Reentrancy is not needed, but "Lock" is an abstract class. private final ReentrantLock lock = new ReentrantLock(); @Keep private long nativePtr; @Keep private NativeHttpRequest(long nativePtr, String resourceUrl, String etag, String modified) { this.nativePtr = nativePtr; if (resourceUrl.startsWith("local://")) { // used by render test to serve files from assets executeLocalRequest(resourceUrl); return; } httpRequest.executeRequest(this, nativePtr, resourceUrl, etag, modified); } public void cancel() { httpRequest.cancelRequest(); // TODO: We need a lock here because we can try // to cancel at the same time the request is getting // answered on the OkHTTP thread. We could get rid of // this lock by using Runnable when we move Android // implementation of mbgl::RunLoop to Looper. lock.lock(); nativePtr = 0; lock.unlock(); } public void onResponse(int responseCode, String etag, String lastModified, String cacheControl, String expires, String retryAfter, String xRateLimitReset, byte[] body) { lock.lock(); if (nativePtr != 0) { nativeOnResponse(responseCode, etag, lastModified, cacheControl, expires, retryAfter, xRateLimitReset, body); } lock.unlock(); } private void executeLocalRequest(String resourceUrl) { new LocalRequestTask(new LocalRequestTask.OnLocalRequestResponse() { @Override public void onResponse(byte[] bytes) { if (bytes != null) { lock.lock(); if (nativePtr != 0) { NativeHttpRequest.this.nativeOnResponse(200, null, null, null, null, null, null, bytes); } lock.unlock(); } } }).execute(resourceUrl); } public void handleFailure(int type, String errorMessage) { lock.lock(); if (nativePtr != 0) { nativeOnFailure(type, errorMessage); } lock.unlock(); } @Keep private native void nativeOnFailure(int type, String message); @Keep private native void nativeOnResponse(int code, String etag, String modified, String cacheControl, String expires, String retryAfter, String xRateLimitReset, byte[] body); }
[ "tobrun@mapbox.com" ]
tobrun@mapbox.com
2f167da369b4e53c0e7e1cea224ef22e47eb4b45
000b238a57789afcd5a46da8bbfa7a4f3ffc2163
/grassroot-services/src/main/java/za/org/grassroot/services/task/EventLogBroker.java
ba8badb78f1001492c25bcbf2295f711b0d14292
[]
no_license
mokoka/grassroot-platform
11d708dd189a9f7ecdbceeaec33cb3eba8e769d8
acc01e02932df56a05f3c90884d1ee20a5b9faa4
refs/heads/master
2021-01-19T02:31:46.114154
2017-05-24T12:58:33
2017-05-24T12:58:33
87,287,454
0
0
null
2017-04-05T08:48:31
2017-04-05T08:48:31
null
UTF-8
Java
false
false
755
java
package za.org.grassroot.services.task; import za.org.grassroot.core.domain.Event; import za.org.grassroot.core.domain.EventLog; import za.org.grassroot.core.domain.User; import za.org.grassroot.core.dto.ResponseTotalsDTO; import za.org.grassroot.core.enums.EventLogType; import za.org.grassroot.core.enums.EventRSVPResponse; public interface EventLogBroker { EventLog createEventLog(EventLogType eventLogType, String eventUid, String userUid, EventRSVPResponse message); EventLog fetchResponseForEvent(Event event, User user); void rsvpForEvent(String eventUid, String userUid, EventRSVPResponse rsvpResponse); boolean hasUserRespondedToEvent(Event event, User user); ResponseTotalsDTO getResponseCountForEvent(Event event); }
[ "luke.jordan@grassroot.org.za" ]
luke.jordan@grassroot.org.za
f5b085fb529ad86a5192e0b33eabc90e112bb335
4d0825bdeeb6205e87696f3ad445fb95431707e4
/edu/chientran98/designpattern/filter/CriteriaFemale.java
1866ce02e0d0cdfa6c456c3a988ea082b216ada3
[]
no_license
chientranse/designpatterns
9ba4f7182f0bfb83051ea5f70edc902a69b4e80b
91f4a8c31a1432af772ef37ee36a19c3a4e19432
refs/heads/master
2020-06-09T06:33:53.496757
2018-05-20T01:52:57
2018-05-20T01:52:57
193,391,741
1
0
null
null
null
null
UTF-8
Java
false
false
398
java
package edu.chientran98.designpattern.filter; import java.util.List; import java.util.stream.Collectors; /** * * @author yeula */ public class CriteriaFemale implements Criteria { @Override public List<Person> meetCriteria(List<Person> persons) { return persons.stream().filter((person) -> person.getGender().equalsIgnoreCase("female")).collect(Collectors.toList()); } }
[ "yeula@DESKTOP-0IKF64G" ]
yeula@DESKTOP-0IKF64G
43beecf33b5577212bc2597c04b108fe3d8cbe1f
98d313cf373073d65f14b4870032e16e7d5466f0
/gradle-open-labs/example/src/main/java/se/molybden/Class10027.java
9eb271da8a80d42c75822405de4d6304565d0538
[]
no_license
Molybden/gradle-in-practice
30ac1477cc248a90c50949791028bc1cb7104b28
d7dcdecbb6d13d5b8f0ff4488740b64c3bbed5f3
refs/heads/master
2021-06-26T16:45:54.018388
2016-03-06T20:19:43
2016-03-06T20:19:43
24,554,562
0
0
null
null
null
null
UTF-8
Java
false
false
110
java
public class Class10027{ public void callMe(){ System.out.println("called"); } }
[ "jocce.nilsson@gmail.com" ]
jocce.nilsson@gmail.com
9c431e8924c5815fa1135afef6a4cebeca19aa7b
f55c438e3d9516be23c722aec7b33e69ef058304
/JUnit_Assignment/bowlingproblem/src/test/java/com/accolite/bowlingproblem/TestApp.java
2f975b6a10e5dcb550b870091eb252a9a2abc6fb
[]
no_license
D-madhukar/AU-Spring-19
a22c42024b88d101a56450a2dc53a7a36a518363
7e2a9d073e29e35ff1635181171c945032bd1893
refs/heads/master
2020-04-16T12:57:14.431747
2019-03-18T11:16:31
2019-03-18T11:16:31
165,603,461
0
0
null
null
null
null
UTF-8
Java
false
false
901
java
package com.accolite.bowlingproblem; import static org.junit.Assert.assertEquals; import org.junit.Test; /** * Created by : Madhukar Domakonda * Unit test for simple App. */ public class TestApp{ @Test public void testForNoScore() { assertEquals(0, App.getBowlingScore(new int[] {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0})); } @Test public void testForAllTens() { assertEquals(300, App.getBowlingScore(new int[] {10,10,10,10,10,10,10,10,10,10,10,10})); } @Test(expected=PointsException.class) public void testForInvalidPoints() { App.getBowlingScore(new int[] {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,-1,-1}); } @Test(expected=PointsException.class) public void testForMinInputs() { App.getBowlingScore(new int[] {1,2,3,4}); } @Test public void testForLastFrameWithoutStrike() { assertEquals(41, App.getBowlingScore(new int[] {0,0,0,1,0,0,0,6,10,0,5,0,0,0,3,5,0,6,0})); } }
[ "madhukarpateld@gmail.com" ]
madhukarpateld@gmail.com
27e82dd2d1aa9a46a67e5df4293dbbd8cd6249ff
91ad400051e64567443c242b410be9041ed2bdfa
/win/verble/VerbleAntiLeak/checks/IP.java
7697e7a92bb853f924aa0f028e244a07c15dbd7e
[]
no_license
Verbleh/VerbleAntiLeak
ff03a2fd162a07e319d1ff0d070806b63952a9b5
b4d037b479c65b79820bba8e812313d7fb78ff9d
refs/heads/master
2021-07-24T05:36:56.235123
2017-11-04T20:26:11
2017-11-04T20:26:11
109,527,615
13
8
null
null
null
null
UTF-8
Java
false
false
1,231
java
package win.verble.VerbleAntiLeak.checks; import java.io.BufferedReader; import java.io.InputStreamReader; import java.net.URL; import win.verble.VerbleAntiLeak.utils.MessageSender; import win.verble.VerbleAntiLeak.utils.VerbleUtils; public class IP { public static String URL = "Your IP url here"; public static void updateTask() { { try { String key = ""; boolean usable = false; URL IPURL = new URL("http://checkip.amazonaws.com/"); BufferedReader br = new BufferedReader(new InputStreamReader(IPURL.openStream())); String IP = br.readLine(); URL url = new URL(URL); BufferedReader r = new BufferedReader(new InputStreamReader(url.openStream())); while ((key = r.readLine()) != null) { if (key.toLowerCase().contains(IP)) { usable = true; System.out.println("[VerbleAL]: IP Protection Stage Completed"); } } if (!usable) { MessageSender.infoBox("IP is not whitelisted.", "IP Check Failed"); VerbleUtils.ShutDownPC(); VerbleUtils.Exit(); } } catch (Exception e) { } } } }
[ "31633590+Verbleh@users.noreply.github.com" ]
31633590+Verbleh@users.noreply.github.com
61f17a5b1d57b69712010d78ff620a50a1b0a989
c4b368744f20d71cfc7b6dad2a8ecbbfdd6fe032
/gen/com/example/SmsApp/R.java
5597b1a500cbda6d7255227a67e2e95c1367f2eb
[]
no_license
knockchange/SmsApp
3f559a50337e3fa048bdfcc3672ee69b79709a57
279e4e8bd239e4d708a59af96b00f516d9f67f0b
refs/heads/master
2016-09-08T00:21:33.636386
2015-02-23T14:19:34
2015-02-23T14:19:34
31,176,438
1
0
null
null
null
null
UTF-8
Java
false
false
174
java
/*___Generated_by_IDEA___*/ package com.example.SmsApp; /* This stub is only used by the IDE. It is NOT the R class actually packed into the APK */ public final class R { }
[ "agarwal.shubham21@gmail.com" ]
agarwal.shubham21@gmail.com
80649c0af3352878bc97e668375b0788b600c9b4
c948e194a09ee50fd5469597d5641b472cd197ae
/src/main/java/com/kindee/proxyapi/spider/Spider.java
21addb89ca500b63317645391033885ef862040a
[]
no_license
bpker/proxy
288dca301c1d647605763900ca44f2dcf9c302f1
700519f820612ecadd87a242df8daf695d898bc2
refs/heads/master
2023-02-22T09:10:43.292329
2021-01-31T10:26:34
2021-01-31T10:26:34
334,627,299
0
0
null
null
null
null
UTF-8
Java
false
false
2,531
java
package com.kindee.proxyapi.spider; import com.kindee.proxyapi.model.Proxy; import com.kindee.proxyapi.spider.utils.DateUtil; import com.kindee.proxyapi.spider.utils.MD5Util; import org.jsoup.nodes.Document; import java.util.ArrayList; import java.util.List; /** * Created by lixuezhao on 2018/5/25. */ public class Spider { private final String ChARGE_PROXY_URL = "http://dps.kuaidaili.com/api/getdps/?orderid=957918250256056&num={#num}&ut=1&format=xml&sep=1"; private final String FREE_PROXY__URL = "http://www.89ip.cn/tqdl.html?num=600"; private JsoupDownloader downloader = new JsoupDownloader(); public List<Proxy> crawlFreeProxy(){ Document doc = null; try { doc = downloader.get(FREE_PROXY__URL); // System.out.println(doc); } catch (Exception e) { e.printStackTrace(); return null; } RegexSelector selector = new RegexSelector(doc.outerHtml()); List<String> ipStrs = selector.selectList("\\d+.\\d+.\\d+.\\d+:\\d{1,5}"); List<Proxy> proxies = new ArrayList<Proxy>(); for (String ipStr: ipStrs){ selector = new RegexSelector(ipStr); String ip = selector.selectOne("(.*):(.*)", 1); String port = selector.selectOne("(.*):(.*)", 2); if (ip.length() > 0 && port.length() > 0 ) proxies.add(new Proxy(ip, port, "免费代理", DateUtil.getCurrentTime(), 1, MD5Util.md5(ip + port), FREE_PROXY__URL)); } return proxies; } public List<Proxy> crawlChargeProxy(int num){ Document doc = null; try { String url = ChARGE_PROXY_URL.replace("{#num}", String.valueOf(num)); doc = downloader.get(url); } catch (Exception e) { e.printStackTrace(); return null; } RegexSelector selector = new RegexSelector(doc.outerHtml()); List<String> ipStrs = selector.selectList("\\d+.\\d+.\\d+.\\d+:\\d{1,5}"); List<Proxy> proxies = new ArrayList<Proxy>(); for (String ipStr: ipStrs){ selector = new RegexSelector(ipStr); String ip = selector.selectOne("(.*):(.*)", 1); String port = selector.selectOne("(.*):(.*)", 2); if (ip.length() > 0 && port.length() > 0 && !proxies.contains(ip)) proxies.add(new Proxy(ip, port, "收费代理")); } return proxies; } }
[ "anger77123" ]
anger77123
278fff0ebba34500daa54dc192a414ee1b425984
b61984a4fb8731b8e594bb7b73e45d66406874d6
/src/mitiv/array/impl/StriddenFloat9D.java
1d287bd517f450f2d2f64fd32b849860b08d3fef
[ "MIT" ]
permissive
Lightjohn/TiPi
6be433912929f1f2702a8e060e524652b22b267a
6ebd7f167035635e4721f607cfe654006d139cdc
refs/heads/master
2021-01-18T04:56:07.851151
2016-02-10T13:46:12
2016-02-10T13:46:12
30,015,541
0
0
null
2015-01-29T10:34:19
2015-01-29T10:34:17
null
UTF-8
Java
false
false
38,491
java
/* * This file is part of TiPi (a Toolkit for Inverse Problems and Imaging) * developed by the MitiV project. * * Copyright (c) 2014 the MiTiV project, http://mitiv.univ-lyon1.fr/ * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ package mitiv.array.impl; import mitiv.array.Float1D; import mitiv.array.Float8D; import mitiv.array.Float9D; import mitiv.base.indexing.Range; import mitiv.base.mapping.FloatFunction; import mitiv.base.mapping.FloatScanner; import mitiv.random.FloatGenerator; import mitiv.base.indexing.CompiledRange; /** * Stridden implementation of 9-dimensional arrays of float's. * * @author Éric Thiébaut. */ public class StriddenFloat9D extends Float9D { final int order; final float[] data; final int offset; final int stride1; final int stride2; final int stride3; final int stride4; final int stride5; final int stride6; final int stride7; final int stride8; final int stride9; public StriddenFloat9D(float[] arr, int offset, int[] stride, int[] dims) { super(dims); if (stride.length != 9) { throw new IllegalArgumentException("There must be as many strides as the rank."); } this.data = arr; this.offset = offset; stride1 = stride[0]; stride2 = stride[1]; stride3 = stride[2]; stride4 = stride[3]; stride5 = stride[4]; stride6 = stride[5]; stride7 = stride[6]; stride8 = stride[7]; stride9 = stride[8]; this.order = Float9D.checkViewStrides(data.length, offset, stride1, stride2, stride3, stride4, stride5, stride6, stride7, stride8, stride9, dim1, dim2, dim3, dim4, dim5, dim6, dim7, dim8, dim9); } public StriddenFloat9D(float[] arr, int offset, int stride1, int stride2, int stride3, int stride4, int stride5, int stride6, int stride7, int stride8, int stride9, int dim1, int dim2, int dim3, int dim4, int dim5, int dim6, int dim7, int dim8, int dim9) { super(dim1, dim2, dim3, dim4, dim5, dim6, dim7, dim8, dim9); this.data = arr; this.offset = offset; this.stride1 = stride1; this.stride2 = stride2; this.stride3 = stride3; this.stride4 = stride4; this.stride5 = stride5; this.stride6 = stride6; this.stride7 = stride7; this.stride8 = stride8; this.stride9 = stride9; this.order = Float9D.checkViewStrides(data.length, offset, stride1, stride2, stride3, stride4, stride5, stride6, stride7, stride8, stride9, dim1, dim2, dim3, dim4, dim5, dim6, dim7, dim8, dim9); } @Override public void checkSanity() { Float9D.checkViewStrides(data.length, offset, stride1, stride2, stride3, stride4, stride5, stride6, stride7, stride8, stride9, dim1, dim2, dim3, dim4, dim5, dim6, dim7, dim8, dim9); } private boolean isFlat() { return (offset == 0 && stride1 == 1 && stride2 == dim1 && stride3 == dim2*stride2 && stride4 == dim3*stride3 && stride5 == dim4*stride4 && stride6 == dim5*stride5 && stride7 == dim6*stride6 && stride8 == dim7*stride7 && stride9 == dim8*stride8); } final int index(int i1, int i2, int i3, int i4, int i5, int i6, int i7, int i8, int i9) { return offset + stride9*i9 + stride8*i8 + stride7*i7 + stride6*i6 + stride5*i5 + stride4*i4 + stride3*i3 + stride2*i2 + stride1*i1; } @Override public final float get(int i1, int i2, int i3, int i4, int i5, int i6, int i7, int i8, int i9) { return data[offset + stride9*i9 + stride8*i8 + stride7*i7 + stride6*i6 + stride5*i5 + stride4*i4 + stride3*i3 + stride2*i2 + stride1*i1]; } @Override public final void set(int i1, int i2, int i3, int i4, int i5, int i6, int i7, int i8, int i9, float value) { data[offset + stride9*i9 + stride8*i8 + stride7*i7 + stride6*i6 + stride5*i5 + stride4*i4 + stride3*i3 + stride2*i2 + stride1*i1] = value; } @Override public final int getOrder() { return order; } @Override public void fill(float value) { if (getOrder() == ROW_MAJOR) { for (int i1 = 0; i1 < dim1; ++i1) { int j1 = stride1*i1 + offset; for (int i2 = 0; i2 < dim2; ++i2) { int j2 = stride2*i2 + j1; for (int i3 = 0; i3 < dim3; ++i3) { int j3 = stride3*i3 + j2; for (int i4 = 0; i4 < dim4; ++i4) { int j4 = stride4*i4 + j3; for (int i5 = 0; i5 < dim5; ++i5) { int j5 = stride5*i5 + j4; for (int i6 = 0; i6 < dim6; ++i6) { int j6 = stride6*i6 + j5; for (int i7 = 0; i7 < dim7; ++i7) { int j7 = stride7*i7 + j6; for (int i8 = 0; i8 < dim8; ++i8) { int j8 = stride8*i8 + j7; for (int i9 = 0; i9 < dim9; ++i9) { int j9 = stride9*i9 + j8; data[j9] = value; } } } } } } } } } } else { /* Assume column-major order. */ for (int i9 = 0; i9 < dim9; ++i9) { int j9 = stride9*i9 + offset; for (int i8 = 0; i8 < dim8; ++i8) { int j8 = stride8*i8 + j9; for (int i7 = 0; i7 < dim7; ++i7) { int j7 = stride7*i7 + j8; for (int i6 = 0; i6 < dim6; ++i6) { int j6 = stride6*i6 + j7; for (int i5 = 0; i5 < dim5; ++i5) { int j5 = stride5*i5 + j6; for (int i4 = 0; i4 < dim4; ++i4) { int j4 = stride4*i4 + j5; for (int i3 = 0; i3 < dim3; ++i3) { int j3 = stride3*i3 + j4; for (int i2 = 0; i2 < dim2; ++i2) { int j2 = stride2*i2 + j3; for (int i1 = 0; i1 < dim1; ++i1) { int j1 = stride1*i1 + j2; data[j1] = value; } } } } } } } } } } } @Override public void fill(FloatGenerator generator) { if (getOrder() == ROW_MAJOR) { for (int i1 = 0; i1 < dim1; ++i1) { int j1 = stride1*i1 + offset; for (int i2 = 0; i2 < dim2; ++i2) { int j2 = stride2*i2 + j1; for (int i3 = 0; i3 < dim3; ++i3) { int j3 = stride3*i3 + j2; for (int i4 = 0; i4 < dim4; ++i4) { int j4 = stride4*i4 + j3; for (int i5 = 0; i5 < dim5; ++i5) { int j5 = stride5*i5 + j4; for (int i6 = 0; i6 < dim6; ++i6) { int j6 = stride6*i6 + j5; for (int i7 = 0; i7 < dim7; ++i7) { int j7 = stride7*i7 + j6; for (int i8 = 0; i8 < dim8; ++i8) { int j8 = stride8*i8 + j7; for (int i9 = 0; i9 < dim9; ++i9) { int j9 = stride9*i9 + j8; data[j9] = generator.nextFloat(); } } } } } } } } } } else { /* Assume column-major order. */ for (int i9 = 0; i9 < dim9; ++i9) { int j9 = stride9*i9 + offset; for (int i8 = 0; i8 < dim8; ++i8) { int j8 = stride8*i8 + j9; for (int i7 = 0; i7 < dim7; ++i7) { int j7 = stride7*i7 + j8; for (int i6 = 0; i6 < dim6; ++i6) { int j6 = stride6*i6 + j7; for (int i5 = 0; i5 < dim5; ++i5) { int j5 = stride5*i5 + j6; for (int i4 = 0; i4 < dim4; ++i4) { int j4 = stride4*i4 + j5; for (int i3 = 0; i3 < dim3; ++i3) { int j3 = stride3*i3 + j4; for (int i2 = 0; i2 < dim2; ++i2) { int j2 = stride2*i2 + j3; for (int i1 = 0; i1 < dim1; ++i1) { int j1 = stride1*i1 + j2; data[j1] = generator.nextFloat(); } } } } } } } } } } } @Override public void increment(float value) { if (getOrder() == ROW_MAJOR) { for (int i1 = 0; i1 < dim1; ++i1) { int j1 = stride1*i1 + offset; for (int i2 = 0; i2 < dim2; ++i2) { int j2 = stride2*i2 + j1; for (int i3 = 0; i3 < dim3; ++i3) { int j3 = stride3*i3 + j2; for (int i4 = 0; i4 < dim4; ++i4) { int j4 = stride4*i4 + j3; for (int i5 = 0; i5 < dim5; ++i5) { int j5 = stride5*i5 + j4; for (int i6 = 0; i6 < dim6; ++i6) { int j6 = stride6*i6 + j5; for (int i7 = 0; i7 < dim7; ++i7) { int j7 = stride7*i7 + j6; for (int i8 = 0; i8 < dim8; ++i8) { int j8 = stride8*i8 + j7; for (int i9 = 0; i9 < dim9; ++i9) { int j9 = stride9*i9 + j8; data[j9] += value; } } } } } } } } } } else { /* Assume column-major order. */ for (int i9 = 0; i9 < dim9; ++i9) { int j9 = stride9*i9 + offset; for (int i8 = 0; i8 < dim8; ++i8) { int j8 = stride8*i8 + j9; for (int i7 = 0; i7 < dim7; ++i7) { int j7 = stride7*i7 + j8; for (int i6 = 0; i6 < dim6; ++i6) { int j6 = stride6*i6 + j7; for (int i5 = 0; i5 < dim5; ++i5) { int j5 = stride5*i5 + j6; for (int i4 = 0; i4 < dim4; ++i4) { int j4 = stride4*i4 + j5; for (int i3 = 0; i3 < dim3; ++i3) { int j3 = stride3*i3 + j4; for (int i2 = 0; i2 < dim2; ++i2) { int j2 = stride2*i2 + j3; for (int i1 = 0; i1 < dim1; ++i1) { int j1 = stride1*i1 + j2; data[j1] += value; } } } } } } } } } } } @Override public void decrement(float value) { if (getOrder() == ROW_MAJOR) { for (int i1 = 0; i1 < dim1; ++i1) { int j1 = stride1*i1 + offset; for (int i2 = 0; i2 < dim2; ++i2) { int j2 = stride2*i2 + j1; for (int i3 = 0; i3 < dim3; ++i3) { int j3 = stride3*i3 + j2; for (int i4 = 0; i4 < dim4; ++i4) { int j4 = stride4*i4 + j3; for (int i5 = 0; i5 < dim5; ++i5) { int j5 = stride5*i5 + j4; for (int i6 = 0; i6 < dim6; ++i6) { int j6 = stride6*i6 + j5; for (int i7 = 0; i7 < dim7; ++i7) { int j7 = stride7*i7 + j6; for (int i8 = 0; i8 < dim8; ++i8) { int j8 = stride8*i8 + j7; for (int i9 = 0; i9 < dim9; ++i9) { int j9 = stride9*i9 + j8; data[j9] -= value; } } } } } } } } } } else { /* Assume column-major order. */ for (int i9 = 0; i9 < dim9; ++i9) { int j9 = stride9*i9 + offset; for (int i8 = 0; i8 < dim8; ++i8) { int j8 = stride8*i8 + j9; for (int i7 = 0; i7 < dim7; ++i7) { int j7 = stride7*i7 + j8; for (int i6 = 0; i6 < dim6; ++i6) { int j6 = stride6*i6 + j7; for (int i5 = 0; i5 < dim5; ++i5) { int j5 = stride5*i5 + j6; for (int i4 = 0; i4 < dim4; ++i4) { int j4 = stride4*i4 + j5; for (int i3 = 0; i3 < dim3; ++i3) { int j3 = stride3*i3 + j4; for (int i2 = 0; i2 < dim2; ++i2) { int j2 = stride2*i2 + j3; for (int i1 = 0; i1 < dim1; ++i1) { int j1 = stride1*i1 + j2; data[j1] -= value; } } } } } } } } } } } @Override public void scale(float value) { if (getOrder() == ROW_MAJOR) { for (int i1 = 0; i1 < dim1; ++i1) { int j1 = stride1*i1 + offset; for (int i2 = 0; i2 < dim2; ++i2) { int j2 = stride2*i2 + j1; for (int i3 = 0; i3 < dim3; ++i3) { int j3 = stride3*i3 + j2; for (int i4 = 0; i4 < dim4; ++i4) { int j4 = stride4*i4 + j3; for (int i5 = 0; i5 < dim5; ++i5) { int j5 = stride5*i5 + j4; for (int i6 = 0; i6 < dim6; ++i6) { int j6 = stride6*i6 + j5; for (int i7 = 0; i7 < dim7; ++i7) { int j7 = stride7*i7 + j6; for (int i8 = 0; i8 < dim8; ++i8) { int j8 = stride8*i8 + j7; for (int i9 = 0; i9 < dim9; ++i9) { int j9 = stride9*i9 + j8; data[j9] *= value; } } } } } } } } } } else { /* Assume column-major order. */ for (int i9 = 0; i9 < dim9; ++i9) { int j9 = stride9*i9 + offset; for (int i8 = 0; i8 < dim8; ++i8) { int j8 = stride8*i8 + j9; for (int i7 = 0; i7 < dim7; ++i7) { int j7 = stride7*i7 + j8; for (int i6 = 0; i6 < dim6; ++i6) { int j6 = stride6*i6 + j7; for (int i5 = 0; i5 < dim5; ++i5) { int j5 = stride5*i5 + j6; for (int i4 = 0; i4 < dim4; ++i4) { int j4 = stride4*i4 + j5; for (int i3 = 0; i3 < dim3; ++i3) { int j3 = stride3*i3 + j4; for (int i2 = 0; i2 < dim2; ++i2) { int j2 = stride2*i2 + j3; for (int i1 = 0; i1 < dim1; ++i1) { int j1 = stride1*i1 + j2; data[j1] *= value; } } } } } } } } } } } @Override public void map(FloatFunction function) { if (getOrder() == ROW_MAJOR) { for (int i1 = 0; i1 < dim1; ++i1) { int j1 = stride1*i1 + offset; for (int i2 = 0; i2 < dim2; ++i2) { int j2 = stride2*i2 + j1; for (int i3 = 0; i3 < dim3; ++i3) { int j3 = stride3*i3 + j2; for (int i4 = 0; i4 < dim4; ++i4) { int j4 = stride4*i4 + j3; for (int i5 = 0; i5 < dim5; ++i5) { int j5 = stride5*i5 + j4; for (int i6 = 0; i6 < dim6; ++i6) { int j6 = stride6*i6 + j5; for (int i7 = 0; i7 < dim7; ++i7) { int j7 = stride7*i7 + j6; for (int i8 = 0; i8 < dim8; ++i8) { int j8 = stride8*i8 + j7; for (int i9 = 0; i9 < dim9; ++i9) { int j9 = stride9*i9 + j8; data[j9] = function.apply(data[j9]); } } } } } } } } } } else { /* Assume column-major order. */ for (int i9 = 0; i9 < dim9; ++i9) { int j9 = stride9*i9 + offset; for (int i8 = 0; i8 < dim8; ++i8) { int j8 = stride8*i8 + j9; for (int i7 = 0; i7 < dim7; ++i7) { int j7 = stride7*i7 + j8; for (int i6 = 0; i6 < dim6; ++i6) { int j6 = stride6*i6 + j7; for (int i5 = 0; i5 < dim5; ++i5) { int j5 = stride5*i5 + j6; for (int i4 = 0; i4 < dim4; ++i4) { int j4 = stride4*i4 + j5; for (int i3 = 0; i3 < dim3; ++i3) { int j3 = stride3*i3 + j4; for (int i2 = 0; i2 < dim2; ++i2) { int j2 = stride2*i2 + j3; for (int i1 = 0; i1 < dim1; ++i1) { int j1 = stride1*i1 + j2; data[j1] = function.apply(data[j1]); } } } } } } } } } } } @Override public void scan(FloatScanner scanner) { boolean initialized = false; if (getOrder() == ROW_MAJOR) { for (int i1 = 0; i1 < dim1; ++i1) { int j1 = stride1*i1 + offset; for (int i2 = 0; i2 < dim2; ++i2) { int j2 = stride2*i2 + j1; for (int i3 = 0; i3 < dim3; ++i3) { int j3 = stride3*i3 + j2; for (int i4 = 0; i4 < dim4; ++i4) { int j4 = stride4*i4 + j3; for (int i5 = 0; i5 < dim5; ++i5) { int j5 = stride5*i5 + j4; for (int i6 = 0; i6 < dim6; ++i6) { int j6 = stride6*i6 + j5; for (int i7 = 0; i7 < dim7; ++i7) { int j7 = stride7*i7 + j6; for (int i8 = 0; i8 < dim8; ++i8) { int j8 = stride8*i8 + j7; for (int i9 = 0; i9 < dim9; ++i9) { int j9 = stride9*i9 + j8; if (initialized) { scanner.update(data[j9]); } else { scanner.initialize(data[j9]); initialized = true; } } } } } } } } } } } else { /* Assume column-major order. */ for (int i9 = 0; i9 < dim9; ++i9) { int j9 = stride9*i9 + offset; for (int i8 = 0; i8 < dim8; ++i8) { int j8 = stride8*i8 + j9; for (int i7 = 0; i7 < dim7; ++i7) { int j7 = stride7*i7 + j8; for (int i6 = 0; i6 < dim6; ++i6) { int j6 = stride6*i6 + j7; for (int i5 = 0; i5 < dim5; ++i5) { int j5 = stride5*i5 + j6; for (int i4 = 0; i4 < dim4; ++i4) { int j4 = stride4*i4 + j5; for (int i3 = 0; i3 < dim3; ++i3) { int j3 = stride3*i3 + j4; for (int i2 = 0; i2 < dim2; ++i2) { int j2 = stride2*i2 + j3; for (int i1 = 0; i1 < dim1; ++i1) { int j1 = stride1*i1 + j2; if (initialized) { scanner.update(data[j1]); } else { scanner.initialize(data[j1]); initialized = true; } } } } } } } } } } } } @Override public float[] flatten(boolean forceCopy) { if (! forceCopy && isFlat()) { return data; } float[] out = new float[number]; int j = -1; for (int i9 = 0; i9 < dim9; ++i9) { int j9 = stride9*i9 + offset; for (int i8 = 0; i8 < dim8; ++i8) { int j8 = stride8*i8 + j9; for (int i7 = 0; i7 < dim7; ++i7) { int j7 = stride7*i7 + j8; for (int i6 = 0; i6 < dim6; ++i6) { int j6 = stride6*i6 + j7; for (int i5 = 0; i5 < dim5; ++i5) { int j5 = stride5*i5 + j6; for (int i4 = 0; i4 < dim4; ++i4) { int j4 = stride4*i4 + j5; for (int i3 = 0; i3 < dim3; ++i3) { int j3 = stride3*i3 + j4; for (int i2 = 0; i2 < dim2; ++i2) { int j2 = stride2*i2 + j3; for (int i1 = 0; i1 < dim1; ++i1) { int j1 = stride1*i1 + j2; out[++j] = data[j1]; } } } } } } } } } return out; } @Override public Float8D slice(int idx) { return new StriddenFloat8D(data, offset + stride9*idx, // offset stride1, stride2, stride3, stride4, stride5, stride6, stride7, stride8, // strides dim1, dim2, dim3, dim4, dim5, dim6, dim7, dim8); // dimensions } @Override public Float8D slice(int idx, int dim) { int sliceOffset; int sliceStride1, sliceStride2, sliceStride3, sliceStride4, sliceStride5, sliceStride6, sliceStride7, sliceStride8; int sliceDim1, sliceDim2, sliceDim3, sliceDim4, sliceDim5, sliceDim6, sliceDim7, sliceDim8; if (dim < 0) { /* A negative index is taken with respect to the end. */ dim += 9; } if (dim == 0) { /* Slice along 1st dimension. */ sliceOffset = offset + stride1*idx; sliceStride1 = stride2; sliceStride2 = stride3; sliceStride3 = stride4; sliceStride4 = stride5; sliceStride5 = stride6; sliceStride6 = stride7; sliceStride7 = stride8; sliceStride8 = stride9; sliceDim1 = dim2; sliceDim2 = dim3; sliceDim3 = dim4; sliceDim4 = dim5; sliceDim5 = dim6; sliceDim6 = dim7; sliceDim7 = dim8; sliceDim8 = dim9; } else if (dim == 1) { /* Slice along 2nd dimension. */ sliceOffset = offset + stride2*idx; sliceStride1 = stride1; sliceStride2 = stride3; sliceStride3 = stride4; sliceStride4 = stride5; sliceStride5 = stride6; sliceStride6 = stride7; sliceStride7 = stride8; sliceStride8 = stride9; sliceDim1 = dim1; sliceDim2 = dim3; sliceDim3 = dim4; sliceDim4 = dim5; sliceDim5 = dim6; sliceDim6 = dim7; sliceDim7 = dim8; sliceDim8 = dim9; } else if (dim == 2) { /* Slice along 3rd dimension. */ sliceOffset = offset + stride3*idx; sliceStride1 = stride1; sliceStride2 = stride2; sliceStride3 = stride4; sliceStride4 = stride5; sliceStride5 = stride6; sliceStride6 = stride7; sliceStride7 = stride8; sliceStride8 = stride9; sliceDim1 = dim1; sliceDim2 = dim2; sliceDim3 = dim4; sliceDim4 = dim5; sliceDim5 = dim6; sliceDim6 = dim7; sliceDim7 = dim8; sliceDim8 = dim9; } else if (dim == 3) { /* Slice along 4th dimension. */ sliceOffset = offset + stride4*idx; sliceStride1 = stride1; sliceStride2 = stride2; sliceStride3 = stride3; sliceStride4 = stride5; sliceStride5 = stride6; sliceStride6 = stride7; sliceStride7 = stride8; sliceStride8 = stride9; sliceDim1 = dim1; sliceDim2 = dim2; sliceDim3 = dim3; sliceDim4 = dim5; sliceDim5 = dim6; sliceDim6 = dim7; sliceDim7 = dim8; sliceDim8 = dim9; } else if (dim == 4) { /* Slice along 5th dimension. */ sliceOffset = offset + stride5*idx; sliceStride1 = stride1; sliceStride2 = stride2; sliceStride3 = stride3; sliceStride4 = stride4; sliceStride5 = stride6; sliceStride6 = stride7; sliceStride7 = stride8; sliceStride8 = stride9; sliceDim1 = dim1; sliceDim2 = dim2; sliceDim3 = dim3; sliceDim4 = dim4; sliceDim5 = dim6; sliceDim6 = dim7; sliceDim7 = dim8; sliceDim8 = dim9; } else if (dim == 5) { /* Slice along 6th dimension. */ sliceOffset = offset + stride6*idx; sliceStride1 = stride1; sliceStride2 = stride2; sliceStride3 = stride3; sliceStride4 = stride4; sliceStride5 = stride5; sliceStride6 = stride7; sliceStride7 = stride8; sliceStride8 = stride9; sliceDim1 = dim1; sliceDim2 = dim2; sliceDim3 = dim3; sliceDim4 = dim4; sliceDim5 = dim5; sliceDim6 = dim7; sliceDim7 = dim8; sliceDim8 = dim9; } else if (dim == 6) { /* Slice along 7th dimension. */ sliceOffset = offset + stride7*idx; sliceStride1 = stride1; sliceStride2 = stride2; sliceStride3 = stride3; sliceStride4 = stride4; sliceStride5 = stride5; sliceStride6 = stride6; sliceStride7 = stride8; sliceStride8 = stride9; sliceDim1 = dim1; sliceDim2 = dim2; sliceDim3 = dim3; sliceDim4 = dim4; sliceDim5 = dim5; sliceDim6 = dim6; sliceDim7 = dim8; sliceDim8 = dim9; } else if (dim == 7) { /* Slice along 8th dimension. */ sliceOffset = offset + stride8*idx; sliceStride1 = stride1; sliceStride2 = stride2; sliceStride3 = stride3; sliceStride4 = stride4; sliceStride5 = stride5; sliceStride6 = stride6; sliceStride7 = stride7; sliceStride8 = stride9; sliceDim1 = dim1; sliceDim2 = dim2; sliceDim3 = dim3; sliceDim4 = dim4; sliceDim5 = dim5; sliceDim6 = dim6; sliceDim7 = dim7; sliceDim8 = dim9; } else if (dim == 8) { /* Slice along 9th dimension. */ sliceOffset = offset + stride9*idx; sliceStride1 = stride1; sliceStride2 = stride2; sliceStride3 = stride3; sliceStride4 = stride4; sliceStride5 = stride5; sliceStride6 = stride6; sliceStride7 = stride7; sliceStride8 = stride8; sliceDim1 = dim1; sliceDim2 = dim2; sliceDim3 = dim3; sliceDim4 = dim4; sliceDim5 = dim5; sliceDim6 = dim6; sliceDim7 = dim7; sliceDim8 = dim8; } else { throw new IndexOutOfBoundsException("Dimension index out of bounds."); } return new StriddenFloat8D(data, sliceOffset, sliceStride1, sliceStride2, sliceStride3, sliceStride4, sliceStride5, sliceStride6, sliceStride7, sliceStride8, sliceDim1, sliceDim2, sliceDim3, sliceDim4, sliceDim5, sliceDim6, sliceDim7, sliceDim8); } @Override public Float9D view(Range rng1, Range rng2, Range rng3, Range rng4, Range rng5, Range rng6, Range rng7, Range rng8, Range rng9) { CompiledRange cr1 = new CompiledRange(rng1, dim1, offset, stride1); CompiledRange cr2 = new CompiledRange(rng2, dim2, 0, stride2); CompiledRange cr3 = new CompiledRange(rng3, dim3, 0, stride3); CompiledRange cr4 = new CompiledRange(rng4, dim4, 0, stride4); CompiledRange cr5 = new CompiledRange(rng5, dim5, 0, stride5); CompiledRange cr6 = new CompiledRange(rng6, dim6, 0, stride6); CompiledRange cr7 = new CompiledRange(rng7, dim7, 0, stride7); CompiledRange cr8 = new CompiledRange(rng8, dim8, 0, stride8); CompiledRange cr9 = new CompiledRange(rng9, dim9, 0, stride9); if (cr1.doesNothing() && cr2.doesNothing() && cr3.doesNothing() && cr4.doesNothing() && cr5.doesNothing() && cr6.doesNothing() && cr7.doesNothing() && cr8.doesNothing() && cr9.doesNothing()) { return this; } return new StriddenFloat9D(this.data, cr1.getOffset() + cr2.getOffset() + cr3.getOffset() + cr4.getOffset() + cr5.getOffset() + cr6.getOffset() + cr7.getOffset() + cr8.getOffset() + cr9.getOffset(), cr1.getStride(), cr2.getStride(), cr3.getStride(), cr4.getStride(), cr5.getStride(), cr6.getStride(), cr7.getStride(), cr8.getStride(), cr9.getStride(), cr1.getNumber(), cr2.getNumber(), cr3.getNumber(), cr4.getNumber(), cr5.getNumber(), cr6.getNumber(), cr7.getNumber(), cr8.getNumber(), cr9.getNumber()); } @Override public Float9D view(int[] sel1, int[] sel2, int[] sel3, int[] sel4, int[] sel5, int[] sel6, int[] sel7, int[] sel8, int[] sel9) { int[] idx1 = Helper.select(offset, stride1, dim1, sel1); int[] idx2 = Helper.select(0, stride2, dim2, sel2); int[] idx3 = Helper.select(0, stride3, dim3, sel3); int[] idx4 = Helper.select(0, stride4, dim4, sel4); int[] idx5 = Helper.select(0, stride5, dim5, sel5); int[] idx6 = Helper.select(0, stride6, dim6, sel6); int[] idx7 = Helper.select(0, stride7, dim7, sel7); int[] idx8 = Helper.select(0, stride8, dim8, sel8); int[] idx9 = Helper.select(0, stride9, dim9, sel9); return new SelectedFloat9D(this.data, idx1, idx2, idx3, idx4, idx5, idx6, idx7, idx8, idx9); } @Override public Float1D as1D() { // FIXME: may already be contiguous return new FlatFloat1D(flatten(), number); } } /* * Local Variables: * mode: Java * tab-width: 8 * indent-tabs-mode: nil * c-basic-offset: 4 * fill-column: 78 * coding: utf-8 * ispell-local-dictionary: "american" * End: */
[ "eric.thiebaut@univ-lyon.fr" ]
eric.thiebaut@univ-lyon.fr
7899cd6a0b3bfa4afa602401b9876b81f65d5b08
e3e348f7732cf0a45b73628a51c54d7777690d0a
/src/main/java/shift/sextiarysector/item/ItemMineboat.java
5f159b5b7d4431506f53fe39a63a0f0418888c54
[]
no_license
shift02/SextiarySector2
cf89a03527cebd8a605c787e6d547f4ede5a8bde
79a78d3008f573a52de87bcf9f828c121b8038ce
refs/heads/master
2021-12-12T21:18:21.553111
2017-09-05T14:47:11
2017-09-05T14:47:11
25,522,254
10
16
null
2016-06-04T00:56:52
2014-10-21T12:56:47
Java
UTF-8
Java
false
false
4,414
java
package shift.sextiarysector.item; import java.util.List; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.MathHelper; import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.Vec3; import net.minecraft.world.World; import shift.sextiarysector.api.SextiarySectorAPI; import shift.sextiarysector.entity.EntityMineboat; import shift.sextiarysector.entity.EntityMineboatChest; public class ItemMineboat extends Item { public ItemMineboat() { super(); this.maxStackSize = 1; this.setCreativeTab(SextiarySectorAPI.TabSSTransport); } @Override public ItemStack onItemRightClick(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer p_77659_3_) { float f = 1.0F; float f1 = p_77659_3_.prevRotationPitch + (p_77659_3_.rotationPitch - p_77659_3_.prevRotationPitch) * f; float f2 = p_77659_3_.prevRotationYaw + (p_77659_3_.rotationYaw - p_77659_3_.prevRotationYaw) * f; double d0 = p_77659_3_.prevPosX + (p_77659_3_.posX - p_77659_3_.prevPosX) * f; double d1 = p_77659_3_.prevPosY + (p_77659_3_.posY - p_77659_3_.prevPosY) * f + 1.62D - p_77659_3_.yOffset; double d2 = p_77659_3_.prevPosZ + (p_77659_3_.posZ - p_77659_3_.prevPosZ) * f; Vec3 vec3 = Vec3.createVectorHelper(d0, d1, d2); float f3 = MathHelper.cos(-f2 * 0.017453292F - (float) Math.PI); float f4 = MathHelper.sin(-f2 * 0.017453292F - (float) Math.PI); float f5 = -MathHelper.cos(-f1 * 0.017453292F); float f6 = MathHelper.sin(-f1 * 0.017453292F); float f7 = f4 * f5; float f8 = f3 * f5; double d3 = 5.0D; Vec3 vec31 = vec3.addVector(f7 * d3, f6 * d3, f8 * d3); MovingObjectPosition movingobjectposition = p_77659_2_.rayTraceBlocks(vec3, vec31, true); if (movingobjectposition == null) { return p_77659_1_; } else { Vec3 vec32 = p_77659_3_.getLook(f); boolean flag = false; float f9 = 1.0F; List list = p_77659_2_.getEntitiesWithinAABBExcludingEntity(p_77659_3_, p_77659_3_.boundingBox.addCoord(vec32.xCoord * d3, vec32.yCoord * d3, vec32.zCoord * d3).expand(f9, f9, f9)); int i; for (i = 0; i < list.size(); ++i) { Entity entity = (Entity) list.get(i); if (entity.canBeCollidedWith()) { float f10 = entity.getCollisionBorderSize(); AxisAlignedBB axisalignedbb = entity.boundingBox.expand(f10, f10, f10); if (axisalignedbb.isVecInside(vec3)) { flag = true; } } } if (flag) { return p_77659_1_; } else { if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { i = movingobjectposition.blockX; int j = movingobjectposition.blockY; int k = movingobjectposition.blockZ; if (p_77659_2_.getBlock(i, j, k) == Blocks.snow_layer) { --j; } EntityMineboat entityboat = this.createMineboat(p_77659_2_, i, j, k);//new EntityMineboatChest(p_77659_2_, i + 0.5F, j + 1.0F, k + 0.5F); entityboat.rotationYaw = ((MathHelper.floor_double(p_77659_3_.rotationYaw * 4.0F / 360.0F + 0.5D) & 3) - 1) * 90; if (!p_77659_2_.getCollidingBoundingBoxes(entityboat, entityboat.boundingBox.expand(-0.1D, -0.1D, -0.1D)).isEmpty()) { return p_77659_1_; } if (!p_77659_2_.isRemote) { p_77659_2_.spawnEntityInWorld(entityboat); } if (!p_77659_3_.capabilities.isCreativeMode) { --p_77659_1_.stackSize; } } return p_77659_1_; } } } public EntityMineboat createMineboat(World par1World, double par2, double par4, double par6) { return new EntityMineboatChest(par1World, par2 + 0.5F, par4 + 1.0F, par6 + 0.5F); } }
[ "shift02ss@gmail.com" ]
shift02ss@gmail.com
1751be135aa46e6a25837578e05ecd262425c507
ed3188f1b1b4790e1a5cb5fd9bcd3b933dbecc38
/Android/aoe/library/logging/src/androidTest/java/com/didi/aoe/library/logging/ExampleInstrumentedTest.java
b44df8eb3b75a5471a230fc29c1ba2f09d77f498
[ "Apache-2.0" ]
permissive
msdgwzhy6/AoE
24f33e6bafb2b27fa1dbe32b341e5a02a1bd9f0b
7c6fc4866b6de8b33b0fb6b9ef43603ac5ae6eea
refs/heads/master
2020-07-27T08:37:14.457234
2019-09-14T14:32:33
2019-09-14T14:32:33
209,032,414
1
0
Apache-2.0
2019-09-17T11:10:36
2019-09-17T11:10:35
null
UTF-8
Java
false
false
766
java
package com.didi.aoe.library.logging; import android.content.Context; import androidx.test.platform.app.InstrumentationRegistry; import androidx.test.ext.junit.runners.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.assertEquals; /** * Instrumented test, which will execute on an Android device. * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test public void useAppContext() { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("com.didi.aoe.library.logging.test", appContext.getPackageName()); } }
[ "xkuloud@gmail.com" ]
xkuloud@gmail.com
55344633139b7da607bb49d03c280bbb62f0e17e
e2c85a214fc7174cda8e398a24f9c091b458eb65
/src/main/java/com/mmk/business/condition/RecommendGroupCondition.java
4d21f0cfad3c3f56dc2d05e62e3b6322f1c3e871
[]
no_license
sunzhongqiang/system
708b3e24bf125b5bea1d8c332820e668e04d2742
09ae96f0d33d1cc50ba4e67d1ad8aae76234de0d
refs/heads/master
2021-01-11T03:17:55.565023
2017-01-04T00:43:17
2017-01-04T00:43:17
71,093,131
1
0
null
null
null
null
UTF-8
Java
false
false
418
java
/* * * RecommendGroupCondition 创建于 2016-11-18 15:33:44 版权归作者和作者当前组织所有 */ package com.mmk.business.condition; import com.mmk.business.model.RecommendGroup; /** * RecommendGroupCondition : 拼团推荐管理 扩展查询模型 * 2016-11-18 15:33:44 *@author huguangling 胡广玲 *@version 1.0 * */ public class RecommendGroupCondition extends RecommendGroup{ }
[ "huguangling@PC201506111414" ]
huguangling@PC201506111414
7b82c6a05df4551cdd46a5127e50438247c5210f
5305b1cdb8adc89a48c80b5b84c4786b5908368b
/app/src/main/java/com/sudhakar/openweather/utils/Constants.java
73e9d85b1c5f19c99045bac182305582e126076a
[]
no_license
sudhakar4lead/OpenWeather
3b5ef29c6ed588dcef9d07bd19f286c642a8f034
49afe665bc4e266aff829a1814d726d5ba25149e
refs/heads/master
2020-03-17T06:42:08.232657
2018-05-14T20:00:06
2018-05-14T20:00:06
133,365,949
0
0
null
null
null
null
UTF-8
Java
false
false
3,446
java
package com.sudhakar.openweather.utils; public class Constants { /** * SharedPreference names */ public static final String APP_SETTINGS_NAME = "config"; public static final String PREF_WEATHER_NAME = "weather_pref"; public static final String PREF_FORECAST_NAME = "weather_forecast"; /** * Preferences constants */ public static final String APP_SETTINGS_LATITUDE = "latitude"; public static final String APP_SETTINGS_LONGITUDE = "longitude"; public static final String APP_SETTINGS_CITY = "city"; public static final String APP_SETTINGS_COUNTRY_CODE = "country_code"; public static final String APP_SETTINGS_GEO_COUNTRY_NAME = "geo_country_name"; public static final String APP_SETTINGS_GEO_DISTRICT_OF_CITY = "geo_district_name"; public static final String APP_SETTINGS_GEO_CITY = "geo_city_name"; public static final String LAST_UPDATE_TIME_IN_MS = "last_update"; public static final String KEY_PREF_TEMPERATURE = "temperature_pref_key"; public static final String KEY_PREF_HIDE_DESCRIPTION = "hide_desc_pref_key"; public static final String KEY_PREF_INTERVAL_NOTIFICATION = "notification_interval_pref_key"; public static final String KEY_PREF_WIDGET_UPDATE_LOCATION = "widget_update_location_pref_key"; public static final String KEY_PREF_WIDGET_USE_GEOCODER = "widget_use_geocoder_pref_key"; public static final String KEY_PREF_WIDGET_THEME = "widget_theme_pref_key"; public static final String KEY_PREF_WIDGET_UPDATE_PERIOD = "widget_update_period_pref_key"; public static final String PREF_LANGUAGE = "language_pref_key"; /** * About preference screen constants */ public static final String KEY_PREF_ABOUT_VERSION = "about_version_pref_key"; public static final String KEY_PREF_ABOUT_F_DROID = "about_f_droid_pref_key"; public static final String KEY_PREF_ABOUT_GOOGLE_PLAY = "about_google_play_pref_key"; public static final String WEATHER_DATA_TEMPERATURE = "temperature"; public static final String WEATHER_DATA_DESCRIPTION = "description"; public static final String WEATHER_DATA_PRESSURE = "pressure"; public static final String WEATHER_DATA_HUMIDITY = "humidity"; public static final String WEATHER_DATA_WIND_SPEED = "wind_speed"; public static final String WEATHER_DATA_CLOUDS = "clouds"; public static final String WEATHER_DATA_ICON = "icon"; public static final String WEATHER_DATA_SUNRISE = "sunrise"; public static final String WEATHER_DATA_SUNSET = "sunset"; /** * Widget action constants */ public static final String ACTION_FORCED_APPWIDGET_UPDATE = "org.asdtm.goodweather.action.FORCED_APPWIDGET_UPDATE"; /** * URIs constants */ public static final String GOOGLE_PLAY_APP_URI = "market://details?id=%s"; public static final String GOOGLE_PLAY_WEB_URI = "http://play.google.com/store/apps/details?id=%s"; public static final String F_DROID_WEB_URI = "https://f-droid.org/repository/browse/?fdid=%s"; public static final String WEATHER_ENDPOINT = "http://api.openweathermap.org/data/2.5/weather"; public static final String WEATHER_FORECAST_ENDPOINT = "http://api.openweathermap.org/data/2.5/forecast/daily"; public static final int PARSE_RESULT_SUCCESS = 0; public static final int TASK_RESULT_ERROR = -1; public static final int PARSE_RESULT_ERROR = -2; }
[ "sudhakar.r08@gmail.com" ]
sudhakar.r08@gmail.com
618d5c667ca069489b98e5d9a997aefc6f11cf3f
a3ceb4b4dc0cfb57c742c460d5dcb6c30e238fe6
/src/main/java/br/com/anteros/persistence/metadata/annotation/type/ReturnType.java
8be5d8e10b8831de74ac2b40eaa0ecd2da3f9829
[]
no_license
anterostecnologia/anterospersistencecore
40ea6d334c3161b39a5a53421c29a8272315cc5b
39fec71be92379dd9b4a1aea7abef3f400f89f52
refs/heads/master
2023-04-05T00:17:28.040989
2023-03-30T23:27:23
2023-03-30T23:27:23
56,242,755
1
1
null
2023-08-24T20:26:32
2016-04-14T14:10:07
Java
UTF-8
Java
false
false
862
java
/******************************************************************************* * Copyright 2012 Anteros Tecnologia * * 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 br.com.anteros.persistence.metadata.annotation.type; public enum ReturnType { FALSE, TRUE; }
[ "edsonmartins2005@gmail.com" ]
edsonmartins2005@gmail.com
f1fe9a429c2f5040f708a6d8b31ae6f9692d6c8d
7a7e7c1152ab3b44d06bc299f8238977350139c6
/app/src/main/java/com/hoyaok2/bestbuddy/Mypage_favor.java
add6e517b8a6f765e72e6073cb9d36eabd3b301e
[]
no_license
tnswh9107/BestBuddy
fffa1cec0acf04fa50f61f6500f36b5372a038dc
bdd2247bac44db9d83358dd945196273ac8bf7db
refs/heads/master
2023-08-03T14:29:45.073902
2021-09-07T12:26:33
2021-09-07T12:26:33
397,173,173
0
0
null
null
null
null
UTF-8
Java
false
false
3,147
java
package com.hoyaok2.bestbuddy; import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.widget.Toolbar; import androidx.recyclerview.widget.RecyclerView; import android.os.Bundle; import android.view.View; import android.widget.AdapterView; import android.widget.ArrayAdapter; import android.widget.Spinner; import android.widget.TextView; import java.util.ArrayList; import retrofit2.Call; import retrofit2.Callback; import retrofit2.Response; import retrofit2.Retrofit; public class Mypage_favor extends AppCompatActivity { RecyclerView recyclerView; ArrayList<Play_item> items = new ArrayList<>(); Play_Adapter recyclerAdpter; Spinner spinner; ArrayAdapter adapter; Toolbar toolbar; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_mypage_favor); recyclerView = findViewById(R.id.favor2_recycler); recyclerAdpter = new Play_Adapter(this,items); recyclerView.setAdapter(recyclerAdpter); spinner = findViewById(R.id.favor2_spinner); toolbar=findViewById(R.id.favor2_toolbar); setSupportActionBar(toolbar); getSupportActionBar().setTitle("찜한 목록"); // adapter.setDropDownViewResource(R.layout.spinner_dropdown_item); // spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { // @Override // public void onItemSelected(AdapterView<?> parent, View view, int position, long id) { //// Toast.makeText(Mypage_Favorlist.this, ""+position, Toast.LENGTH_SHORT).show(); // // } // // @Override // public void onNothingSelected(AdapterView<?> parent) { // // } // }); } @Override protected void onResume() { super.onResume(); loadData(); } void loadData(){ Retrofit retrofit = Retrofit_Helper.getRetrofitInstanceGson(); Retrofit_Service retrofit_service = retrofit.create(Retrofit_Service.class); Call<ArrayList<Play_item>> call = retrofit_service.loadDataFromPlay(); call.enqueue(new Callback<ArrayList<Play_item>>() { @Override public void onResponse(Call<ArrayList<Play_item>> call, Response<ArrayList<Play_item>> response) { //기존데이터들 모두 제거 items.clear(); recyclerAdpter.notifyDataSetChanged(); //결과로 받아온 ArrayList<MarketItem>을 items에 추가 ArrayList<Play_item> list = response.body(); for (Play_item item : list) { items.add(0, item); recyclerAdpter.notifyItemInserted(0); } } @Override public void onFailure(Call<ArrayList<Play_item>> call, Throwable t) { // Toast.makeText(getActivity(), "error: ReviewFrag--"+t.getMessage(), Toast.LENGTH_SHORT).show(); } }); } }
[ "tnswh9107@gmail.com" ]
tnswh9107@gmail.com
7b6d45f01d5457326cfbcc30c84ed096dddcd6dd
3a4460d02723b13f8bd4f57c37655d3b48eab99a
/Server/src/main/java/kursClient/App.java
43fc9198294a24a788e9e7dd8e0aa6f2a584101a
[]
no_license
Nitropav/stipProject
24fe6e293da69bf0ece877e45000e9772c8ed49d
6b0105af088ab71ff9f9de9ae621de6f215f6ee6
refs/heads/master
2023-01-23T14:14:24.160492
2020-12-01T12:37:44
2020-12-01T12:37:44
317,536,224
0
0
null
null
null
null
UTF-8
Java
false
false
333
java
package kursClient; import kursClient.view.ServerWindow; import java.net.UnknownHostException; public class App { public static void main(String[] args) throws UnknownHostException { ServerWindow mainPage = new ServerWindow(); mainPage.setLocationRelativeTo(null); mainPage.setVisible(true); } }
[ "troshko.00@mail.ru" ]
troshko.00@mail.ru
5927ca48c94aa7794d2bac4fe9c9d4d9ba0a7f8c
448acf53b8cbbb51939fc833c2f615e385b10794
/src/main/java/com/ayantsoft/trms/pojo/Folderpath.java
6696c6320aee5d49367f0cc7c813e07b7598cfb3
[]
no_license
mrigankaayant/trms_with_paypal
2b6d68ec2e786d8c27ccedc4a71b43c2434f072e
4f6aeba32008dc5cc8512f9150e18ab07b334239
refs/heads/master
2020-03-26T21:31:27.759741
2018-08-20T09:05:12
2018-08-20T09:05:12
145,393,137
0
0
null
null
null
null
UTF-8
Java
false
false
340
java
package com.ayantsoft.trms.pojo; public class Folderpath { private String pathFor; private String path; public String getPath() { return path; } public void setPath(String path) { this.path = path; } public String getPathFor() { return pathFor; } public void setPathFor(String pathFor) { this.pathFor = pathFor; } }
[ "mriganka@ayantsoft.com" ]
mriganka@ayantsoft.com
ba2957d6358667618423399552fa44279e4141d3
ba005c6729aed08554c70f284599360a5b3f1174
/lib/selenium-server-standalone-3.4.0/org/apache/xerces/xs/XSFacet.java
a484ae95c15583e081e99272f7615264227f1160
[]
no_license
Viral-patel703/Testyourbond-aut0
f6727a6da3b1fbf69cc57aeb89e15635f09e249a
784ab7a3df33d0efbd41f3adadeda22844965a56
refs/heads/master
2020-08-09T00:27:26.261661
2017-11-07T10:12:05
2017-11-07T10:12:05
null
0
0
null
null
null
null
UTF-8
Java
false
false
420
java
package org.apache.xerces.xs; public abstract interface XSFacet extends XSObject { public abstract short getFacetKind(); public abstract String getLexicalFacetValue(); public abstract int getIntFacetValue(); public abstract Object getActualFacetValue(); public abstract boolean getFixed(); public abstract XSAnnotation getAnnotation(); public abstract XSObjectList getAnnotations(); }
[ "VIRUS-inside@users.noreply.github.com" ]
VIRUS-inside@users.noreply.github.com
1c85d926736034ca70f4899ffecf5b6344a31741
5fba776ed4cc45eec416315186ebd3df8860db87
/src/main/java/br/ufpe/cin/dsoa/api/qos/AttributeAlreadyCatalogedException.java
e9d7be219cf334044c5aba9a01d9598e39aa5fd1
[]
no_license
dsoa-team/dsoa-qos
cdcb74da95141b594791444f6b7e28a3a96d4bea
28f02558e671a38c3164fc7fcffe7a86ce4f859b
refs/heads/master
2021-01-10T12:20:31.434698
2015-10-17T22:29:12
2015-10-17T22:29:12
44,456,709
0
0
null
null
null
null
UTF-8
Java
false
false
410
java
package br.ufpe.cin.dsoa.api.qos; public class AttributeAlreadyCatalogedException extends Exception { private static final long serialVersionUID = 6776265526239640428L; private static final String ERROR_MSG = "Attribute already cataloged: %s.%s"; public AttributeAlreadyCatalogedException(Attribute attribute) { super(String.format(ERROR_MSG, attribute.getCategory(), attribute.getName())); } }
[ "fabio.nogueira.souza@gmail.com" ]
fabio.nogueira.souza@gmail.com
6212fe639eba6fe168beceba7638c7beaa78ea50
db6f0dddb710f5211194bdff83897f2fe0edce2e
/.svn/pristine/62/6212fe639eba6fe168beceba7638c7beaa78ea50.svn-base
694d5026d55952d570143abc6961aa92dc5877d6
[]
no_license
xiaoyangzhang/doctor
69c71a2c3088a401f849006d627c0d6ccef3fd11
a6e33bd274fcd260133033a5b72134ccc290d0cc
refs/heads/master
2021-05-11T05:31:00.569848
2018-01-19T01:18:04
2018-01-19T01:18:04
117,961,953
0
0
null
null
null
null
UTF-8
Java
false
false
2,779
package com.yhyt.health.service.api; import com.yhyt.health.model.*; import com.yhyt.health.model.vo.app.PatientAppVO; import com.yhyt.health.result.AppResult; import java.util.List; public interface DoctorApi { AppResult addDoctorDisease(DoctorDisease doctorDisease); AppResult getDoctorReviewInfo(long id); AppResult addDoctorReview(String token, DoctorReview doctorReview); AppResult updateDoctor(String token, Doctor doctor, String safeCode, String verificationCode); AppResult queryDoctorById(long id); /** * 发起预约 * * @param dialogAppointment * @return */ AppResult addAppointment(DialogAppointment dialogAppointment); AppResult updateAppointment(DialogAppointment dialogAppointment); /** * 获取预约列表 * * @param dialogId * @return */ AppResult queryAppointmentList(long dialogId); /** * 获取转诊列表 * * @param dialogId * @return */ AppResult queryAppointmentTransferList(long dialogId); AppResult createAppointmentTransfer(DialogAppointmentTransfer dialogAppointmentTransfer); AppResult updateAppointmentTransfer(DialogAppointmentTransfer dialogAppointmentTransfer); /** * 获取科室下医生列表 * * @param deptId * @return */ AppResult queryDoctorsByDeptId(long deptId); AppResult queryDeptOrDoctorOrDisease(String keyWord, int type); /** * 验证旧手机号的验证码 * * @return */ AppResult verifyOldPhone(String token, String username, String verificationCode); AppResult udpateDoctorStrogpoint(String token, Doctor doctor); AppResult queryDoctorByUserName(String token, Doctor doctor); /** * 获取工作站处理中患者列表 * * @param deptId * @return */ List<PatientAppVO> getDealingDiagnoseList(long deptId,Integer page,Integer pageSize); /** * 获取工作站已拒绝患者列表 * * @param deptId * @return */ List<PatientAppVO> getRefusedDiagnoseList(long deptId,Integer page,Integer pageSize); /** * 添加诊断记录 * * @param patientDiagnoseRecords * @return */ AppResult addDiagnoseRecords(PatientDiagnoseRecords patientDiagnoseRecords, long deptId, long patientId); AppResult logout(String token, Device device, Long userId); /** * 医生关注患者 * @param token * @param doctorCare * @return */ AppResult doctorCarePatient(String token, DoctorCare doctorCare); /** * 验证token * @param token * @return */ String checkToken(String token); // SysUpgrade isUpgrade(String appVersion,Byte clientType,String appType); }
[ "xiaoyangzhang1990@163.com" ]
xiaoyangzhang1990@163.com
277a2f16948be6d64f9bba48c25a975180078686
53f0c4e66282550a76d86834b9cad282f6a62507
/labs/lab08/ex1a/BankAccountImpl.java
98de51f658f7cd7bc7dc1b540f90299c85559131
[]
no_license
ritamf/PDS-Portfolio
d7e5393c1500fbcafc24d18272aa8961f99051b7
09b2fb47daf455300161d88fc3a839cf0d36aabe
refs/heads/main
2023-07-13T23:32:56.891970
2021-08-10T13:25:45
2021-08-10T13:25:45
394,663,428
0
0
null
null
null
null
UTF-8
Java
false
false
620
java
class BankAccountImpl implements BankAccount { private String bank; private double balance; BankAccountImpl(String bank, double initialDeposit) { this.bank = bank; balance = initialDeposit; } public String getBank() { return bank; } @Override public void deposit(double amount) { balance += amount; } @Override public boolean withdraw(double amount) { if (amount > balance) return false; balance -= amount; return true; } @Override public double balance() { return balance; } }
[ "ritaferrolho@ua.pt" ]
ritaferrolho@ua.pt
49c102628d3493d68e67128811fb1bc264aa23c5
d2e7fdb994a3b4255280589b222278fc1d0f4d9c
/app2/src/main/java/com/example/picklh/examples/fragment/TimePickerFragment.java
a20bec9212f5c15b7a61b2966c7bff27624c295d
[]
no_license
caribbean-hy/Examples
f4d81d389c1d7fe965bef4e412ba9acddb835fe7
d7dabcdded7e04b920b0112d529468c08b564f32
refs/heads/master
2021-03-27T10:10:29.179752
2015-03-18T06:47:17
2015-03-18T06:47:17
32,440,388
0
0
null
null
null
null
UTF-8
Java
false
false
1,050
java
package com.example.picklh.examples.fragment; import android.app.Dialog; import android.app.DialogFragment; import android.app.TimePickerDialog; import android.os.Bundle; import android.text.format.DateFormat; import android.widget.TimePicker; import android.widget.Toast; import java.util.Calendar; /** * Created by picklh on 2015/3/17. */ public class TimePickerFragment extends DialogFragment implements TimePickerDialog.OnTimeSetListener { @Override public Dialog onCreateDialog(Bundle savedInstanceState) { final Calendar calendar = Calendar.getInstance(); int hour = calendar.get(calendar.HOUR_OF_DAY); int minute = calendar.get(calendar.MINUTE); return new TimePickerDialog(getActivity(), this, hour, minute, DateFormat.is24HourFormat(getActivity())); } @Override public void onTimeSet(TimePicker timePicker, int hour, int minute) { Toast.makeText(getActivity().getApplicationContext(), "您选择的时间为 " + hour + ":" + minute + "", Toast.LENGTH_SHORT).show(); } }
[ "butterfly_hy@163.com" ]
butterfly_hy@163.com
a7c79dd239cbf6e47457fefbb89f3769c80069f0
c474b03758be154e43758220e47b3403eb7fc1fc
/apk/decompiled/com.tinder_2018-07-26_source_from_JADX/sources/com/google/android/gms/internal/afr.java
b0b95025d349c7e908fdd664734aebbe954c9010
[]
no_license
EstebanDalelR/tinderAnalysis
f80fe1f43b3b9dba283b5db1781189a0dd592c24
941e2c634c40e5dbf5585c6876ef33f2a578b65c
refs/heads/master
2020-04-04T09:03:32.659099
2018-11-23T20:41:28
2018-11-23T20:41:28
155,805,042
0
0
null
2018-11-18T16:02:45
2018-11-02T02:44:34
null
UTF-8
Java
false
false
2,536
java
package com.google.android.gms.internal; import android.content.Context; import com.google.android.gms.ads.internal.ar; import com.google.android.gms.ads.internal.gmsg.ab; import com.google.android.gms.ads.internal.gmsg.zzt; import com.google.android.gms.ads.internal.js.C2388t; import com.google.android.gms.ads.internal.js.C4272a; import com.google.android.gms.ads.internal.js.zzaj; import org.json.JSONObject; @zzzv public final class afr implements zzgo { /* renamed from: a */ private final afe f22918a; /* renamed from: b */ private final Context f22919b; /* renamed from: c */ private final ab f22920c; /* renamed from: d */ private C4272a f22921d; /* renamed from: e */ private boolean f22922e; /* renamed from: f */ private final zzt<zzaj> f22923f = new afw(this); /* renamed from: g */ private final zzt<zzaj> f22924g = new afx(this); /* renamed from: h */ private final zzt<zzaj> f22925h = new afy(this); /* renamed from: i */ private final zzt<zzaj> f22926i = new afz(this); public afr(afe afe, C2388t c2388t, Context context) { this.f22918a = afe; this.f22919b = context; this.f22920c = new ab(this.f22919b); this.f22921d = c2388t.b(null); this.f22921d.zza(new afs(this), new aft(this)); String str = "Core JS tracking ad unit: "; String valueOf = String.valueOf(this.f22918a.f15127a.m19074d()); hx.m19911b(valueOf.length() != 0 ? str.concat(valueOf) : new String(str)); } /* renamed from: a */ final void m27082a(zzaj zzaj) { zzaj.zza("/updateActiveView", this.f22923f); zzaj.zza("/untrackActiveViewUnit", this.f22924g); zzaj.zza("/visibilityChanged", this.f22925h); if (ar.z().m19598a(this.f22919b)) { zzaj.zza("/logScionEvent", this.f22926i); } } /* renamed from: b */ final void m27083b(zzaj zzaj) { zzaj.zzb("/visibilityChanged", this.f22925h); zzaj.zzb("/untrackActiveViewUnit", this.f22924g); zzaj.zzb("/updateActiveView", this.f22923f); if (ar.z().m19598a(this.f22919b)) { zzaj.zzb("/logScionEvent", this.f22926i); } } public final void zzb(JSONObject jSONObject, boolean z) { this.f22921d.zza(new afu(this, jSONObject), new iy()); } public final boolean zzgg() { return this.f22922e; } public final void zzgh() { this.f22921d.zza(new afv(this), new iy()); this.f22921d.a(); } }
[ "jdguzmans@hotmail.com" ]
jdguzmans@hotmail.com
05e286099fc1852eab7f722f3e9e5621104cbd9d
f90c4aff0c6ffc95fb6598dcb1cf08a3fd36f40a
/src/main/java/vo/logistics/LogisticsSnapVO.java
1ead0b0caa3ababa8897fd1c1ed9637729bf9921
[]
no_license
software-homework/software-engineering
2d2f0399919f640375140cff283fe0ddcfa5a49a
245dc900e538e954312b5f60c15c6655ddc6f772
refs/heads/master
2021-01-10T03:33:23.296704
2015-12-19T13:54:17
2015-12-19T13:54:17
43,810,460
0
1
null
null
null
null
UTF-8
Java
false
false
538
java
package vo.logistics; public class LogisticsSnapVO { public String name; public String model; public int number; public double average; public String batch; public String batchNumber; public String outTime; public int row; public LogisticsSnapVO(){ } public LogisticsSnapVO(int row,String commodityname,String model,int number,double average,String batch){ this.name=commodityname; this.model=model; this.number=number; this.average=average; this.batch=batch; this.row=row; } }
[ "mf1532098@software.nju.edu.cn" ]
mf1532098@software.nju.edu.cn
64685f6afdabc5350cbfc10dd9ab6ff475219ea3
0a75150ed7719cdb78649dd360ac4d8f48a0c534
/src/com/dsalglc/tree/Postorder.java
05f0e57ebd8c917a0790ab1171d73ae994f58d8f
[]
no_license
fusuiyi123/data-structure-algorithm
e25b0d89885a068e217556346a8a263f1db8f6f3
adaf02e3368b100219cb33a86df1a79b09ae3f62
refs/heads/master
2020-04-16T22:22:31.586659
2019-03-04T00:13:32
2019-03-04T00:13:32
165,965,043
1
0
null
null
null
null
UTF-8
Java
false
false
752
java
package com.dsalglc.tree; import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Stack; // 145. Binary Tree Postorder Traversal public class Postorder { public List<Integer> postorderTraversal(TreeNode root) { ArrayList<Integer> res = new ArrayList<>(); if (root == null) return res; Stack<TreeNode> stack = new Stack<>(); stack.push(root); while (!stack.isEmpty()) { TreeNode node = stack.pop(); res.add(node.val); if (node.left != null) stack.push(node.left); if (node.right != null) stack.push(node.right); } Collections.reverse(res); return res; } }
[ "fusuiyi123@gmail.com" ]
fusuiyi123@gmail.com
1c2271cd6b5ab2da6ea2930082961dbe39545e22
2c76e701f0da53c0661926fc43f6fa18f054a81b
/android/app/src/main/java/com/realmexampleapplication/MainApplication.java
eddd1176684726a9fd9defba05b9d7faf2d60274
[]
no_license
BullBens/RealmExampleApplication
ffa144de4a46530781ab43b66fcb75266491971c
a84a1d1c6eec7baf6de6a4a7ba916e95953c8f05
refs/heads/master
2022-11-25T12:46:14.202008
2020-08-05T07:53:34
2020-08-05T07:53:34
273,191,419
0
0
null
null
null
null
UTF-8
Java
false
false
2,629
java
package com.realmexampleapplication; import android.app.Application; import android.content.Context; import com.facebook.react.PackageList; import com.facebook.react.ReactApplication; import com.facebook.react.ReactInstanceManager; import com.facebook.react.ReactNativeHost; import com.facebook.react.ReactPackage; import com.facebook.soloader.SoLoader; import java.lang.reflect.InvocationTargetException; import java.util.List; public class MainApplication extends Application implements ReactApplication { private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) { @Override public boolean getUseDeveloperSupport() { return BuildConfig.DEBUG; } @Override protected List<ReactPackage> getPackages() { @SuppressWarnings("UnnecessaryLocalVariable") List<ReactPackage> packages = new PackageList(this).getPackages(); // Packages that cannot be autolinked yet can be added manually here, for example: // packages.add(new MyReactNativePackage()); return packages; } @Override protected String getJSMainModuleName() { return "index"; } }; @Override public ReactNativeHost getReactNativeHost() { return mReactNativeHost; } @Override public void onCreate() { super.onCreate(); SoLoader.init(this, /* native exopackage */ false); initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); } /** * Loads Flipper in React Native templates. Call this in the onCreate method with something like * initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); * * @param context * @param reactInstanceManager */ private static void initializeFlipper( Context context, ReactInstanceManager reactInstanceManager) { if (BuildConfig.DEBUG) { try { /* We use reflection here to pick up the class that initializes Flipper, since Flipper library is not available in release mode */ Class<?> aClass = Class.forName("com.realmexampleapplication.ReactNativeFlipper"); aClass .getMethod("initializeFlipper", Context.class, ReactInstanceManager.class) .invoke(null, context, reactInstanceManager); } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (NoSuchMethodException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } catch (InvocationTargetException e) { e.printStackTrace(); } } } }
[ "a.afanaskiy@artjoker.team" ]
a.afanaskiy@artjoker.team
03a8a7618398e3aeaa96b6b29fce29ce3b6c12a7
931afc6e53b97ed3ea5a6dc933bb28de20d3410a
/system-management9091/src/main/java/com/cykj/controller/PortalController.java
2b20f87bba952d560bb54d983e7d77a0fa9001d1
[]
no_license
s3n0595/software-outsourcing
e393ce5fcc896fbedd06b7e156aafa6981a4554d
be0aeb2b08322accb84f1aaf2b8100a2d9773a70
refs/heads/master
2023-07-16T01:49:03.366474
2021-08-17T18:37:25
2021-08-17T18:37:25
388,806,618
0
2
null
2021-08-17T18:37:25
2021-07-23T13:14:00
Vue
UTF-8
Java
false
false
6,114
java
package com.cykj.controller; import com.cykj.bean.CommonResult; import com.cykj.bean.TradeRecord; import com.cykj.bean.TradeWork; import com.cykj.bean.Works; import com.cykj.service.PortalService; import com.cykj.vo.WeeksData; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import javax.annotation.Resource; import java.text.DecimalFormat; import java.util.ArrayList; import java.util.List; /** * @author guoquansen * @date 2021/8/12 10:46 上午 */ @Controller @RequestMapping("/portal") @Slf4j public class PortalController { @Resource private PortalService portalService; //查询所有成功案例 @RequestMapping("/caseList") @ResponseBody public CommonResult querySuccessCase() { log.info("******成功案例查询中******"); List<TradeWork> allSuccessCase = portalService.queryAllSuccessCase(); return new CommonResult(200,"案例查询成功",allSuccessCase); } //更改案例显示状态 @RequestMapping("/showCase") @ResponseBody public CommonResult showCase(int tradeWorksId, int showCase) { log.info("******更改案例显示状态中******"); int i = portalService.showCase(tradeWorksId, showCase); if (i > 0) { return new CommonResult(200,"状态更改成功",null); } else { return new CommonResult(400,"状态更改失败",null); } } //根据显示状态查询 @RequestMapping("/isShow") @ResponseBody public CommonResult isShow(int showCase) { log.info("******显示状态查询中******"); List<TradeWork> isShowList = portalService.queryIsShow(showCase); return new CommonResult(200,"显示状态列表查询成功",isShowList); } //批量删除案例 @RequestMapping("/deleteCase") @ResponseBody public CommonResult deleteCase(int[] tradeWorksIds) { log.info("******批量删除中******"); for(int tradeWorksId: tradeWorksIds) { portalService.deleteCase(tradeWorksId); } return new CommonResult(200,"批量删除成功",null); } //根据关键词获取作品id @RequestMapping("/searchCase") @ResponseBody public CommonResult queryWorksIdByTitle(String worksTitle) { log.info("******关键词******"+worksTitle); List<TradeWork> tradeWorkList = new ArrayList<>(); List<Works> works = portalService.queryWorksIdByTitle(worksTitle); log.info("******作品******"+works); for (Works work : works) { TradeWork tradeWork = portalService.querySearchById(work.getWorksId()); if (tradeWork != null) { tradeWorkList.add(tradeWork); } } log.info("******查出来结果结合作品******"+tradeWorkList); return new CommonResult(200,"显示状态列表查询成功",tradeWorkList); } //获取web网站作品数量 @RequestMapping("/web") @ResponseBody public CommonResult queryWeb() { double web = portalService.queryWeb(); double total = portalService.queryTotal(); int webPer = (int) ((web/total)*100); log.info("*******webPer"+webPer); return new CommonResult(200,"web网站数量",webPer); } //获取app网站作品数量 @RequestMapping("/app") @ResponseBody public CommonResult queryApp() { double app = portalService.queryApp(); double total = portalService.queryTotal(); int appPer = (int) ((app/total)*100); log.info("*******appPer"+appPer); return new CommonResult(200,"app网站数量",appPer); } //获取微信网站作品数量 @RequestMapping("/weChat") @ResponseBody public CommonResult queryWeChat() { double weChat = portalService.queryWeChat(); double total = portalService.queryTotal(); int weChatPer = (int) ((weChat/total)*100); log.info("*******weChatPer"+weChatPer); return new CommonResult(200,"weChat网站数量",weChatPer); } //获取html网站作品数量 @RequestMapping("/html") @ResponseBody public CommonResult queryHtml() { double html = portalService.queryHtml(); double total = portalService.queryTotal(); int htmlPer = (int) ((html/total)*100); log.info("*******htmlPer"+htmlPer); return new CommonResult(200,"html网站数量",htmlPer); } //获取applet网站作品数量 @RequestMapping("/applet") @ResponseBody public CommonResult queryApplet() { double applet = portalService.queryApplet(); double total = portalService.queryTotal(); int appletPer = (int) ((applet/total)*100); log.info("*******applet"+applet); return new CommonResult(200,"applet网站数量",appletPer); } //获取other网站作品数量 @RequestMapping("/other") @ResponseBody public CommonResult queryOther() { double other = portalService.queryOther(); double total = portalService.queryTotal(); int otherPer = (int) ((other/total)*100); log.info("*******otherPer"+otherPer); return new CommonResult(200,"other网站数量",otherPer); } //获取网站作品数量 @RequestMapping("/total") @ResponseBody public CommonResult queryTotal() { int total = portalService.queryTotal(); return new CommonResult(200,"other网站数量",total); } //获取网站作品数量 @RequestMapping("/week") @ResponseBody public CommonResult queryWeekData() { List<WeeksData> weeksDataList = portalService.queryWeekData(); ArrayList<Object> weeksList = new ArrayList<>(); for (WeeksData weeksData : weeksDataList) { log.warn("weekData"+weeksData.getCount()); weeksList.add(weeksData.getCount()); } return new CommonResult(200,"weekData网站数量",weeksList); } }
[ "gqs616667914@gmail.com" ]
gqs616667914@gmail.com
4b9cfede94a51cc97e6308da27c30f9289bf939c
46a9d1c512bfc506d8df4cef4ff6e0e72a9c459b
/src/main/java/com/stormpath/ozorkauth/config/SpringSecurityWebAppConfig.java
d820d9e98dc1fff5d9f0c7cb77dfb7bca4c4acb3
[]
no_license
dogeared/OZorkAuth
5cfdc6928a49fc9f4a0b0fc6a293010275220c70
10cd9a6032ff87575d1ff7c81145a7e494175584
refs/heads/master
2021-01-01T05:21:57.721506
2016-10-11T22:02:56
2016-10-11T22:02:56
57,869,116
88
6
null
null
null
null
UTF-8
Java
false
false
1,492
java
/* * Copyright 2016 Stormpath, 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.stormpath.ozorkauth.config; import org.springframework.context.annotation.Configuration; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; import static com.stormpath.spring.config.StormpathWebSecurityConfigurer.stormpath; @Configuration public class SpringSecurityWebAppConfig extends WebSecurityConfigurerAdapter { @Override protected void configure(HttpSecurity http) throws Exception { http .apply(stormpath()).and() .authorizeRequests() .antMatchers("/").permitAll() .antMatchers("/v1/instructions").permitAll() .antMatchers("/v1/r").permitAll().and() .csrf().ignoringAntMatchers("/v1/c").and() .csrf().ignoringAntMatchers("/v1/r"); } }
[ "micah@afitnerd.com" ]
micah@afitnerd.com
7bf6a10e9c858c9cc106a0267bee8bb3a8ac0307
3d0b168c5333cde4b1609b6cdf2870a459a71b68
/src/test/java/com/cybertek/utilities/FailPassContains.java
563424fd87cd865f08f31bb5bb709060f8a8a028
[]
no_license
YusufKucukvatan/SeleniumBasics
1383f1dc0e0a7c6eb4cf0741834b833cdbe45ad1
6a2de7f956d496090243a1ceda2e8cc4c74097b8
refs/heads/master
2023-05-10T04:26:29.024814
2020-02-22T18:37:55
2020-02-22T18:37:55
217,621,163
0
0
null
2023-05-09T18:37:37
2019-10-25T22:05:37
Java
UTF-8
Java
false
false
427
java
package com.cybertek.utilities; public class FailPassContains { public static void failPass(String actual, String expected) { if (actual.toLowerCase().contains(expected.toLowerCase())) { System.out.println("PASS"); } else { System.out.println("FAIL"); System.out.println("actual = " + actual); System.out.println("expected = " + expected); } } }
[ "yusuf@kucukvatan.com" ]
yusuf@kucukvatan.com
edd5907111e315037ae2f1d53beccc67c3739a76
50237d3fcf69cc1adf2377656bf1aff297f9d3c1
/src/main/java/it/plansoft/publication/mapper/IAuthorMapper.java
2194694e65e5a8ad6e77e18aafe461128a5ef816
[ "MIT" ]
permissive
giuseppegrosso/publication
97223dbc26eaf898074723bb4c8bfc58baecbb2f
342fea0fa57111697d5967dacfacfbb4b9c3c2e8
refs/heads/main
2023-03-20T01:19:59.907304
2021-03-11T07:59:21
2021-03-11T07:59:21
345,448,991
0
1
null
null
null
null
UTF-8
Java
false
false
374
java
package it.plansoft.publication.mapper; import it.plansoft.publication.dto.AuthorDto; import it.plansoft.publication.model.Author; import org.mapstruct.Mapper; import org.mapstruct.factory.Mappers; @Mapper(componentModel = "spring") public interface IAuthorMapper extends IMapper<AuthorDto, Author> { IAuthorMapper INSTANCE = Mappers.getMapper(IAuthorMapper.class); }
[ "g.grosso@quidinfo.it" ]
g.grosso@quidinfo.it
29eb311960452818108f86e79c8827a8d007275f
85ce3a70a4bcfb824833053a2d5ab78e5870dc4d
/IdeaProjects/wms/src/main/java/cn/wolfcode/wms/service/ISupplierService.java
b6069ccb0f98b1f62e27c6075226a4ad6f6f7e74
[]
no_license
qyl1006/Hello_World
87e4aef81874cef1ddd5cd0d7278ac56c8f8bb19
be81d9e957d4e81e3d2097ac7ab9ae7ba1a620af
refs/heads/master
2020-03-08T03:14:44.053205
2018-05-18T02:31:16
2018-05-18T02:31:16
127,881,971
0
0
null
null
null
null
UTF-8
Java
false
false
412
java
package cn.wolfcode.wms.service; import cn.wolfcode.wms.domain.Supplier; import cn.wolfcode.wms.query.PageResult; import cn.wolfcode.wms.query.QueryObject; import java.util.List; public interface ISupplierService { void insertOrUpdate(Supplier entity); void deleteById(Long id); Supplier getById(Long id); List<Supplier> listAll(); //分页 PageResult queryAll(QueryObject qo); }
[ "yuelinshi@qq.com" ]
yuelinshi@qq.com
06f9ca974f2594372499fb9d9d8567a87ff929bd
c9ab3c769fbfb3392207f82eceb81dfd6093e913
/src/test/java/Basics/WebTable.java
7d005ed8430e827d2b9cc545b2c5546146451d10
[]
no_license
Prabhurbvn/Com.LearnMaven
522312b69f77d176d96cce0f764f2ac86746a423
45cb4e1eb5b301c8ed1dd0caa6c359ad7ab6ee08
refs/heads/master
2023-05-30T18:10:27.521396
2021-01-03T14:27:04
2021-01-03T14:27:04
255,231,063
0
0
null
2021-06-15T16:08:03
2020-04-13T04:29:44
HTML
UTF-8
Java
false
false
1,250
java
package Basics; import java.util.List; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.chrome.ChromeDriver; public class WebTable { public static void main(String[] args) { // TODO Auto-generated method stub System.setProperty("webdriver.chrome.driver", "C:\\Users\\GOD\\Downloads\\chrome83\\chromedriver.exe"); WebDriver driver=new ChromeDriver(); driver.get("https://money.rediff.com/gainers/bse/daily/groupa?src=gain_lose"); // single column WebElement singlecolumn=driver.findElement(By.xpath("//table[@class='dataTable']/tbody/tr[1]/td[4]")); System.out.println(singlecolumn.getText()); //single row WebElement singleRow=driver.findElement(By.xpath("//table[@class='dataTable']/tbody/tr[2]")); System.out.println(singleRow.getText()); List<WebElement> rows=driver.findElements(By.xpath("//table[@class='dataTable']/tbody/tr")); for(int i=0; i<rows.size(); i++) { List<WebElement> col=rows.get(i).findElements(By.tagName("td")); for(int j=0; j<col.size(); j++) { System.out.print(col.get(j).getText()); } System.out.println(""); } } }
[ "prabhurbvn@gmail.com" ]
prabhurbvn@gmail.com
a11b5e73088aab9b203570be1838325f6ada2c4a
9df77091226a02871ad984d9cfb375b0f7d26843
/app/src/main/java/com/example/saajan/dreamapp/RequestListActivity.java
faf73667e25db603d785674a8f28ef5de4a3e9f8
[]
no_license
tajul-saajan/DreamApp
7b4207629e141f60a467e52a2093bf5bb0e80908
1d427a75aa6b9220f680d4825535f28477d164a8
refs/heads/master
2021-06-21T11:20:31.001827
2020-12-26T07:25:54
2020-12-26T07:25:54
159,211,935
0
0
null
null
null
null
UTF-8
Java
false
false
5,008
java
package com.example.saajan.dreamapp; import android.os.Bundle; import android.support.annotation.NonNull; import android.support.v7.app.AppCompatActivity; import android.util.Log; import android.view.View; import android.widget.AdapterView; import android.widget.ExpandableListView; import com.google.firebase.database.DataSnapshot; import com.google.firebase.database.DatabaseError; import com.google.firebase.database.DatabaseReference; import com.google.firebase.database.FirebaseDatabase; import com.google.firebase.database.ValueEventListener; import java.util.ArrayList; import java.util.HashMap; public class RequestListActivity extends AppCompatActivity { ExpandableListAdapter listAdapter; ExpandableListView expListView; ArrayList<String> listDataHeader; HashMap<String, ArrayList<String>> listDataChild; DatabaseReference rootRef = FirebaseDatabase.getInstance().getReference().child("requests"); final HashMap<String, ArrayList<Request>> listRequest =new HashMap<>(); ArrayList<String> listRequestHeader =new ArrayList<>(); @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_request_list); // get the listview expListView = (ExpandableListView) findViewById(R.id.request_expander); // preparing list data prepareListData(); prepareRequestInfo(); // listAdapter = new ExpandableListAdapter(this, listDataHeader, listDataChild); // // // setting list adapter // expListView.setAdapter(listAdapter); listAdapter = new ExpandableListAdapter(this, listRequestHeader, listRequest); // setting list adapter expListView.setAdapter(listAdapter); expListView.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { Request request = (Request) parent.getItemAtPosition(position); } }); } /* * Preparing the list data */ private void prepareListData() { listDataHeader = new ArrayList<String>(); listDataChild = new HashMap<String, ArrayList<String>>(); // Adding child data listDataHeader.add("Top 250"); listDataHeader.add("Now Showing"); listDataHeader.add("Coming Soon.."); // Adding child data ArrayList<String> top250 = new ArrayList<String>(); top250.add("The Shawshank Redemption"); top250.add("The Godfather"); top250.add("The Godfather: Part II"); top250.add("Pulp Fiction"); top250.add("The Good, the Bad and the Ugly"); top250.add("The Dark Knight"); top250.add("12 Angry Men"); ArrayList<String> nowShowing = new ArrayList<String>(); nowShowing.add("The Conjuring"); nowShowing.add("Despicable Me 2"); nowShowing.add("Turbo"); nowShowing.add("Grown Ups 2"); nowShowing.add("Red 2"); nowShowing.add("The Wolverine"); ArrayList<String> comingSoon = new ArrayList<String>(); comingSoon.add("2 Guns"); comingSoon.add("The Smurfs 2"); comingSoon.add("The Spectacular Now"); comingSoon.add("The Canyons"); comingSoon.add("Europa Report"); listDataChild.put(listDataHeader.get(0), top250); // Header, Child data listDataChild.put(listDataHeader.get(1), nowShowing); listDataChild.put(listDataHeader.get(2), comingSoon); } private void prepareRequestInfo() { rootRef.addListenerForSingleValueEvent(new ValueEventListener() { @Override public void onDataChange(@NonNull DataSnapshot dataSnapshot) { for (DataSnapshot mDataSnapshot : dataSnapshot.getChildren()) { Log.e("Update", "=======" + mDataSnapshot.getKey()); String date = mDataSnapshot.getKey(); listRequest.put(date,new ArrayList<Request>()); listRequestHeader.add(date); // Log.e("----", "======="+mDataSnapshot.child("roll").getValue()); //st.add(mDataSnapshot.getValue(Donor.class)); // Donor donor = mDataSnapshot.getValue(Donor.class); // String bloodGrp = donor.getBloodGroup(); // donorList.get(bloodGrp).add(donor); for (DataSnapshot childDataSnapshot : mDataSnapshot.getChildren()) { Log.e("Update", "=======" + childDataSnapshot.getValue()); Request request= childDataSnapshot.getValue(Request.class); listRequest.get(date).add(request); } } } @Override public void onCancelled(@NonNull DatabaseError databaseError) { } }); } }
[ "tajul.saajan@gmail.com" ]
tajul.saajan@gmail.com
a25f7498c113da4695a4ab6a2fa35953c7befd2e
eb5a128582a339ae1ffa7ff2afca22265feb97a2
/app/src/main/java/com/dongzhex/fragments_main/ViewResourceFragment.java
259b902ef409af9742d5d84a3bd1c64f461d5a0b
[]
no_license
dongZheX/InfoSystem
0101b81998504e62c95edbaa0b0c0fdcd4e3e0bf
01a501f3c6da8493902e188257f6147c1da95709
refs/heads/master
2020-03-09T06:18:44.408245
2018-05-29T14:43:12
2018-05-29T14:43:12
128,635,919
1
0
null
null
null
null
UTF-8
Java
false
false
2,209
java
package com.dongzhex.fragments_main; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v4.app.Fragment; import android.support.v4.widget.SwipeRefreshLayout; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import com.dongzhex.AdapterPack.ResourceAdapter; import com.dongzhex.entity.ResourceData; import com.dongzhex.someactivities.infosystem.R; import java.util.ArrayList; import java.util.List; /** * Created by ASUS on 2018/4/13. */ public class ViewResourceFragment extends Fragment { private List<ResourceData> mlist; private SwipeRefreshLayout swipeRefreshLayout; @Nullable @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { TextView title_main = (TextView) getActivity().findViewById(R.id.main_Title); View view = inflater.inflate(R.layout.resource_entry_layout,container,false); initList(); RecyclerView recyclerView = (RecyclerView)view.findViewById(R.id.resource_recycler); recyclerView.setLayoutManager(new LinearLayoutManager(view.getContext())); ResourceAdapter resourceAdapter = new ResourceAdapter(mlist); recyclerView.setAdapter(resourceAdapter); return view; } public void initList(){ mlist = new ArrayList<ResourceData>(); mlist.add(new ResourceData("校园信息化门户","https://portal.wh.sdu.edu.cn",R.drawable.shandongdaxue)); mlist.add(new ResourceData("W3School","http://www.w3school.com.cn/",R.drawable.html)); mlist.add(new ResourceData("CSDN","www.csdn.net",R.drawable.html)); mlist.add(new ResourceData("80S","https://www.80s.tw/",R.drawable.html)); mlist.add(new ResourceData("山东大学(威海)","https://www.wh.sdu.edu.cn/",R.drawable.html)); mlist.add(new ResourceData("BCC","https://edition.cnn.com/",R.drawable.html)); mlist.add(new ResourceData("github","https://github.com/",R.drawable.html)); } }
[ "ncxxdz@126.com" ]
ncxxdz@126.com
d0258e3fe11df9dd132f97e60aa1cc8a35f32405
8c334c3365428b4c5ea88a3b084a67302f484103
/preference/src/test/java/org/streameps/test/TestDeciderListener.java
b85a65b8f47e65fa9a68449f42dae224a3a9b736
[ "BSD-3-Clause" ]
permissive
fanhubgt/StreamEPS
9d2835b54dee43253a78e8faa6bdeed149d4c856
ea8f9cd03755315e34301a50fdbfe9a30b59077f
refs/heads/master
2023-04-27T11:02:26.538584
2020-11-17T14:08:20
2020-11-17T14:08:20
1,288,135
0
0
NOASSERTION
2023-04-14T17:08:44
2011-01-24T15:54:57
Java
UTF-8
Java
false
false
2,936
java
/* * ==================================================================== * StreamEPS Platform * * (C) Copyright 2011. * * Distributed under the Modified BSD License. * Copyright notice: The copyright for this software and a full listing * of individual contributors are as shown in the packaged copyright.txt * file. * 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 ORGANIZATION 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. * * ============================================================================= */ package org.streameps.test; import org.streameps.core.IMatchedEventSet; import org.streameps.core.TestEvent; import org.streameps.decider.IDeciderContextListener; import org.streameps.engine.IDeciderContext; /** * * @author Frank Appiah */ public class TestDeciderListener implements IDeciderContextListener{ public void onDeciderReceive(IDeciderContext<IMatchedEventSet> context) { System.out.println("============================="); System.out.println("Decider Listener"); for (Object event : context.getDeciderValue()) { TestEvent testEvent=(TestEvent) event; System.out.println("Name:" + testEvent.getName() + "=====Value:" + testEvent.getValue()); } } public String getIdentifier() { throw new UnsupportedOperationException("Not supported yet."); } public void setIdentifier(String identifier) { throw new UnsupportedOperationException("Not supported yet."); } }
[ "appiahnsiahfrank@gmail.com" ]
appiahnsiahfrank@gmail.com
f4e5e6b59cdc442003db9eadce93dc79c0a88975
94ab5e8f7ed571244689562249bfa1f3e8136028
/src/main/java/alex/buffer/visual/KeyStateHandler.java
6548eb1fe10919d97af65d50422a20f64ae4d413
[]
no_license
AlexMcKinney/BufferStuffer
49726bff0755c3b359baf891499de510a6a78657
023017ec5b676af37aeefb94e4c3d7a2ac9fd343
refs/heads/master
2023-01-13T13:25:08.067866
2020-11-15T18:03:35
2020-11-15T18:03:35
313,081,295
0
0
null
null
null
null
UTF-8
Java
false
false
307
java
package alex.buffer.visual; import java.util.HashMap; import java.util.Map; public class KeyStateHandler { protected Map<String, Boolean> keyMap = new HashMap<String, Boolean>(); protected KeyTypeListener listener; public KeyStateHandler(KeyTypeListener listener){ this.listener = listener; } }
[ "raining_ducks@msn.com" ]
raining_ducks@msn.com
aa6606f582b061f091dd1c6d4eb96b2b36d7d165
647ec12ce50f06e7380fdbfb5b71e9e2d1ac03b4
/com.tencent.mm/classes.jar/com/tencent/mm/plugin/game/luggage/b/p.java
d6c0613676f56b297ccd5ae75f4e4116faf0bc33
[]
no_license
tsuzcx/qq_apk
0d5e792c3c7351ab781957bac465c55c505caf61
afe46ef5640d0ba6850cdefd3c11badbd725a3f6
refs/heads/main
2022-07-02T10:32:11.651957
2022-02-01T12:41:38
2022-02-01T12:41:38
453,860,108
36
9
null
2022-01-31T09:46:26
2022-01-31T02:43:22
Java
UTF-8
Java
false
false
4,803
java
package com.tencent.mm.plugin.game.luggage.b; import android.content.Context; import com.tencent.luggage.d.b; import com.tencent.matrix.trace.core.AppMethodBeat; import com.tencent.mm.plugin.game.luggage.page.GameWebPage; import com.tencent.mm.plugin.webview.luggage.jsapi.bv.a; import com.tencent.mm.plugin.webview.luggage.jsapi.bw; import com.tencent.mm.sdk.platformtools.Log; import com.tencent.mm.sdk.platformtools.WeChatEnvironment; import org.json.JSONException; import org.json.JSONObject; public class p extends bw<GameWebPage> { public final void a(Context paramContext, String paramString, bv.a parama) { AppMethodBeat.i(277145); paramContext = new JSONObject(); try { paramString = com.tencent.mm.plugin.webview.luggage.c.c.ZL(paramString); if ((paramString == null) || (!paramString.has("appId"))) { Log.w("MicroMsg.JsApiGetLiteAppSwitch", "invalid appId"); paramContext.put("switch", false); parama.j(null, paramContext); AppMethodBeat.o(277145); return; } localObject = paramString.getString("appId"); bool3 = ((com.tencent.mm.plugin.lite.api.c)com.tencent.mm.kernel.h.ax(com.tencent.mm.plugin.lite.api.c.class)).aJT((String)localObject); if (WeChatEnvironment.isCoolassistEnv()) { break label453; } if (!bool3) { break label404; } } catch (JSONException paramString) { for (;;) { Object localObject; boolean bool3; StringBuilder localStringBuilder; int i; label285: label307: Log.printErrStackTrace("MicroMsg.JsApiGetLiteAppSwitch", paramString, "", new Object[0]); label404: label416: label422: continue; continue; boolean bool2 = true; continue; boolean bool1 = true; } } Log.i("MicroMsg.JsApiGetLiteAppSwitch", "isLiteAppCanOpen value: %s", new Object[] { Boolean.valueOf(bool3) }); if ((paramString != null) && (paramString.has("needPkg"))) { bool2 = paramString.getBoolean("needPkg"); paramString = ((com.tencent.mm.plugin.lite.api.c)com.tencent.mm.kernel.h.ax(com.tencent.mm.plugin.lite.api.c.class)).et((String)localObject); com.tencent.mm.plugin.report.service.h.OAn.p(1293L, 80L, 1L); if (bool1) { com.tencent.mm.plugin.report.service.h.OAn.p(1293L, 81L, 1L); if (paramString == null) { if (((com.tencent.mm.plugin.lite.api.c)com.tencent.mm.kernel.h.ax(com.tencent.mm.plugin.lite.api.c.class)).fTU() == null) { ((com.tencent.mm.plugin.lite.api.c)com.tencent.mm.kernel.h.ax(com.tencent.mm.plugin.lite.api.c.class)).fTS(); } ((com.tencent.mm.plugin.lite.api.c)com.tencent.mm.kernel.h.ax(com.tencent.mm.plugin.lite.api.c.class)).a((String)localObject, null); if (bool2) { com.tencent.mm.plugin.report.service.h.OAn.p(1293L, 82L, 1L); bool1 = false; localStringBuilder = new StringBuilder(); localObject = localStringBuilder.append((String)localObject).append(","); if (bool2) { i = 1; localObject = ((StringBuilder)localObject).append(i).append(","); if (!bool1) { break label416; } i = 1; ((StringBuilder)localObject).append(i); com.tencent.mm.plugin.report.service.h.OAn.kvStat(20982, localStringBuilder.toString()); localStringBuilder = new StringBuilder("debug:false, coolassist:").append(WeChatEnvironment.isCoolassistEnv()).append(", enable:").append(bool3).append(",info:"); if (paramString != null) { break label422; } } for (bool2 = true;; bool2 = false) { Log.i("MicroMsg.JsApiGetLiteAppSwitch", bool2); paramContext.put("switch", bool1); parama.j(null, paramContext); AppMethodBeat.o(277145); return; bool1 = false; break; i = 0; break label285; i = 0; break label307; } } } } } } public final void b(b<GameWebPage>.a paramb) {} public final int dgI() { return 1; } public final String name() { return "getLiteAppSwitch"; } } /* Location: L:\local\mybackup\temp\qq_apk\com.tencent.mm\classes.jar * Qualified Name: com.tencent.mm.plugin.game.luggage.b.p * JD-Core Version: 0.7.0.1 */
[ "98632993+tsuzcx@users.noreply.github.com" ]
98632993+tsuzcx@users.noreply.github.com
6656b84f85ba363bc210dcd546c99489aca02150
0cab34c6a6908e51259044798ea29a4a327dc700
/src/main/java/huyue/servlet/UserLoginServlet.java
adc066526bc89e3ffa463a733be71dde6cef42b7
[]
no_license
HHHHH-Y/YueTingFM
8796f0fa6e41bb0e94393cdd1485e50f983c541a
dc1ccaa9341d243eedff4a4907dde499a100bc31
refs/heads/master
2022-12-06T20:02:21.380696
2020-08-29T14:05:13
2020-08-29T14:05:13
286,982,242
0
0
null
null
null
null
UTF-8
Java
false
false
1,545
java
package huyue.servlet; import huyue.model.User; import huyue.service.UserService; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import java.io.IOException; import java.sql.SQLException; /** * Created with IntelliJ IDEA. * Description: 用户登录 * User: HHH.Y * Date: 2020-08-21 */ @WebServlet("/login") public class UserLoginServlet extends HttpServlet { private UserService userService; public void init() throws ServletException{ userService = new UserService(); } @Override protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { req.setCharacterEncoding("utf-8"); String username = req.getParameter("username"); String password = req.getParameter("password"); try { User user = userService.login(username, password); if(user == null) { // 用户登录失败 resp.sendRedirect("/login.html"); return; } // 将用户信息存储到 session 中 HttpSession session = req.getSession(); session.setAttribute("user", user); // 跳转回首页 resp.sendRedirect("/"); } catch (SQLException e) { throw new ServletException(e); } } }
[ "984495875@qq.com" ]
984495875@qq.com
68487babdf6b9dca4968321fe3faa5c91dd4c729
82eba08b9a7ee1bd1a5f83c3176bf3c0826a3a32
/ZmailSoap/src/java/org/zmail/soap/sync/type/DeviceId.java
99f6466468c76a3881df9c7a1b961c384e083ed8
[ "MIT" ]
permissive
keramist/zmailserver
d01187fb6086bf3784fe180bea2e1c0854c83f3f
762642b77c8f559a57e93c9f89b1473d6858c159
refs/heads/master
2021-01-21T05:56:25.642425
2013-10-21T11:27:05
2013-10-22T12:48:43
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,571
java
/* * ***** BEGIN LICENSE BLOCK ***** * Zimbra Collaboration Suite Server * Copyright (C) 2011, 2012 VMware, Inc. * * The contents of this file are subject to the Zimbra Public License * Version 1.3 ("License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.zimbra.com/license. * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. * ***** END LICENSE BLOCK ***** */ package org.zmail.soap.sync.type; import com.google.common.base.Objects; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; import org.zmail.common.soap.SyncConstants; @XmlAccessorType(XmlAccessType.NONE) public class DeviceId { /** * @zm-api-field-tag device-id * @zm-api-field-description device ID */ @XmlAttribute(name=SyncConstants.A_ID /* id */, required=true) private final String id; /** * no-argument constructor wanted by JAXB */ @SuppressWarnings("unused") private DeviceId() { this((String) null); } public DeviceId(String id) { this.id = id; } public String getId() { return id; } public Objects.ToStringHelper addToStringInfo(Objects.ToStringHelper helper) { return helper.add("id", id); } @Override public String toString() { return addToStringInfo(Objects.toStringHelper(this)).toString(); } }
[ "bourgerie.quentin@gmail.com" ]
bourgerie.quentin@gmail.com
78d5c2313ddeb5e5116973371b62a657405e1daa
1ca86d5d065372093c5f2eae3b1a146dc0ba4725
/spring-exceptions/src/test/java/com/surya/ex/nosuchbeandefinitionexception/Cause3NoSuchBeanDefinitionExceptionManualTest.java
b0267ff085a524b5244c18b2448b90c0dfa2902d
[]
no_license
Suryakanta97/DemoExample
1e05d7f13a9bc30f581a69ce811fc4c6c97f2a6e
5c6b831948e612bdc2d9d578a581df964ef89bfb
refs/heads/main
2023-08-10T17:30:32.397265
2021-09-22T16:18:42
2021-09-22T16:18:42
391,087,435
0
1
null
null
null
null
UTF-8
Java
false
false
726
java
package com.surya.ex.nosuchbeandefinitionexception; import com.surya.ex.nosuchbeandefinitionexception.spring.Cause3ContextWithJavaConfig; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.support.AnnotationConfigContextLoader; @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(classes = { Cause3ContextWithJavaConfig.class }, loader = AnnotationConfigContextLoader.class) public class Cause3NoSuchBeanDefinitionExceptionManualTest { @Test public final void givenContextIsInitialized_thenNoException() { // } }
[ "suryakanta97@github.com" ]
suryakanta97@github.com
9943b8634175ab5525a75fa6e109096cf4e4c7d8
966d2ef7eedb6aeddd2d728ef3b125b9ce09f93b
/src/main/java/com/atguigu/crud/dao/EmployeeMapper.java
d39aa2e4f6950fb75795ac8a57b725070a0193c2
[]
no_license
unick4759/ssm-crud
719aaa5c2fb7a71c6ad9928e9c54e1f51b52dbc2
94e91b0952037d80414ab8899057f4bc2f74e3c9
refs/heads/master
2020-04-21T17:08:50.803328
2019-02-08T11:43:35
2019-02-08T11:43:35
169,726,514
0
0
null
null
null
null
UTF-8
Java
false
false
1,046
java
package com.atguigu.crud.dao; import com.atguigu.crud.bean.Employee; import com.atguigu.crud.bean.EmployeeExample; import java.util.List; import org.apache.ibatis.annotations.Param; public interface EmployeeMapper { long countByExample(EmployeeExample example); int deleteByExample(EmployeeExample example); int deleteByPrimaryKey(Integer empId); int insert(Employee record); int insertSelective(Employee record); List<Employee> selectByExample(EmployeeExample example); Employee selectByPrimaryKey(Integer empId); //新增自定义 带部门信息的查询 List<Employee> selectByExampleWithDept(EmployeeExample example); Employee selectByPrimaryKeyWithDept(Integer empId); int updateByExampleSelective(@Param("record") Employee record, @Param("example") EmployeeExample example); int updateByExample(@Param("record") Employee record, @Param("example") EmployeeExample example); int updateByPrimaryKeySelective(Employee record); int updateByPrimaryKey(Employee record); }
[ "yangzihong_glb@qq.com" ]
yangzihong_glb@qq.com
8458acc8ade54ec4d1a9f629d6baaa91e4dd4e9e
d937646fcd3ba303cab55d729cf7f2a8d8a93c83
/app/src/main/java/zhuyekeji/zhengzhou/jxlifecircle/widget/MyAppTitle.java
fa812c5e6aafa2376578fff6fbf09ce13bacadd6
[]
no_license
jingzhixb/jxlifecircle
7e2e61ba3c0207ba547ff2bb228589a402df8121
5247754504d92383fb93f5bda60e03766d84ecce
refs/heads/master
2020-03-19T20:34:15.281494
2018-07-23T12:03:54
2018-07-23T12:03:54
136,907,546
0
0
null
null
null
null
UTF-8
Java
false
false
5,536
java
package zhuyekeji.zhengzhou.jxlifecircle.widget; import android.annotation.TargetApi; import android.content.Context; import android.os.Build; import android.text.TextUtils; import android.util.AttributeSet; import android.view.LayoutInflater; import android.view.View; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.RelativeLayout; import android.widget.TextView; import zhuyekeji.zhengzhou.jxlifecircle.R; /** * App通用titleBar **/ public class MyAppTitle extends LinearLayout { private OnLeftButtonClickListener mLeftButtonClickListener; private OnRightButtonClickListener mRightButtonClickListener; private MyViewHolder mViewHolder; private View viewAppTitle; public MyAppTitle(Context context) { super(context); init(); } public MyAppTitle(Context context, AttributeSet attrs) { super(context, attrs); init(); } @TargetApi(Build.VERSION_CODES.HONEYCOMB) public MyAppTitle(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); init(); } private void init() { LayoutInflater inflater = (LayoutInflater) this.getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE); LayoutParams layoutParams = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); viewAppTitle = inflater.inflate(R.layout.common_title_bar, null); this.addView(viewAppTitle, layoutParams); mViewHolder = new MyViewHolder(this); mViewHolder.llLeftGoBack.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { if (isFastDoubleClick()) { return; } if (mLeftButtonClickListener != null) { mLeftButtonClickListener.onLeftButtonClick(v); } } }); mViewHolder.llRight.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { if (isFastDoubleClick()) { return; } if (mRightButtonClickListener != null) { mRightButtonClickListener.OnRightButtonClick(v); } } }); } public void initViewsVisible(boolean isLeftButtonVisile, boolean isCenterTitleVisile, boolean isRightIconVisile, boolean isRightTitleVisile) { // 左侧返回 mViewHolder.llLeftGoBack.setVisibility(isLeftButtonVisile ? View.VISIBLE : View.INVISIBLE); // 中间标题 mViewHolder.tvCenterTitle.setVisibility(isCenterTitleVisile ? View.VISIBLE : View.INVISIBLE); // 右侧返回图标,文字 if (!isRightIconVisile && !isRightTitleVisile) { mViewHolder.llRight.setVisibility(View.INVISIBLE); } else { mViewHolder.llRight.setVisibility(View.VISIBLE); } mViewHolder.ivRightComplete.setVisibility(isRightIconVisile ? View.VISIBLE : View.GONE); mViewHolder.tvRightComplete.setVisibility(isRightTitleVisile ? View.VISIBLE : View.INVISIBLE); } /** * 设置标题 * * @param title */ public void setAppTitle(String title) { mViewHolder.tvCenterTitle.setText(title); } public void setLeftIcon(int sourceId) { mViewHolder.llLeftGoBack.setImageResource(sourceId); } public void setTitleSize(float size) { mViewHolder.tvCenterTitle.setTextSize(size); } public void setRightTitle(String text) { if (!TextUtils.isEmpty(text)) { mViewHolder.tvRightComplete.setText(text); } } public void setRightIcon(int sourceID) { mViewHolder.ivRightComplete.setImageResource(sourceID); } public void setLeftOnclick(OnLeftButtonClickListener mOnLeftButtonClickListener) { if (mOnLeftButtonClickListener != null) { } } public void setAppBackground(int color) { viewAppTitle.setBackgroundColor(color); } public void setOnLeftButtonClickListener(OnLeftButtonClickListener listen) { mLeftButtonClickListener = listen; } public void setOnRightButtonClickListener(OnRightButtonClickListener listen) { mRightButtonClickListener = listen; } public interface OnLeftButtonClickListener { void onLeftButtonClick(View v); } public interface OnRightButtonClickListener { void OnRightButtonClick(View v); } static class MyViewHolder { ImageView llLeftGoBack; TextView tvCenterTitle; RelativeLayout llRight; ImageView ivRightComplete; TextView tvRightComplete; public MyViewHolder(View v) { llLeftGoBack = v.findViewById(R.id.llLeftGoBack); tvCenterTitle = v.findViewById(R.id.tvCenterTitle); llRight = v.findViewById(R.id.llRight); ivRightComplete = v.findViewById(R.id.ivRightComplete); tvRightComplete = v.findViewById(R.id.tvRightComplete); } } // 防止快速点击默认等待时长为900ms private long DELAY_TIME = 900; private static long lastClickTime; private boolean isFastDoubleClick() { long time = System.currentTimeMillis(); long timeD = time - lastClickTime; if (0 < timeD && timeD < DELAY_TIME) { return true; } lastClickTime = time; return false; } }
[ "1390056147qq.com" ]
1390056147qq.com
c0d91f173b68057e9b3e4d8df09587ca70de33d2
7723bfcd75173c53bf8a420ecc5df434fef07c23
/src/interviewprograms/ReverseString.java
87b3e2dbf2693a6f14dab3efe7a7c11042bd2776
[]
no_license
Lalitha937/Java-Interview-Programs
474b620b25098bb56a4520aa00a3f1ea5c490070
e304b639762fa8fc4a4f9faea114e04573b6378a
refs/heads/master
2023-03-15T05:42:39.301445
2018-10-06T19:42:47
2018-10-06T19:47:06
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,012
java
package interviewprograms; import java.util.Scanner; /** * * @author HASAN */ public class ReverseString { public static void main(String[] args) { System.out.println("Enter String to be reversed: "); Scanner sc= new Scanner(System.in); String string= sc.nextLine(); String reverse=""; for(int i=string.length()-1; i>=0; i--){ reverse= reverse+string.charAt(i); //The method charAt(int index) returns the character at the specified index } System.out.println("After reversing: "+ reverse); //Another way System.out.println("\nAnother way-->"); StringBuffer a = new StringBuffer("Java programming is fun"); System.out.println(a.reverse()); } } /* run: Enter String to be reversed: ajmal hasan After reversing: nasah lamja Another way--> nuf si gnimmargorp avaJ */
[ "ajmal0197@gmail.com" ]
ajmal0197@gmail.com
87368930af59c39a4c1c9f69126083c6039b3556
42e43d56ffae71ec5617a87747e307f4aa8c2ca6
/src/Layer.java
72b13d2726c9c66afbd1527867fb92a0f9bf7f67
[]
no_license
codythomaszeitler/SimpleGameEngine
0f2e7e01ec25f18f0006a101641aa6ad6f287b96
b4ced6c79abfeafb165fa9d75f6547090e8ad211
refs/heads/master
2020-12-24T18:51:30.607789
2016-05-26T17:38:11
2016-05-26T17:38:11
58,885,314
0
0
null
null
null
null
UTF-8
Java
false
false
1,442
java
package SimpleGameEngine; import java.awt.*; import java.util.*; /** * Created by Cody Thomas Zeitler on 5/14/2016. */ public class Layer { private LinkedList<GameObject> gameObjectsToPaint; private int degree; public Layer(){ gameObjectsToPaint = new LinkedList<>(); degree = 1; } public void add(GameObject gameObject){ gameObjectsToPaint.add(gameObject); } public void remove(GameObject gameObject){ ListIterator listIterator = gameObjectsToPaint.listIterator(); int indexRemove = 0; while(listIterator.hasNext()){ if(listIterator.next() == gameObject){ gameObjectsToPaint.remove(indexRemove); } indexRemove++; } } public void update(int x, int y){ ListIterator listIterator = gameObjectsToPaint.listIterator(); while(listIterator.hasNext()){ GameObject gameObject = (GameObject)listIterator.next(); gameObject.setXCoordinate( gameObject.getXCoordinate() + (degree * x) ); gameObject.setYCoordinate( gameObject.getYCoordinate() + (degree * y) ); } } public void paint(Graphics g){ ListIterator listIterator = gameObjectsToPaint.listIterator(); while(listIterator.hasNext()){ GameObject temp = (GameObject)listIterator.next(); temp.paint(g); } } }
[ "codyzeitler12@gmail.com" ]
codyzeitler12@gmail.com
f4f2ecb6143ddd4451d05e377053c6d7a46a6a64
c0bd08ac71b61905e4e855c17ad18b822afe3baf
/app/src/androidTest/java/com/example/zhangyu/mygitdemo/ExampleInstrumentedTest.java
ed7675175c5088e273f590f9ba9048d2feaa908f
[]
no_license
Leaderpaking/MygitDemo
7caaa01a18d9c9e80998deb11eeb45d2d1a78fb8
a08f78732018475866445c21ad6157b6046a7139
refs/heads/master
2020-03-27T13:05:51.637106
2018-08-29T11:38:14
2018-08-29T11:38:14
146,589,878
0
0
null
null
null
null
UTF-8
Java
false
false
742
java
package com.example.zhangyu.mygitdemo; import android.content.Context; import android.support.test.InstrumentationRegistry; import android.support.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.*; /** * Instrumented test, which will execute on an Android device. * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test public void useAppContext() { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("com.example.zhangyu.mygitdemo", appContext.getPackageName()); } }
[ "1036502863@qq.com" ]
1036502863@qq.com
e08ee5d8e08429e502634b3b42c0aebe6b62252b
0525fc0b11b9c808430f84899f93154da16caa9b
/src/com/bbu/cl/entity/Clazz.java
fe5bdf07b28228a7152f589a912e789c4370072d
[]
no_license
fenrenyuancl/StudentCRMSSM
b2ace4a4df13008181129701cf345ae64e07ef50
1e16c53861f10b2c7be80f76c6713778495bbb08
refs/heads/master
2020-07-24T12:38:26.839921
2019-09-12T01:04:56
2019-09-12T01:04:56
202,715,659
0
0
null
null
null
null
UTF-8
Java
false
false
744
java
package com.bbu.cl.entity; import org.springframework.stereotype.Component; /** * 班级实体 * @author 疯人愿 * */ @Component public class Clazz { private Long id; //id,主键,自增 private Long gradeId; //年级id private String name; //班级名称 private String remark; //班级备注 public Long getId() { return id; } public void setId(Long id) { this.id = id; } public Long getGradeId() { return gradeId; } public void setGradeId(Long gradeId) { this.gradeId = gradeId; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getRemark() { return remark; } public void setRemark(String remark) { this.remark = remark; } }
[ "fengrenyuancl@163.com" ]
fengrenyuancl@163.com
57f342a32c9d4a158776c032fd982044548b7d52
22035817356bfb62f32db0442c56020a2aff7fa2
/src/arrays_2/Arrays_2.java
dcd2b86f87538eeb4c8ff553a9072f4e86d77050
[]
no_license
TizianoAl/ola3
7f74240ecc9fff11485fc182d70f9853450ccebb
ef0b05dd0532b87bafd4777adcc569c69ba03c34
refs/heads/master
2020-06-26T15:03:28.188946
2019-07-30T14:32:01
2019-07-30T14:32:01
199,666,724
0
0
null
null
null
null
UTF-8
Java
false
false
885
java
package arrays_2; import java.util.Scanner; public class Arrays_2 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); char mayusculas[] = new char[26]; for (int i = 65, j = 0; i <= 90; i++, j++) { mayusculas[j] = (char) i; } String cadena = ""; int eleccion = -1; do { System.out.println("Elija un indice entre 0 y " + (mayusculas.length - 1)); eleccion = sc.nextInt(); if (!(eleccion >= 0 && eleccion <= mayusculas.length - 1)) { System.out.println("Error, inserte otro numero"); } else { if (eleccion != -1) { cadena += mayusculas[eleccion]; } } } while (eleccion != -1); System.out.println(cadena); } }
[ "alfazaktiziano@gmail.com" ]
alfazaktiziano@gmail.com
28e6d7fc1a6d4bf622502d95649f5d1817d77b48
1b8f211151074fb415d612fee6daf96e28cecb3d
/src/main/java/ru/evasmall/tm/util/HashCode.java
9d28a1fc4eec231420dec3f994c620f42fb09bb6
[]
no_license
Evasmall/jse-14
2ee004eb279e76338cc454c2c34a76b17cbae9db
7b164a3a56831ceff9a58e7fda7a69519099fed6
refs/heads/master
2022-12-04T12:46:21.777512
2020-08-26T15:10:04
2020-08-26T15:10:04
288,787,767
0
0
null
null
null
null
UTF-8
Java
false
false
666
java
package ru.evasmall.tm.util; public class HashCode { public static String getHash(String txt) { try { java.security.MessageDigest md = java.security.MessageDigest.getInstance("MD5"); byte[] array = md.digest(txt.getBytes()); StringBuffer sb = new StringBuffer(); for (int i = 0; i < array.length; ++i) { sb.append(Integer.toHexString((array[i] & 0xFF) | 0x100).substring(1,3)); } return sb.toString(); } catch (java.security.NoSuchAlgorithmException e) { System.out.println("[HASHING FAILED.]"); } return null; } }
[ "evasmall@mail.ru" ]
evasmall@mail.ru
1404570b913c1a7726dfbecfd1a1ba7951d3df03
d168fcca4164498275ad9f2e8eb5adb4d7ee1400
/sendcar/src/main/java/com/maven/tool/PageHelper.java
579774351fcdcdbd1626c1b38710aa327cccad38
[]
no_license
jobs123654/my-system
217b95a744df8063f8d3072fbd59670b47dec021
39626bb8899998cc97f0271e2078bae13b0ad22e
refs/heads/master
2021-05-08T11:47:27.701848
2018-07-05T00:09:54
2018-07-05T00:09:54
119,910,694
1
0
null
null
null
null
UTF-8
Java
false
false
2,286
java
package com.maven.tool; import java.util.List; public class PageHelper<T> { private int current=1;//当前页 private int pagesize;//每页的记录数 private int totalPage;//总页数 private int totalSize;//总的记录数 private int offset=0;//偏移 private int index;//目标索引 private List<T> list; private List<T> result; public List<T> getResult() { int index=pagesize*current>totalSize?totalSize:pagesize*current; result=list.subList(getOffset(), index); return result; } public int getTotalPage() { return totalPage; } public int getIndex() { return index; } public void setIndex(int index) { this.index = index; } public PageHelper(int current, int pagesize, List<T> list) { this.current=current; this.pagesize=pagesize; this.list=list; this.totalSize=list.size(); //处理逻辑 totalPage=totalSize/pagesize; if(current<1){ current=1; } if(totalPage>0&&current>totalPage) { current=totalPage; } System.out.println(totalPage); if(list.size()%pagesize!=0) { totalPage+=1; } offset=pagesize*(current-1); index=pagesize*current>totalSize?totalSize:pagesize*current; result=list.subList(offset, index); } public int getCurrent() { return current; } public void setCurrent(int current) { this.current = current; } public int getPagesize() { return pagesize; } public void setPagesize(int pagesize) { this.pagesize = pagesize; } public int getTotalSize() { return list.size(); } public void setTotalPage(int totalPage) { this.totalPage = totalPage; } public void setTotalSize(int totalSize) { this.totalSize = totalSize; } //获取偏移 public int getOffset() { return pagesize*(current-1); } public void setOffset(int offset) { this.offset = offset; } public List<T> getList() { return list; } public void setList(List<T> list) { this.list = list; } }
[ "1620252479@qq.com" ]
1620252479@qq.com
666b04aeaca966f4bab44a0c206fc8d0c7b7fc17
ddfc35004f1e71a8a9a7ec0ab75dd1de73e6a892
/8direct/src/main/java/com/jaeckel/direct/DirectSlideFragment.java
b0aa62e19f3a4382f65d5a297d3643fbc4b186f6
[]
no_license
jimb00b/8direct
71550c56e0e26a595825718f5e4eb72aef4bcbfe
7e4909045b6b3163017edeb76825f034a3a6cb16
refs/heads/master
2020-12-24T23:19:30.050700
2013-06-11T21:05:47
2013-06-11T21:05:47
null
0
0
null
null
null
null
UTF-8
Java
false
false
630
java
package com.jaeckel.direct; import android.os.Bundle; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import java.lang.Override; /** * Created by flashmop on 16.05.13. */ public class DirectSlideFragment extends Fragment { @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup rootView = (ViewGroup) inflater.inflate( R.layout.fragment_screen_slide_page, container, false); return rootView; } }
[ "dirk@jaeckel.com" ]
dirk@jaeckel.com
a3472ef0f56f0ae783d6eeed2e166cfa8b1cb7a0
e3f0a61ce338a54a6ace33308013bed918862433
/yplatform-mina/src/main/java/org/apache/mina/examples/sumup/codec/AddMessageDecoder.java
6de549512558a7e3501141fce18454732f397919
[]
no_license
yuanjinze/mina
ff81f84c08e6d17563650a622758b79fcab090ea
d09fc2a0a889810b8e144b8dfb4c3627e1b16bf1
refs/heads/master
2023-08-09T08:53:37.627717
2019-07-15T07:32:30
2019-07-15T07:32:30
196,947,426
0
0
null
2023-08-07T19:26:06
2019-07-15T07:30:00
HTML
UTF-8
Java
false
false
1,656
java
/* * @(#) $Id: AddMessageDecoder.java 209237 2005-07-05 07:44:16Z trustin $ * * Copyright 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.mina.examples.sumup.codec; import org.apache.mina.common.ByteBuffer; import org.apache.mina.examples.sumup.message.AbstractMessage; import org.apache.mina.examples.sumup.message.AddMessage; import org.apache.mina.protocol.ProtocolSession; import org.apache.mina.protocol.codec.MessageDecoder; /** * A {@link MessageDecoder} that decodes {@link AddMessage}. * * @author The Apache Directory Project * @version $Rev: 209237 $, $Date: 2005-07-05 15:44:16 +0800 (Tue, 05 Jul 2005) $ */ public class AddMessageDecoder extends AbstractMessageDecoder { public AddMessageDecoder() { super( Constants.ADD ); } protected AbstractMessage decodeBody( ProtocolSession session, ByteBuffer in ) { if( in.remaining() < Constants.ADD_BODY_LEN ) { return null; } AddMessage m = new AddMessage(); m.setValue( in.getInt() ); return m; } }
[ "yuanjinze_ne@126.com" ]
yuanjinze_ne@126.com
2c6747a24b38c84ce8a573da19f405156f8ebe02
c566423148d86c8ccbef73c75617ae402d4def88
/Games/app/src/main/java/uoft/csc207/games/model/dodger/GamePanel.java
efc5f4024aab08f0976a818b3788cf2c41dba4e9
[]
no_license
anind99/MiniGames
99e03e3bedc279a94546e4563ce21f5f8b0e0033
297a4bddc51a097869643c972edf66e82794cbdd
refs/heads/master
2020-12-18T14:57:08.039949
2020-01-21T19:56:45
2020-01-21T19:56:45
235,428,758
0
0
null
null
null
null
UTF-8
Java
false
false
10,803
java
package uoft.csc207.games.model.dodger; import android.content.Context; import android.graphics.BitmapFactory; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android.graphics.Point; import android.view.MotionEvent; import android.view.SurfaceHolder; import android.view.SurfaceView; import uoft.csc207.games.R; import uoft.csc207.games.activity.dodger.ScrollerActivity; import uoft.csc207.games.controller.ProfileManager; import uoft.csc207.games.model.Score; import uoft.csc207.games.controller.scoreboard.ScoreBoard; import uoft.csc207.games.model.IGameID; import uoft.csc207.games.model.PlayerProfile; public class GamePanel extends SurfaceView implements SurfaceHolder.Callback { /** * Surface for Scroller Game - handles game functionality * * Field * scrollerActivity: ScrollerActivity - activity for scroller game * thread: MainThread - Thread for scroller game * Obs: ObsManager - Obstacles in the game * coins: Coin - Coins to be collected in the game * playerProfile: profile to retrieve scroller game from * P_y: int - Y position of game player character * player1: scrollerCharacter - game player character * male: Boolean - character customisation of game * CurrentGame: ScrollerGame - Current scroller game * start: boolean - indicates whether customisation is set */ private ScrollerActivity scrollerActivity; private MainThread thread; private ObsManager Obs; private int P_y; private scrollerCharacter player1; private Coin coins; boolean isOver; private Point po; private Boolean male; private PlayerProfile playerProfile; private ScrollerGame CurrentGame; private boolean start; public GamePanel(Context context){ super(context); scrollerActivity = (ScrollerActivity)context; isOver = false; start = false; getHolder().addCallback(this); thread = new MainThread(getHolder(), this); player1 = new scrollerCharacter(BitmapFactory.decodeResource(getResources(),R.drawable.goku)); this.coins = new Coin(6); P_y = Constants.SCREEN_HEIGHT/2; Obs = new ObsManager(3, Color.MAGENTA, player1.getHeight()); System.out.println(player1.getHeight()); this.playerProfile = ProfileManager.getProfileManager(context).getCurrentPlayer(); InitCurrentGame(); } @Override public void surfaceChanged(SurfaceHolder holder, int format, int width,int height){} public ScrollerActivity getScrollerActivity(){ return this.scrollerActivity; } @Override public void surfaceCreated(SurfaceHolder holder){ thread = new MainThread(getHolder(), this); thread.setRunning(true); thread.start(); } @Override public void surfaceDestroyed(SurfaceHolder holder){ boolean retry = true; while (retry){ try{ thread.setRunning(false); thread.join(); } catch (Exception e){ e.printStackTrace(); } retry = false; } } /** * when tapped: game character is moved up, score is incremented by 1 * @param e: Motion event * @return Motion event processed */ @Override public boolean onTouchEvent(MotionEvent e) { if (!isOver) { switch (e.getAction()) { case MotionEvent.ACTION_DOWN: case MotionEvent.ACTION_MOVE: { if (start) { P_y -= 50*Constants.SPEED; CurrentGame.updateScore(CurrentGame.getScore() + 1); } else { po = new Point(); po.x = (int) e.getX(); po.y = (int) e.getY(); } } } } return true; } public MainThread getMainThread(){ return thread; } /** * Font Selection * @param canvas : canvas to be drawn on */ public void startScreen(Canvas canvas){ super.draw(canvas); Paint p1 = new Paint(); p1.setColor(Color.BLACK); p1.setTextSize(100); canvas.drawColor(Color.GREEN); canvas.drawText("Big Text", 0, Constants.SCREEN_HEIGHT/3, p1); canvas.drawText("Regular Text", 0, 2*Constants.SCREEN_HEIGHT/3, p1); if ( po.y >= 0 && po.y <= Constants.SCREEN_HEIGHT/2){ CurrentGame.chooseFont("Big"); po.y = -1; } else if (po.y >= 0 && po.y < Constants.SCREEN_HEIGHT){ CurrentGame.chooseFont("Small"); po.y = -1; } po.x = -1; po.y = -1; } /** * Character Selection * @param canvas: Canvas to be drawn on */ public void startScreen2(Canvas canvas){ super.draw(canvas); Paint p1 = new Paint(); p1.setColor(Color.BLACK); p1.setTextSize(100); canvas.drawColor(Color.GREEN); canvas.drawText("Male", 0, Constants.SCREEN_HEIGHT/3, p1); canvas.drawText("Female", 0, 2*Constants.SCREEN_HEIGHT/3, p1); if (po.y >= 0) { male = po.y <= Constants.SCREEN_HEIGHT / 2; CurrentGame.chooseCharacter("Male"); } if (!male){ player1 = new scrollerCharacter(BitmapFactory.decodeResource(getResources(),R.drawable.fem)); CurrentGame.chooseCharacter("Female"); } po.x = -1; po.y = -1; } /** * Color Theme Selection * @param canvas: Canvas to be drawn on */ private void startScreen3(Canvas canvas){ super.draw(canvas); Paint p1 = new Paint(); p1.setColor(Color.BLACK); p1.setTextSize(100); canvas.drawColor(Color.GREEN); canvas.drawText("Blue", 0, Constants.SCREEN_HEIGHT/3, p1); canvas.drawText("Red", 0, 2*Constants.SCREEN_HEIGHT/3, p1); if ( po.y >= Constants.SCREEN_HEIGHT/2){ CurrentGame.chooseColor("RED"); } else if (po.y >= 0){ CurrentGame.chooseColor("BLUE"); } po.x = -1; po.y = -1; } /** * Difficulty selection * @param canvas: Canvas to be drawn on */ private void startScreen4(Canvas canvas){ super.draw(canvas); Paint p1 = new Paint(); p1.setColor(Color.BLACK); p1.setTextSize(100); canvas.drawColor(Color.GREEN); canvas.drawText("Advanced", 0, Constants.SCREEN_HEIGHT/3, p1); canvas.drawText("Regular", 0, 2*Constants.SCREEN_HEIGHT/3, p1); if ( po.y >= Constants.SCREEN_HEIGHT/2){ Constants.SPEED = 1; } else if (po.y >= 0){ Constants.SPEED = 2; } po.x = -1; po.y = -1; } /** * Main draw method, draws all Game Objects and canvas according to customisation * @param canvas: Canvas to be drawn on */ @Override public void draw(Canvas canvas){ super.draw(canvas); Paint p = new Paint(); if (isOver) { GameOverScreen(canvas, p); } else { if (!start) { startGame(canvas); } else { p.setColor(Color.BLACK); if (CurrentGame.getFont().equals("Big")) { p.setTextSize(100); } else { p.setTextSize(50); } if (CurrentGame.getColor().equals("RED")) { canvas.drawColor(Color.RED); } else { canvas.drawColor(Color.BLUE); } Obs.draw(canvas); player1.draw(canvas); coins.draw(canvas); canvas.drawText("Score: " + CurrentGame.getScore(), 100, 50 + p.descent() - p.ascent(), p); canvas.drawText("Money: " + CurrentGame.getCurrency(), 100, 200 + p.descent() - p.ascent(), p); } } } /** * Prompts for all customisations * @param canvas: Canvas to be drawn on */ private void startGame(Canvas canvas){ if (CurrentGame.getFont() == null) { startScreen(canvas); } else if (CurrentGame.getCharacter() == null) { startScreen2(canvas); } else if (CurrentGame.getColor() == null) { startScreen3(canvas); } else if (Constants.SPEED == 0) { startScreen4(canvas); } else{ start = true; } } /** * Screen when game is ober * @param canvas: Canvas to be drawn on * @param p: Paint object to be used */ private void GameOverScreen(Canvas canvas, Paint p){ canvas.drawColor(Color.BLACK); p.setColor(Color.YELLOW); p.setStrokeWidth(10); p.setTextSize(100); canvas.drawText("GAME OVER!", Constants.SCREEN_WIDTH/4, Constants.SCREEN_HEIGHT /2, p); canvas.drawText("Scroller Points: " + CurrentGame.getScore(), 50, 50 + p.descent() - p.ascent(), p); canvas.drawText("Scroller Money: " + CurrentGame.getCurrency(), 50, 350 + p.descent() - p.ascent(), p); } /** * Game Over method, goes to AddScoreActivity */ private void gameOver(){ isOver = true; Constants.SPEED = 0; CurrentGame.checkAchievements(); CurrentGame.setCumulativeCurrency(CurrentGame.getCumulativeCurrency()+CurrentGame.getCurrency()); CurrentGame.setCumulativeScore(CurrentGame.getCumulativeScore()+CurrentGame.getScore()); ScoreBoard.setCurrentScore(new Score("", CurrentGame.getScore(), CurrentGame.getCurrency(), ScrollerActivity.class.getName())); } /** * Updates game Objects, and checks status of the game */ public void update() { if (!isOver && start) { if (!Obs.detectCollision(player1)) { if (P_y + player1.getHeight() < Constants.SCREEN_HEIGHT) { P_y += Constants.SPEED * 5; } player1.update(P_y); Obs.update(); coins.update(); coins.CollisionCheck(player1, CurrentGame); } else { gameOver(); } } } /** * Retrieves Scroller Game from playerProfile */ private void InitCurrentGame(){ ScrollerGame s = (ScrollerGame) playerProfile.containsGame(IGameID.DODGER); if (s == null){ s = new ScrollerGame(); playerProfile.addGame(s); } CurrentGame = s; s.updateCurrency(0); s.updateScore(0); } }
[ "anindya.auveek@mail.utoronto.ca" ]
anindya.auveek@mail.utoronto.ca
a56373133fb94091e81bb7be4a67b1b1e6266333
8b6283648c7e81e5313f7ef776457b642202d207
/liveproject_spring_security_project2_milestone2/src/main/java/com/laurentiuspilca/liveproject/exceptions/HealthProfileAlreadyExistsException.java
0f21802518528a149cbed17cca8c29879faf8373
[]
no_license
lspil/liveproject_refactored
d60d8bd8232b436769708400a2b061a4087f512a
486cd62ea1cfe708c96fba4d4ae08b53f783f0c2
refs/heads/master
2023-04-04T15:15:13.223109
2021-04-11T09:14:00
2021-04-11T09:14:00
352,297,018
6
3
null
null
null
null
UTF-8
Java
false
false
219
java
package com.laurentiuspilca.liveproject.exceptions; public class HealthProfileAlreadyExistsException extends RuntimeException { public HealthProfileAlreadyExistsException(String message) { super(message); } }
[ "Laurentiu.Spilca@endava.com" ]
Laurentiu.Spilca@endava.com
2401208f736d6c1cba1a85df14a8470b602bf1a2
c885ef92397be9d54b87741f01557f61d3f794f3
/tests-without-trycatch/Math-8/org.apache.commons.math3.distribution.DiscreteDistribution/default/22/org/apache/commons/math3/distribution/DiscreteDistribution_ESTest_scaffolding.java
90eb721846464eeef42fded0514ddead8c244b42
[ "CC-BY-4.0", "MIT" ]
permissive
pderakhshanfar/EMSE-BBC-experiment
f60ac5f7664dd9a85f755a00a57ec12c7551e8c6
fea1a92c2e7ba7080b8529e2052259c9b697bbda
refs/heads/main
2022-11-25T00:39:58.983828
2022-04-12T16:04:26
2022-04-12T16:04:26
309,335,889
0
1
null
2021-11-05T11:18:43
2020-11-02T10:30:38
null
UTF-8
Java
false
false
7,059
java
/** * Scaffolding file used to store all the setups needed to run * tests automatically generated by EvoSuite * Fri Jul 30 13:49:03 GMT 2021 */ package org.apache.commons.math3.distribution; import org.evosuite.runtime.annotation.EvoSuiteClassExclude; import org.junit.BeforeClass; import org.junit.Before; import org.junit.After; import org.junit.AfterClass; import org.evosuite.runtime.sandbox.Sandbox; import org.evosuite.runtime.sandbox.Sandbox.SandboxMode; @EvoSuiteClassExclude public class DiscreteDistribution_ESTest_scaffolding { @org.junit.Rule public org.evosuite.runtime.vnet.NonFunctionalRequirementRule nfr = new org.evosuite.runtime.vnet.NonFunctionalRequirementRule(); private static final java.util.Properties defaultProperties = (java.util.Properties) java.lang.System.getProperties().clone(); private org.evosuite.runtime.thread.ThreadStopper threadStopper = new org.evosuite.runtime.thread.ThreadStopper (org.evosuite.runtime.thread.KillSwitchHandler.getInstance(), 3000); @BeforeClass public static void initEvoSuiteFramework() { org.evosuite.runtime.RuntimeSettings.className = "org.apache.commons.math3.distribution.DiscreteDistribution"; org.evosuite.runtime.GuiSupport.initialize(); org.evosuite.runtime.RuntimeSettings.maxNumberOfThreads = 100; org.evosuite.runtime.RuntimeSettings.maxNumberOfIterationsPerLoop = 10000; org.evosuite.runtime.RuntimeSettings.mockSystemIn = true; org.evosuite.runtime.RuntimeSettings.sandboxMode = org.evosuite.runtime.sandbox.Sandbox.SandboxMode.RECOMMENDED; org.evosuite.runtime.sandbox.Sandbox.initializeSecurityManagerForSUT(); org.evosuite.runtime.classhandling.JDKClassResetter.init(); setSystemProperties(); initializeClasses(); org.evosuite.runtime.Runtime.getInstance().resetRuntime(); } @AfterClass public static void clearEvoSuiteFramework(){ Sandbox.resetDefaultSecurityManager(); java.lang.System.setProperties((java.util.Properties) defaultProperties.clone()); } @Before public void initTestCase(){ threadStopper.storeCurrentThreads(); threadStopper.startRecordingTime(); org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().initHandler(); org.evosuite.runtime.sandbox.Sandbox.goingToExecuteSUTCode(); setSystemProperties(); org.evosuite.runtime.GuiSupport.setHeadless(); org.evosuite.runtime.Runtime.getInstance().resetRuntime(); org.evosuite.runtime.agent.InstrumentingAgent.activate(); } @After public void doneWithTestCase(){ threadStopper.killAndJoinClientThreads(); org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().safeExecuteAddedHooks(); org.evosuite.runtime.classhandling.JDKClassResetter.reset(); resetClasses(); org.evosuite.runtime.sandbox.Sandbox.doneWithExecutingSUTCode(); org.evosuite.runtime.agent.InstrumentingAgent.deactivate(); org.evosuite.runtime.GuiSupport.restoreHeadlessMode(); } public static void setSystemProperties() { java.lang.System.setProperties((java.util.Properties) defaultProperties.clone()); java.lang.System.setProperty("user.dir", "/experiment"); java.lang.System.setProperty("java.io.tmpdir", "/tmp"); } private static void initializeClasses() { org.evosuite.runtime.classhandling.ClassStateSupport.initializeClasses(DiscreteDistribution_ESTest_scaffolding.class.getClassLoader() , "org.apache.commons.math3.exception.util.ExceptionContextProvider", "org.apache.commons.math3.random.Well44497a", "org.apache.commons.math3.util.MathArrays", "org.apache.commons.math3.random.AbstractWell", "org.apache.commons.math3.exception.util.ArgUtils", "org.apache.commons.math3.exception.MathArithmeticException", "org.apache.commons.math3.exception.NumberIsTooSmallException", "org.apache.commons.math3.exception.NotPositiveException", "org.apache.commons.math3.exception.MathInternalError", "org.apache.commons.math3.exception.MathIllegalStateException", "org.apache.commons.math3.random.BitsStreamGenerator", "org.apache.commons.math3.exception.NonMonotonicSequenceException", "org.apache.commons.math3.exception.MathIllegalArgumentException", "org.apache.commons.math3.exception.MathIllegalNumberException", "org.apache.commons.math3.util.Pair", "org.apache.commons.math3.exception.util.LocalizedFormats", "org.apache.commons.math3.distribution.DiscreteDistribution", "org.apache.commons.math3.exception.DimensionMismatchException", "org.apache.commons.math3.exception.util.Localizable", "org.apache.commons.math3.random.Well19937c", "org.apache.commons.math3.exception.NotStrictlyPositiveException", "org.apache.commons.math3.random.RandomGenerator", "org.apache.commons.math3.exception.util.ExceptionContext", "org.apache.commons.math3.exception.NullArgumentException", "org.apache.commons.math3.random.Well512a", "org.apache.commons.math3.random.Well19937a" ); } private static void resetClasses() { org.evosuite.runtime.classhandling.ClassResetter.getInstance().setClassLoader(DiscreteDistribution_ESTest_scaffolding.class.getClassLoader()); org.evosuite.runtime.classhandling.ClassStateSupport.resetClasses( "org.apache.commons.math3.distribution.DiscreteDistribution", "org.apache.commons.math3.exception.util.LocalizedFormats", "org.apache.commons.math3.util.Pair", "org.apache.commons.math3.random.BitsStreamGenerator", "org.apache.commons.math3.random.AbstractWell", "org.apache.commons.math3.random.Well19937c", "org.apache.commons.math3.util.MathArrays", "org.apache.commons.math3.exception.MathArithmeticException", "org.apache.commons.math3.exception.util.ExceptionContext", "org.apache.commons.math3.exception.util.ArgUtils", "org.apache.commons.math3.random.MersenneTwister", "org.apache.commons.math3.util.FastMath", "org.apache.commons.math3.random.Well19937a", "org.apache.commons.math3.random.Well512a", "org.apache.commons.math3.exception.MathIllegalArgumentException", "org.apache.commons.math3.exception.MathIllegalNumberException", "org.apache.commons.math3.exception.NumberIsTooSmallException", "org.apache.commons.math3.exception.NotPositiveException", "org.apache.commons.math3.random.SynchronizedRandomGenerator", "org.apache.commons.math3.random.Well1024a", "org.apache.commons.math3.random.Well44497a", "org.apache.commons.math3.random.ISAACRandom", "org.apache.commons.math3.random.Well44497b", "org.apache.commons.math3.random.RandomAdaptor", "org.apache.commons.math3.util.FastMathLiteralArrays", "org.apache.commons.math3.util.FastMath$lnMant", "org.apache.commons.math3.util.FastMath$CodyWaite", "org.apache.commons.math3.exception.NotStrictlyPositiveException", "org.apache.commons.math3.random.JDKRandomGenerator" ); } }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
129c2a92227471cde8c6530e3bd07718e1855bf9
e7e046284f7de71d514e8f19afa1ce0efa0d90e1
/src/main/java/com/wangtao/dbhelper/mapping/DynamicSqlSource.java
08693eab8b3a453f269d9f99d2718b9ae4df6cf9
[]
no_license
wangtaoj/DbHelper
cae1ffcbe6d08387b0ad1837859d8ab61a53d370
83d1b02ccfa4e17cbf16dbca91208c0de11a3aaf
refs/heads/master
2020-04-12T14:14:33.149097
2019-02-28T07:18:25
2019-02-28T07:18:25
162,546,378
1
1
null
null
null
null
UTF-8
Java
false
false
1,781
java
package com.wangtao.dbhelper.mapping; import com.wangtao.dbhelper.builder.SqlSourceBuilder; import com.wangtao.dbhelper.core.Configuration; import com.wangtao.dbhelper.scripting.xmltags.DynamicContext; import com.wangtao.dbhelper.scripting.xmltags.SqlNode; import java.util.Map; /** * 动态Sqlsource: 存在$占位符或者动态标签的SQL. * 需要从参数中获取值, 因此在运行时解析SQL语句. * @author wangtao * Created at 2019/1/22 15:34 */ public class DynamicSqlSource implements SqlSource { private final Configuration configuration; private final SqlNode rootSqlNode; public DynamicSqlSource(Configuration configuration, SqlNode rootSqlNode) { this.configuration = configuration; this.rootSqlNode = rootSqlNode; } @Override public BoundSql getBoundSql(Object parameterObject) { // 拼接SQL, 处理动态标签, $占位符. DynamicContext context = new DynamicContext(configuration, parameterObject); rootSqlNode.apply(context); // 创建静态SqlSource, 处理#占位符. SqlSourceBuilder sqlSourceBuilder = new SqlSourceBuilder(configuration); SqlSource sqlSource = sqlSourceBuilder.parse(context.getSql()); // 添加额外参数. BoundSql boundSql = sqlSource.getBoundSql(parameterObject); for (Map.Entry<String, Object> entry : context.getBindings().entrySet()) { if (!DynamicContext.PARAMETER.equals(entry.getKey())) { boundSql.setAdditionalParameter(entry.getKey(), entry.getValue()); } } return boundSql; } public Configuration getConfiguration() { return configuration; } public SqlNode getRootSqlNode() { return rootSqlNode; } }
[ "wangtao970503@gmail.com" ]
wangtao970503@gmail.com
4aa87243fd7804255d2dd59bd4a266fd72e2edf2
587468b3f77d92397aca877b62264cffccc77903
/src/test/java/pages/BasicPage.java
c68804e569395e2f83856aef843ef1387daeba6a
[]
no_license
ekaterinavitiska/Spritecloud
ca2c647861b67a981216ac80fa6e95c5647dcf6f
d6bd68ef8a2738d505067f479ef84d9b6ee6fe1c
refs/heads/main
2023-03-07T02:36:15.421490
2021-02-22T13:00:00
2021-02-22T13:00:00
340,871,509
0
0
null
null
null
null
UTF-8
Java
false
false
976
java
package pages; import com.codeborne.selenide.Condition; import com.codeborne.selenide.Configuration; import org.openqa.selenium.By; import static com.codeborne.selenide.Condition.*; import static com.codeborne.selenide.Selenide.$; public class BasicPage { public By header = By.xpath("//div[@class ='elementor-slide-heading']"); public By featuresTab = By.xpath(("//*[contains(@href,'/features/')]")); public By pricingTab = By.xpath(("//*[contains(@href,'/pricing/')]")); public By signUpTab = By.xpath(("//*[contains(@href,'/users/sign_up')]")); public By headersButton = By.xpath(("//*[text()='Accept']")); Condition clickable = and("can be clicked", visible, enabled); public String getHeaderText() { return $(header).waitUntil(Condition.visible, Configuration.timeout).getText(); } public void clickAcceptCookies() { if ($(headersButton).is(Condition.visible)) $(headersButton).click(); } }
[ "ekaterina.alekseeva90@gmail.com" ]
ekaterina.alekseeva90@gmail.com