blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
7
390
content_id
stringlengths
40
40
detected_licenses
listlengths
0
35
license_type
stringclasses
2 values
repo_name
stringlengths
6
132
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringclasses
539 values
visit_date
timestamp[us]date
2016-08-02 21:09:20
2023-09-06 10:10:07
revision_date
timestamp[us]date
1990-01-30 01:55:47
2023-09-05 21:45:37
committer_date
timestamp[us]date
2003-07-12 18:48:29
2023-09-05 21:45:37
github_id
int64
7.28k
684M
star_events_count
int64
0
77.7k
fork_events_count
int64
0
48k
gha_license_id
stringclasses
13 values
gha_event_created_at
timestamp[us]date
2012-06-11 04:05:37
2023-09-14 21:59:18
gha_created_at
timestamp[us]date
2008-05-22 07:58:19
2023-08-28 02:39:21
gha_language
stringclasses
62 values
src_encoding
stringclasses
26 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
128
12.8k
extension
stringclasses
11 values
content
stringlengths
128
8.19k
authors
listlengths
1
1
author_id
stringlengths
1
79
624d2bb4b55563c277d8707a56de4cb40dc438e8
0c7a1f6917e9db647daecc974d63ff11b69b0fda
/TruyenTNV_Web/src/main/java/vn/com/fis/model/epos/StockObject.java
a73416f84e3976a424dee3b600443a9cbff7e85f
[]
no_license
rsfirst/TruyenTNV
3971441a2a222f72a06517a74f4bff6f684e38a8
091f29039054975b61f107c52a53e38311931a40
refs/heads/master
2022-07-05T23:08:14.312035
2020-03-11T03:58:37
2020-03-11T03:58:37
241,400,377
0
0
null
2022-06-29T18:00:36
2020-02-18T15:44:13
JavaScript
UTF-8
Java
false
false
2,577
java
package vn.com.fis.model.epos; public class StockObject { public StockObject() { } public StockObject(long stockId, String code, String name, String status) { super(); this.stockId = stockId; this.code = code; this.name = name; this.status = status; } long stockId; long shopStaffId; long staffId; long shopStaffParentId; String code; String name; String type; String status; String nodeCode; String parentNodeCode; Long nodeOrder; Long staffOfStock; String address; String tel; String fax; int level; // phuc vu ve lai tree stock public int getLevel() { return level; } public void setLevel(int level) { this.level = level; } public long getStockId() { return stockId; } public void setStockId(long stockId) { this.stockId = stockId; } public long getShopStaffId() { return shopStaffId; } public void setShopStaffId(long shopStaffId) { this.shopStaffId = shopStaffId; } public long getStaffId() { return staffId; } public void setStaffId(long staffId) { this.staffId = staffId; } public long getShopStaffParentId() { return shopStaffParentId; } public void setShopStaffParentId(long shopStaffParentId) { this.shopStaffParentId = shopStaffParentId; } public String getCode() { return code; } public void setCode(String code) { this.code = code; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getType() { return type; } public void setType(String type) { this.type = type; } public String getStatus() { return status; } public void setStatus(String status) { this.status = status; } public String getNodeCode() { return nodeCode; } public void setNodeCode(String nodeCode) { this.nodeCode = nodeCode; } public String getParentNodeCode() { return parentNodeCode; } public void setParentNodeCode(String parentNodeCode) { this.parentNodeCode = parentNodeCode; } public Long getNodeOrder() { return nodeOrder; } public void setNodeOrder(Long nodeOrder) { this.nodeOrder = nodeOrder; } public Long getStaffOfStock() { return staffOfStock; } public void setStaffOfStock(Long staffOfStock) { this.staffOfStock = staffOfStock; } public String getAddress() { return address; } public void setAddress(String address) { this.address = address; } public String getTel() { return tel; } public void setTel(String tel) { this.tel = tel; } public String getFax() { return fax; } public void setFax(String fax) { this.fax = fax; } }
[ "anhvuong6996@gmail.com" ]
anhvuong6996@gmail.com
0d59533e88073f5bc32391b3bb8a9e8bad164b08
9eec8574e953598429d4562055b1957b2d5583c5
/jfluentvalidation-core/src/test/java/jfluentvalidation/validators/rulefor/arrays/longs/HasSameLengthAsTest.java
6567a8c3c70804233bd272c78b7e987c5bc70303
[ "MIT" ]
permissive
seancarroll/jfluentvalidation
f9e04753931af90da775e6a4ecc0e3312f91cc1c
67f581aa50b1efa52a461345982856503b04e987
refs/heads/master
2023-06-22T00:27:58.078302
2020-08-27T02:43:10
2020-08-27T02:43:10
146,148,457
2
1
MIT
2023-06-20T16:05:52
2018-08-26T03:32:04
Java
UTF-8
Java
false
false
3,409
java
package jfluentvalidation.validators.rulefor.arrays.longs; import jfluentvalidation.ValidationResult; import jfluentvalidation.validators.DefaultValidator; import org.junit.jupiter.api.Test; import java.util.Arrays; import java.util.Collections; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; class HasSameLengthAsTest { @Test void shouldNotReturnFailureWhenActualLengthIsEqualToExpectedPrimitiveByteArray() { Target t = new Target(new long[] {1}); DefaultValidator<Target> validator = new DefaultValidator<>(Target.class); validator.ruleForLongArray(Target::getValue).hasSameLengthAs(new long[] {1}); ValidationResult validationResult = validator.validate(t); assertTrue(validationResult.isValid()); } @Test void shouldNotReturnFailureWhenActualLengthIsEqualToExpectedByteArray() { Target t = new Target(new long[] {1}); DefaultValidator<Target> validator = new DefaultValidator<>(Target.class); validator.ruleForLongArray(Target::getValue).hasSameLengthAs(new Long[] {1L}); ValidationResult validationResult = validator.validate(t); assertTrue(validationResult.isValid()); } @Test void shouldNotReturnFailureWhenActualLengthIsEqualToExpectedList() { Target t = new Target(new long[] {1}); DefaultValidator<Target> validator = new DefaultValidator<>(Target.class); validator.ruleForLongArray(Target::getValue).hasSameLengthAs(Collections.singletonList(1L)); ValidationResult validationResult = validator.validate(t); assertTrue(validationResult.isValid()); } @Test void shouldNotReturnFailureWhenActualIsNull() { Target t = new Target(null); DefaultValidator<Target> validator = new DefaultValidator<>(Target.class); validator.ruleForLongArray(Target::getValue).hasSameLengthAs(new Long[] {1L}); ValidationResult validationResult = validator.validate(t); assertTrue(validationResult.isValid()); } @Test void shouldReturnFailureWhenActualLengthIsNotEqualToExpectedPrimitiveByteArray() { Target t = new Target(new long[] {1}); DefaultValidator<Target> validator = new DefaultValidator<>(Target.class); validator.ruleForLongArray(Target::getValue).hasSameLengthAs(new long[] {1, 2}); ValidationResult validationResult = validator.validate(t); assertFalse(validationResult.isValid()); } @Test void shouldReturnFailureWhenActualLengthIsNotEqualToExpectedByteArray() { Target t = new Target(new long[] {1}); DefaultValidator<Target> validator = new DefaultValidator<>(Target.class); validator.ruleForLongArray(Target::getValue).hasSameLengthAs(new Long[] {1L, 2L}); ValidationResult validationResult = validator.validate(t); assertFalse(validationResult.isValid()); } @Test void shouldReturnFailureWhenActualLengthIsNotEqualToExpectedList() { Target t = new Target(new long[] {1}); DefaultValidator<Target> validator = new DefaultValidator<>(Target.class); validator.ruleForLongArray(Target::getValue).hasSameLengthAs(Arrays.asList(1L, 2L)); ValidationResult validationResult = validator.validate(t); assertFalse(validationResult.isValid()); } }
[ "seanc28@gmail.com" ]
seanc28@gmail.com
c18ef0dbf825ab0176b1f4c814c7aa3d2a0e54dd
8f3b4309bb2a4eb10818351ca9a6e5aef0af5b8c
/Spring5AOP/Spring5AOP/src/main/java/org/sathyatech/app/test/Test.java
c057a531834779dcd43ee5b2cc21c3c5f428b728
[]
no_license
satishyr/SpringRaghuRest
bfde4a374137c14c353c4b254787cceb0523b6b8
551c25c05ac459b26c3b4800fba4684b307246a8
refs/heads/master
2022-12-24T12:13:02.918164
2020-02-11T08:00:14
2020-02-11T08:00:14
239,706,762
0
0
null
2022-12-16T00:39:18
2020-02-11T07:57:48
Java
UTF-8
Java
false
false
475
java
package org.sathyatech.app.test; import org.sathyatech.app.component.ProductService; import org.sathyatech.app.config.AppConfig; import org.springframework.context.annotation.AnnotationConfigApplicationContext; public class Test { public static void main(String[] args) { AnnotationConfigApplicationContext ac=new AnnotationConfigApplicationContext(AppConfig.class); ProductService ps=ac.getBean(ProductService.class); ps.getProductInfo(); ac.close(); } }
[ "y.satishkumar34@gmail.com" ]
y.satishkumar34@gmail.com
f7a9526891f1a1b2501ef6f46f4c59d3a9469c09
a17dd1e9f5db1c06e960099c13a5b70474d90683
/core/src/main/java/jp/co/sint/webshop/data/dto/TmallCommodityProperty.java
7864bbe63ce49a7a38fd12d60f7b629cee15be5e
[]
no_license
giagiigi/ec_ps
4e404afc0fc149c9614d0abf63ec2ed31d10bebb
6eb19f4d14b6f3a08bfc2c68c33392015f344cdd
refs/heads/master
2020-12-14T07:20:24.784195
2015-02-09T10:00:44
2015-02-09T10:00:44
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,243
java
// // Copyright(C) 2007-2008 System Integrator Corp. // All rights reserved. // // このファイルはEDMファイルから自動生成されます。 // 直接編集しないで下さい。 // package jp.co.sint.webshop.data.dto; import java.io.Serializable; import java.util.Date; import jp.co.sint.webshop.data.DatabaseUtil; import jp.co.sint.webshop.data.WebshopEntity; import jp.co.sint.webshop.data.attribute.Length; import jp.co.sint.webshop.data.attribute.Metadata; import jp.co.sint.webshop.data.attribute.Required; import jp.co.sint.webshop.utility.DateUtil; /** * 「カテゴリ(CATEGORY)」テーブルの1行分のレコードを表すDTO(Data Transfer Object)です。 * * @author System Integrator Corp. */ public class TmallCommodityProperty implements Serializable, WebshopEntity ,JsonObject { /** Serial Version UID */ private static final long serialVersionUID = -1; @Required @Length(16) @Metadata(name = "商品编号", order = 1) private String commodityCode; @Required @Length(16) @Metadata(name = "属性id", order = 2) private String propertyId; @Required @Length(16) @Metadata(name = "属性值ID", order = 3) private String valueId; @Length(50) @Metadata(name = "属性值", order = 4) private String valueText; /** データ行ID */ @Required @Length(38) @Metadata(name = "データ行ID", order = 5) private Long ormRowid = DatabaseUtil.DEFAULT_ORM_ROWID; /** 作成ユーザ */ @Required @Length(100) @Metadata(name = "作成ユーザ", order = 6) private String createdUser; /** 作成日時 */ @Required @Metadata(name = "作成日時", order = 7) private Date createdDatetime; /** 更新ユーザ */ @Required @Length(100) @Metadata(name = "更新ユーザ", order = 8) private String updatedUser; /** 更新日時 */ @Required @Metadata(name = "更新日時", order = 9) private Date updatedDatetime; /** * @return the commodityCode */ public String getCommodityCode() { return commodityCode; } /** * @param commodityCode the commodityCode to set */ public void setCommodityCode(String commodityCode) { this.commodityCode = commodityCode; } /** * @return the propertyId */ public String getPropertyId() { return propertyId; } /** * @param propertyId the propertyId to set */ public void setPropertyId(String propertyId) { this.propertyId = propertyId; } /** * @return the valueId */ public String getValueId() { return valueId; } /** * @param valueId the valueId to set */ public void setValueId(String valueId) { this.valueId = valueId; } /** * @return the valueText */ public String getValueText() { return valueText; } /** * @param valueText the valueText to set */ public void setValueText(String valueText) { this.valueText = valueText; } /** * データ行IDを取得します * * @return データ行ID */ public Long getOrmRowid() { return this.ormRowid; } /** * 作成ユーザを取得します * * @return 作成ユーザ */ public String getCreatedUser() { return this.createdUser; } /** * 作成日時を取得します * * @return 作成日時 */ public Date getCreatedDatetime() { return DateUtil.immutableCopy(this.createdDatetime); } /** * 更新ユーザを取得します * * @return 更新ユーザ */ public String getUpdatedUser() { return this.updatedUser; } /** * 更新日時を取得します * * @return 更新日時 */ public Date getUpdatedDatetime() { return DateUtil.immutableCopy(this.updatedDatetime); } /** * データ行IDを設定します * * @param val * データ行ID */ public void setOrmRowid(Long val) { this.ormRowid = val; } /** * 作成ユーザを設定します * * @param val * 作成ユーザ */ public void setCreatedUser(String val) { this.createdUser = val; } /** * 作成日時を設定します * * @param val * 作成日時 */ public void setCreatedDatetime(Date val) { this.createdDatetime = DateUtil.immutableCopy(val); } /** * 更新ユーザを設定します * * @param val * 更新ユーザ */ public void setUpdatedUser(String val) { this.updatedUser = val; } /** * 更新日時を設定します * * @param val * 更新日時 */ public void setUpdatedDatetime(Date val) { this.updatedDatetime = DateUtil.immutableCopy(val); } @Override public String toJsonString() { StringBuilder builder = new StringBuilder(); builder.append("{"); builder.append(JsonUtil.getPair("commodityCode", JsonUtil.urlEncode(getCommodityCode())) + ","); builder.append(JsonUtil.getPair("propertyId", JsonUtil.urlEncode(getPropertyId())) + ","); builder.append(JsonUtil.getPair("valueText", getValueText()) + ","); builder.append(JsonUtil.getPair("valueId", JsonUtil.urlEncode(getValueId()))) ; builder.append("}"); return builder.toString(); } }
[ "fengperfect@126.com" ]
fengperfect@126.com
fde701f65dcc553b7dd0492f9fc6eaf708da3bc8
9d22c94e26c0425022cc105b6b858ae09c42af8d
/app/src/main/java/org/apache/fineract/ui/online/depositaccounts/createdepositaccount/DepositOnNavigationBarListener.java
7f580c3678042b3d30537f13da760ef66b2f0307
[ "Apache-2.0" ]
permissive
AathmanT/fineract-cn-mobile
273596bcbb292209eccb91526af9c8f09d371c78
d8ecd7312ae803d664f143e6647a3e64060c6445
refs/heads/development
2020-05-02T22:26:52.478485
2019-01-16T13:41:51
2019-02-01T09:09:21
178,251,879
0
0
Apache-2.0
2019-03-28T17:28:03
2019-03-28T17:27:56
Java
UTF-8
Java
false
false
434
java
package org.apache.fineract.ui.online.depositaccounts.createdepositaccount; import android.support.annotation.Nullable; import org.apache.fineract.data.models.deposit.DepositAccount; /** * @author Rajan Maurya * On 15/08/17. */ public interface DepositOnNavigationBarListener { interface ProductInstanceDetails { void setProductInstance(DepositAccount depositAccount, @Nullable String productName); } }
[ "rajanmaurya154@gmail.com" ]
rajanmaurya154@gmail.com
d341edce031a04e23c8b6b1d72dfd3d40f7fb99f
b17fc9e282f3ae10579e4456d9ca2774f4b14780
/modules/jdk/src/main/java/cn/tim/clazz/Student.java
a4a540faf5f07c6ad27468bb369e66571fde9721
[]
no_license
luolibing/coding-life
8c351e306111b217585c4fbaab34c10e42012b23
06318973d4c0bbbfc0225c4a5bc5d4a2ddf2c6ff
refs/heads/master
2022-12-27T02:26:49.599091
2021-12-22T04:01:00
2021-12-22T04:01:00
94,624,544
1
1
null
2022-12-16T06:49:34
2017-06-17T13:11:35
Java
UTF-8
Java
false
false
286
java
package cn.tim.clazz; /** * Created by LuoLiBing on 16/7/25. */ public class Student extends Person { public final static Integer num = 50; static { System.out.println("static init student"); } { System.out.println("instant init student"); } }
[ "397911353@qq.com" ]
397911353@qq.com
3c7fa3b107c9786949a7b4a84d6d698747451589
b1bbe639d582967f025cc5169b7e879d4707f91c
/src/main/java/br/com/guilhermealvessilve/certification/study/lambdas/MyInterface.java
7a11f62c335b67ac31c34bf55e220e6f63fb5898
[]
no_license
guilherme-alves-silve/java-11-study-certification
7852271cfced305f420843a79897ffbefdece76e
2511c46769d93181d3f11ca11b2b1708ea139052
refs/heads/master
2023-04-16T06:13:54.528652
2021-04-19T02:45:10
2021-04-19T02:45:10
359,307,364
0
0
null
null
null
null
UTF-8
Java
false
false
1,101
java
package br.com.guilhermealvessilve.certification.study.lambdas; /** * * @author Alves */ @FunctionalInterface public interface MyInterface { int THIS_IS_PUBLIC_STATIC_FINAL_A = 0; final int THIS_IS_PUBLIC_STATIC_FINAL_B = 1; static int THIS_IS_PUBLIC_STATIC_FINAL_C = 3; public static int THIS_IS_PUBLIC_STATIC_FINAL_D = 4; public static final int THIS_IS_PUBLIC_STATIC_FINAL_E = 5; static public final int THIS_IS_PUBLIC_STATIC_FINAL_F = 6; static final public int THIS_IS_PUBLIC_STATIC_FINAL_G = 7; void execute(); public default void executeDefault() { executePrivate(); } private void executePrivate() { System.out.println(THIS_IS_PUBLIC_STATIC_FINAL_A); System.out.println(THIS_IS_PUBLIC_STATIC_FINAL_B); System.out.println(THIS_IS_PUBLIC_STATIC_FINAL_C); System.out.println(THIS_IS_PUBLIC_STATIC_FINAL_D); System.out.println(THIS_IS_PUBLIC_STATIC_FINAL_E); System.out.println(THIS_IS_PUBLIC_STATIC_FINAL_F); System.out.println(THIS_IS_PUBLIC_STATIC_FINAL_G); } }
[ "guilherme_alves_silve@hotmail.com" ]
guilherme_alves_silve@hotmail.com
8b8fefff6199c8f0cc9c4bdc96060882be5fe382
52bbcab37b2cc8857269ad84e0fa07b9519b642b
/app/src/main/java/com/northmeter/prepaymentmanage/model/bdBean/BDLoginBean.java
39d15d08252ccdfa19c1399eeb5244d022607adc
[]
no_license
newYearsDeng/PrepaymentManage
45522f149df0dcc8f51b671c2bbea18de4803458
de77548c87b04456e6b9612c1edb1d945df109d2
refs/heads/master
2020-07-11T03:24:09.298739
2019-08-26T08:47:10
2019-08-26T08:47:10
204,434,598
0
0
null
null
null
null
UTF-8
Java
false
false
922
java
package com.northmeter.prepaymentmanage.model.bdBean; /** * Created by dyd on 2018/3/30. * 登录bean */ public class BDLoginBean { /** msg String 返回信息 code Int 返回代码 expire Int 过期时间(单位:秒),默认是20分钟 token string 令牌字符串*/ private String msg; private int code; private int expire; private String token; public String getMsg() { return msg; } public void setMsg(String msg) { this.msg = msg; } public int getCode() { return code; } public void setCode(int code) { this.code = code; } public int getExpire() { return expire; } public void setExpire(int expire) { this.expire = expire; } public String getToken() { return token; } public void setToken(String token) { this.token = token; } }
[ "905087116@qq.com" ]
905087116@qq.com
d9052e34144da898d302a295f4ef4fd4ace45788
647ec12ce50f06e7380fdbfb5b71e9e2d1ac03b4
/com.tencent.mobileqqi/classes.jar/dac.java
bbd3855884e4ccd23f62e7365cff84f6b5787859
[]
no_license
tsuzcx/qq_apk
0d5e792c3c7351ab781957bac465c55c505caf61
afe46ef5640d0ba6850cdefd3c11badbd725a3f6
refs/heads/main
2022-07-02T10:32:11.651957
2022-02-01T12:41:38
2022-02-01T12:41:38
453,860,108
36
9
null
2022-01-31T09:46:26
2022-01-31T02:43:22
Java
UTF-8
Java
false
false
3,316
java
import android.content.DialogInterface; import android.content.DialogInterface.OnClickListener; import android.content.Intent; import android.os.Handler; import com.tencent.mobileqq.activity.ChatActivity; import com.tencent.mobileqq.activity.ChatSettingActivity; import com.tencent.mobileqq.activity.ProfileActivity; import com.tencent.mobileqq.activity.ProfileActivity.AllInOne; import com.tencent.mobileqq.activity.ProfileCardMoreActivity; import com.tencent.mobileqq.app.FriendListHandler; import com.tencent.mobileqq.app.QQAppInterface; import com.tencent.mobileqq.statistics.ReportController; import com.tencent.mobileqq.utils.NetworkUtil; import com.tencent.qphone.base.util.BaseApplication; public class dac implements DialogInterface.OnClickListener { public dac(ProfileCardMoreActivity paramProfileCardMoreActivity, String paramString) {} public void onClick(DialogInterface paramDialogInterface, int paramInt) { ReportController.b(this.jdField_a_of_type_ComTencentMobileqqActivityProfileCardMoreActivity.b, "CliOper", "", "", "P_prof", "Pp_more_delete", ProfileActivity.a(this.jdField_a_of_type_ComTencentMobileqqActivityProfileCardMoreActivity.jdField_a_of_type_ComTencentMobileqqActivityProfileActivity$AllInOne.f), 0, Integer.toString(ProfileActivity.a(this.jdField_a_of_type_ComTencentMobileqqActivityProfileCardMoreActivity.jdField_a_of_type_ComTencentMobileqqActivityProfileActivity$AllInOne)), "", "", ""); if (NetworkUtil.e(BaseApplication.getContext())) { ((FriendListHandler)this.jdField_a_of_type_ComTencentMobileqqActivityProfileCardMoreActivity.b.a(1)).c(this.jdField_a_of_type_JavaLangString, (byte)2); paramDialogInterface = this.jdField_a_of_type_ComTencentMobileqqActivityProfileCardMoreActivity.b.a(ChatActivity.class); if (paramDialogInterface != null) { paramDialogInterface.sendMessage(paramDialogInterface.obtainMessage(16711681, this.jdField_a_of_type_JavaLangString)); } paramDialogInterface = this.jdField_a_of_type_ComTencentMobileqqActivityProfileCardMoreActivity.b.a(ChatSettingActivity.class); if (paramDialogInterface != null) { paramDialogInterface.sendMessage(paramDialogInterface.obtainMessage(16711681, this.jdField_a_of_type_JavaLangString)); } if (this.jdField_a_of_type_ComTencentMobileqqActivityProfileCardMoreActivity.jdField_a_of_type_AndroidContentIntent == null) { this.jdField_a_of_type_ComTencentMobileqqActivityProfileCardMoreActivity.jdField_a_of_type_AndroidContentIntent = new Intent(); } this.jdField_a_of_type_ComTencentMobileqqActivityProfileCardMoreActivity.jdField_a_of_type_AndroidContentIntent.putExtra("finchat", true); this.jdField_a_of_type_ComTencentMobileqqActivityProfileCardMoreActivity.setResult(-1, this.jdField_a_of_type_ComTencentMobileqqActivityProfileCardMoreActivity.jdField_a_of_type_AndroidContentIntent); this.jdField_a_of_type_ComTencentMobileqqActivityProfileCardMoreActivity.finish(); return; } this.jdField_a_of_type_ComTencentMobileqqActivityProfileCardMoreActivity.a(2131561432, 1); } } /* Location: L:\local\mybackup\temp\qq_apk\com.tencent.mobileqqi\classes2.jar * Qualified Name: dac * JD-Core Version: 0.7.0.1 */
[ "98632993+tsuzcx@users.noreply.github.com" ]
98632993+tsuzcx@users.noreply.github.com
f4fdaca78a12a1e4843cc3622464d576c51561ce
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/6/6_9595018b22ae2560e450f12edfabb50449a0527f/ChemicalStructureRenderer/6_9595018b22ae2560e450f12edfabb50449a0527f_ChemicalStructureRenderer_t.java
832fda4ae77a983670a6ad082c85303ec7a16ca5
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
3,212
java
/** * ChemicalStructureRenderer.java * * 2011.09.29 * * This file is part of the CheMet library * * The CheMet library is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * CheMet is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with CheMet. If not, see <http://www.gnu.org/licenses/>. */ package uk.ac.ebi.chemet.render.table.renderers; import java.awt.Color; import java.awt.Component; import java.awt.Rectangle; import java.util.Arrays; import java.util.Collection; import javax.swing.ImageIcon; import javax.swing.JTable; import org.openscience.cdk.exception.CDKException; import uk.ac.ebi.annotation.chemical.ChemicalStructure; import uk.ac.ebi.render.molecule.MoleculeRenderer; /** * ChemicalStructureRenderer – 2011.09.29 <br> * * @version $Rev$ : Last Changed $Date$ * @author johnmay * @author $Author$ (this version) */ public class ChemicalStructureRenderer extends DefaultRenderer { public ChemicalStructureRenderer() { } @Override public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { Collection<ChemicalStructure> collection = value instanceof Collection ? (Collection) value : Arrays.asList( value); if (table.getColumnModel().getColumn(column).getPreferredWidth() != table.getRowHeight(row)) { table.setRowHeight(row, table.getColumnModel().getColumn(column).getPreferredWidth()); } if (collection.iterator().hasNext()) { try { ChemicalStructure structure = collection.iterator().next(); this.setBackground(isSelected ? table.getSelectionBackground() : table.getBackground()); this.setIcon(new ImageIcon( MoleculeRenderer.getInstance().getImage(structure.getMolecule(), new Rectangle(0, 0, table.getRowHeight(row), table.getRowHeight(row))))); } catch (CDKException ex) { System.err.println("Unable to render molecule: " + ex.getMessage()); } } else { this.setIcon(null); } return this; } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
d54b8230df8348a0c8aa80a78c7be7c01aba2ad9
ea8013860ed0b905c64f449c8bce9e0c34a23f7b
/SystemUIGoogle/sources/androidx/appcompat/R$drawable.java
465b6297f318c6e5414e17f92729a3e9e4bed3d0
[]
no_license
TheScarastic/redfin_b5
5efe0dc0d40b09a1a102dfb98bcde09bac4956db
6d85efe92477576c4901cce62e1202e31c30cbd2
refs/heads/master
2023-08-13T22:05:30.321241
2021-09-28T12:33:20
2021-09-28T12:33:20
411,210,644
1
0
null
null
null
null
UTF-8
Java
false
false
3,320
java
package androidx.appcompat; /* loaded from: classes.dex */ public final class R$drawable { public static final int abc_ab_share_pack_mtrl_alpha = 2131231339; public static final int abc_btn_borderless_material = 2131231341; public static final int abc_btn_check_material = 2131231342; public static final int abc_btn_check_material_anim = 2131231343; public static final int abc_btn_colored_material = 2131231346; public static final int abc_btn_default_mtrl_shape = 2131231347; public static final int abc_btn_radio_material = 2131231348; public static final int abc_btn_radio_material_anim = 2131231349; public static final int abc_cab_background_internal_bg = 2131231354; public static final int abc_cab_background_top_material = 2131231355; public static final int abc_cab_background_top_mtrl_alpha = 2131231356; public static final int abc_dialog_material_background = 2131231358; public static final int abc_edit_text_material = 2131231359; public static final int abc_ic_ab_back_material = 2131231360; public static final int abc_ic_commit_search_api_mtrl_alpha = 2131231364; public static final int abc_ic_menu_copy_mtrl_am_alpha = 2131231366; public static final int abc_ic_menu_cut_mtrl_alpha = 2131231367; public static final int abc_ic_menu_paste_mtrl_am_alpha = 2131231369; public static final int abc_ic_menu_selectall_mtrl_alpha = 2131231370; public static final int abc_ic_menu_share_mtrl_alpha = 2131231371; public static final int abc_list_divider_mtrl_alpha = 2131231379; public static final int abc_menu_hardkey_panel_mtrl_mult = 2131231390; public static final int abc_popup_background_mtrl_mult = 2131231391; public static final int abc_ratingbar_indicator_material = 2131231392; public static final int abc_ratingbar_material = 2131231393; public static final int abc_ratingbar_small_material = 2131231394; public static final int abc_seekbar_thumb_material = 2131231400; public static final int abc_seekbar_tick_mark_material = 2131231401; public static final int abc_seekbar_track_material = 2131231402; public static final int abc_spinner_mtrl_am_alpha = 2131231407; public static final int abc_spinner_textfield_background_material = 2131231408; public static final int abc_star_black_48dp = 2131231409; public static final int abc_star_half_black_48dp = 2131231410; public static final int abc_switch_thumb_material = 2131231411; public static final int abc_switch_track_mtrl_alpha = 2131231412; public static final int abc_tab_indicator_material = 2131231413; public static final int abc_text_cursor_material = 2131231415; public static final int abc_text_select_handle_left_mtrl = 2131231416; public static final int abc_text_select_handle_middle_mtrl = 2131231417; public static final int abc_text_select_handle_right_mtrl = 2131231418; public static final int abc_textfield_activated_mtrl_alpha = 2131231419; public static final int abc_textfield_default_mtrl_alpha = 2131231420; public static final int abc_textfield_search_activated_mtrl_alpha = 2131231421; public static final int abc_textfield_search_default_mtrl_alpha = 2131231422; public static final int abc_textfield_search_material = 2131231423; }
[ "warabhishek@gmail.com" ]
warabhishek@gmail.com
68a10280647b4d50575a2d49427ddad905c400b3
d0766d3fbe847a0e038152aca357b545425f15e8
/src/HelloWorldJava.java
ccbbf88ea7480104be8bf37cf3e7ffdfd234918f
[]
no_license
IdeaUJetBrains/Rest_hello_world
ace53cc16959f862a6201cd8cf9a2ba6921a93b4
01404b1258fc376129602fbdb4897b7d3c487111
refs/heads/master
2020-03-29T16:23:06.467474
2018-09-24T14:13:48
2018-09-24T14:13:48
150,111,690
0
0
null
null
null
null
UTF-8
Java
false
false
708
java
import org.intellij.lang.annotations.Language; import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.Produces; // The Java class will be hosted at the URI path "/helloworldjava" @Path("/helloworldjava") public class HelloWorldJava { @org.intellij.lang.annotations.Language(value = "HTML",prefix = "<body><b>1", suffix = "2</b></body>") String val1 = "Hello World java"; // language="HTML" prefix="<b>" suffix=</b> String val2 = "test java"; @GET @Produces("text/html") public String foo10() { return val1 + "\n" + val2; } @GET @Produces("text/html") @Path("/1") public String foo11() { return "test usual injection"; } }
[ "olga.pavlova@jetbrains.com" ]
olga.pavlova@jetbrains.com
a91cea8c7956b14263f2c3712c944eda39d503ef
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/33/33_a2267c2e98c7c4a38630135b84ad74a56fe23098/UnlimitedNaturalLiteralExpOperations/33_a2267c2e98c7c4a38630135b84ad74a56fe23098_UnlimitedNaturalLiteralExpOperations_t.java
3b0379001caedb4c4a401fe3bd980df6cb373447
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
3,378
java
/** * <copyright> * * Copyright (c) 2008 IBM Corporation, Zeligsoft Inc. and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM - Initial API and implementation * * </copyright> * * $Id: UnlimitedNaturalLiteralExpOperations.java,v 1.3 2008/05/12 14:30:50 cdamus Exp $ */ package org.eclipse.ocl.expressions.operations; import java.util.Map; import org.eclipse.emf.common.util.BasicDiagnostic; import org.eclipse.emf.common.util.Diagnostic; import org.eclipse.emf.common.util.DiagnosticChain; import org.eclipse.ocl.Environment; import org.eclipse.ocl.expressions.UnlimitedNaturalLiteralExp; import org.eclipse.ocl.expressions.util.ExpressionsValidator; import org.eclipse.ocl.internal.l10n.OCLMessages; import org.eclipse.ocl.util.OCLUtil; /** * <!-- begin-user-doc --> * A static utility class that provides operations related to '<em><b>Unlimited Natural Literal Exp</b></em>' model objects. * <!-- end-user-doc --> * * <p> * The following operations are supported: * <ul> * <li>{@link org.eclipse.ocl.expressions.UnlimitedNaturalLiteralExp#checkNaturalType(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) <em>Check Natural Type</em>}</li> * </ul> * </p> * * @generated */ public class UnlimitedNaturalLiteralExpOperations { /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected UnlimitedNaturalLiteralExpOperations() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * <!-- begin-model-doc --> * self.type.name = 'UnlimitedNatural' * @param unlimitedNaturalLiteralExp The receiving '<em><b>Unlimited Natural Literal Exp</b></em>' model object. * @param diagnostics The chain of diagnostics to which problems are to be appended. * @param context The cache of context-specific information. * <!-- end-model-doc --> * @generated NOT */ public static <C> boolean checkNaturalType(UnlimitedNaturalLiteralExp<C> unlimitedNaturalLiteralExp, DiagnosticChain diagnostics, Map<Object, Object> context) { boolean result = true; Environment<?, C, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?> env = OCLUtil .getValidationEnvironment(unlimitedNaturalLiteralExp, context); if (env != null) { C type = unlimitedNaturalLiteralExp.getType(); result = (type != null) && ("UnlimitedNatural".equals(env.getUMLReflection().getName(type))); //$NON-NLS-1$ } if (!result) { if (diagnostics != null) { diagnostics.add (new BasicDiagnostic (Diagnostic.ERROR, ExpressionsValidator.DIAGNOSTIC_SOURCE, ExpressionsValidator.UNLIMITED_NATURAL_LITERAL_EXP__NATURAL_TYPE, OCLMessages.TypeConformanceUnlimitedNaturalLiteral_ERROR_, new Object [] { unlimitedNaturalLiteralExp })); } } return result; } } // UnlimitedNaturalLiteralExpOperations
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
a8bf9408a4de33b002fcb98316b663330535a887
17afcc3f70925b04e21ad214bdb1723adfb6405a
/misc/CareerCupSol/Chapter4/Q4/Q4.java
cb986ea403874bcdd268a939d29856d9486dcd69
[]
no_license
wonderli/Solutions
a848eeda6ceb86e3be0c47ab34b426dea0282343
56e6b90cd1e7bca06ec5ee69a1a8d3257f99ed29
refs/heads/master
2022-11-06T17:03:29.667413
2022-10-24T18:18:47
2022-10-24T18:18:47
3,465,559
11
4
null
null
null
null
UTF-8
Java
false
false
868
java
import java.util.ArrayList; import java.util.LinkedList; public class Q4 { public static ArrayList<LinkedList<Node>> createLevelTree(Node root){ ArrayList<LinkedList<Node>> ret = new ArrayList<LinkedList<Node>>(); LinkedList<Node> current = new LinkedList<Node>(); if(root != null){ current.add(root); } while(current.size() > 0) { ret.add(current); LinkedList<Node> parents = current; current = new LinkedList<Node>(); for(Node parent: parents) { if(parent.left != null){ current.add(parent.left); } if(parent.right != null) { current.add(parent.right); } } } return ret; } public static void main(String args[]){ } }
[ "lixinyu2268@gmail.com" ]
lixinyu2268@gmail.com
b0d213c40df7fdffd84be1f67408755358b2065d
7f3df551ba76f0ec52a0dd7add39c94e6b748e49
/src/main/java/org/xmlcml/ami2/plugins/AbstractEmmaElement.java
28002c36cb3a6df26bad715ba1e4ae234b7ad63c
[ "Apache-2.0" ]
permissive
petermr/ami
6ca555386402908202a109a6790b9881b60e613f
c7d1c17242252ac91b12a72d8aa35358eca1451a
refs/heads/pmr-remote-master-until-2016-04
2021-03-22T03:02:33.705066
2016-04-10T14:48:02
2016-04-10T14:48:02
32,931,446
1
0
null
2017-06-08T17:14:13
2015-03-26T14:15:04
HTML
UTF-8
Java
false
false
1,632
java
package org.xmlcml.ami2.plugins; import java.util.ArrayList; import java.util.Collections; import java.util.List; import nu.xom.Attribute; import nu.xom.Element; public abstract class AbstractEmmaElement extends Element{ protected static final String NAME = "_name"; protected AbstractEmmaElement(String tag) { super(tag); } public List<Argument> getArgumentList() { List<Argument> argumentList = new ArrayList<Argument>(); for (int i = 0; i < this.getAttributeCount(); i++) { Attribute attribute = this.getAttribute(i); Argument argument = Argument.createArgument(attribute); argumentList.add(argument); } return argumentList; } public void setArgumentList(List<Argument> argumentList) { for (Argument argument : argumentList) { Attribute attribute = Argument.createAttribute(argument); this.addAttribute(attribute); } } /** space-separated arguments (includes leading space) * * @return */ public String getArgumentString() { List<Argument> argumentList = getArgumentList(); Collections.sort(argumentList); StringBuilder sb = new StringBuilder(); for (Argument argument : argumentList) { if (!NAME.equals(argument.getName())) { sb.append(" "); sb.append(Argument.MINUS_MINUS); sb.append(argument.getName()); for (String value : argument.getValues()) { sb.append(" "); sb.append(value); } } } return sb.toString(); } public String getName() { return this.getAttributeValue(NAME); } public Argument getArgument(String name) { Argument argument = Argument.createArgument(this.getAttribute(name)); return argument; } }
[ "peter.murray.rust@googlemail.com" ]
peter.murray.rust@googlemail.com
9b4de5c3333387adf62f0d7cae14ffe456fa233a
1ca86d5d065372093c5f2eae3b1a146dc0ba4725
/persistence-modules/spring-data-jpa-filtering/src/test/java/com/surya/projection/JpaProjectionIntegrationTest.java
125de1c66bd885412e6b7ce5aea63ee614e3b13a
[]
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
2,552
java
package com.surya.projection; import com.surya.projection.model.Person; import com.surya.projection.repository.AddressRepository; import com.surya.projection.repository.PersonRepository; import com.surya.projection.view.AddressView; import com.surya.projection.view.PersonDto; import com.surya.projection.view.PersonView; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; import org.springframework.test.context.jdbc.Sql; import static org.assertj.core.api.Assertions.assertThat; import static org.springframework.test.context.jdbc.Sql.ExecutionPhase.AFTER_TEST_METHOD; @DataJpaTest @Sql(scripts = "/projection-insert-data.sql") @Sql(scripts = "/projection-clean-up-data.sql", executionPhase = AFTER_TEST_METHOD) public class JpaProjectionIntegrationTest { @Autowired private AddressRepository addressRepository; @Autowired private PersonRepository personRepository; @Test public void whenUsingClosedProjections_thenViewWithRequiredPropertiesIsReturned() { AddressView addressView = addressRepository.getAddressByState("CA").get(0); assertThat(addressView.getZipCode()).isEqualTo("90001"); PersonView personView = addressView.getPerson(); assertThat(personView.getFirstName()).isEqualTo("John"); assertThat(personView.getLastName()).isEqualTo("Doe"); } @Test public void whenUsingOpenProjections_thenViewWithRequiredPropertiesIsReturned() { PersonView personView = personRepository.findByLastName("Doe"); assertThat(personView.getFullName()).isEqualTo("John Doe"); } @Test public void whenUsingClassBasedProjections_thenDtoWithRequiredPropertiesIsReturned() { PersonDto personDto = personRepository.findByFirstName("John"); assertThat(personDto.getFirstName()).isEqualTo("John"); assertThat(personDto.getLastName()).isEqualTo("Doe"); } @Test public void whenUsingDynamicProjections_thenObjectWithRequiredPropertiesIsReturned() { Person person = personRepository.findByLastName("Doe", Person.class); PersonView personView = personRepository.findByLastName("Doe", PersonView.class); PersonDto personDto = personRepository.findByLastName("Doe", PersonDto.class); assertThat(person.getFirstName()).isEqualTo("John"); assertThat(personView.getFirstName()).isEqualTo("John"); assertThat(personDto.getFirstName()).isEqualTo("John"); } }
[ "suryakanta97@github.com" ]
suryakanta97@github.com
e0eef2cc11ca7160929d1968645c66017c8e1f24
b894e7feec5ef4711e9d5f00bffc3effc1294143
/src/by/it/gerasimov/jd01_08/Matrix.java
a4ba603efc18b13e68e2cb68965bc3551e495421
[]
no_license
Vladislav7776/JD2020-01-20
877e311bfa2be42152424f5f4963deb1b718e7e3
2f977ee26b79a97fa37bd1053756c91f344c5757
refs/heads/master
2020-12-22T21:37:24.187529
2020-03-12T20:22:51
2020-03-12T20:22:51
236,938,743
6
0
null
2020-01-29T08:46:59
2020-01-29T08:46:58
null
UTF-8
Java
false
false
6,560
java
package by.it.gerasimov.jd01_08; import java.util.Arrays; import java.util.regex.Matcher; import java.util.regex.Pattern; class Matrix extends Var { double[][] value; Matrix(double[][] value) { this.value = new double[value.length][0]; for (int i = 0; i < value.length; i++) { this.value[i] = new double[value[i].length]; System.arraycopy(value[i], 0, this.value[i], 0, value[i].length); } } Matrix(Matrix matrix) { value = new double[matrix.getValue().length][0]; for (int i = 0; i < matrix.getValue().length; i++) { value[i] = new double[matrix.getValue()[i].length]; System.arraycopy(matrix.getValue()[i], 0, value[i], 0, matrix.getValue()[i].length); } } Matrix(String strMatrix) { String[] strVectors = strMatrix.split("[}][, ]+[{]"); String[] strValues = strVectors[0].split(","); value = new double[strVectors.length][strValues.length]; Pattern p = Pattern.compile("-?\\d+(\\.\\d+)?"); Matcher m = p.matcher(strMatrix); for (int i = 0; i < strVectors.length; i++) { for (int j = 0; j < strValues.length; j++) { if (m.find()) { value[i][j] = Double.parseDouble(m.group()); } } } } double[][] getValue() { return value; } void setValue(double[][] value) { this.value = new double[value.length][0]; for (int i = 0; i < value.length; i++) { this.value[i] = new double[value[i].length]; System.arraycopy(value[i], 0, this.value[i], 0, value[i].length); } } @Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof Matrix)) return false; Matrix matrix = (Matrix) o; return this.toString().equals(matrix.toString()); } @Override public int hashCode() { return Arrays.hashCode(value); } @Override public String toString() { StringBuilder out = new StringBuilder(); out.append('{'); String delimiter1 = ""; for (double[] doubles : this.value) { out.append(delimiter1).append('{'); String delimiter2 = ""; for (int j = 0; j < this.value[0].length; j++) { out.append(delimiter2).append(doubles[j]); delimiter2 = ", "; } out.append('}'); delimiter1 = ", "; } out.append('}'); return out.toString(); } @Override public Var add(Var other) { return other.reverseAdd(this); } public Matrix add(Scalar other) { double[][] result = new double[value.length][value[0].length]; for (int i = 0; i < value.length; i++) { for (int j = 0; j < value[i].length; j++) { result[i][j] = value[i][j] + other.getValue(); } } return new Matrix(result); } public Matrix add(Matrix other) { double[][] result = new double[this.value.length][this.value[0].length]; for (int i = 0; i < this.value.length; i++) { for (int j = 0; j < this.value[0].length; j++) { result[i][j] = this.value[i][j] + other.value[i][j]; } } return new Matrix(result); } @Override protected Var reverseAdd(Scalar scalar) { return scalar.add(this); } @Override protected Var reverseAdd(Matrix other) { return other.add(this); } @Override public Var sub(Var other) { return other.reverseSub(this); } public Matrix sub(Scalar other) { double[][] result = new double[value.length][value[0].length]; for (int i = 0; i < value.length; i++) { for (int j = 0; j < value[i].length; j++) { result[i][j] = value[i][j] - other.getValue(); } } return new Matrix(result); } public Matrix sub(Matrix other) { double[][] result = new double[this.value.length][this.value[0].length]; for (int i = 0; i < this.value.length; i++) { for (int j = 0; j < this.value[0].length; j++) { result[i][j] = this.value[i][j] - other.value[i][j]; } } return new Matrix(result); } @Override protected Var reverseSub(Scalar scalar) { return scalar.sub(this); } @Override protected Var reverseSub(Matrix other) { return other.sub(this); } @Override public Var mul(Var other) { return other.reverseMul(this); } public Matrix mul(Scalar other) { double[][] result = new double[value.length][value[0].length]; for (int i = 0; i < value.length; i++) { for (int j = 0; j < value[i].length; j++) { result[i][j] = value[i][j] * other.getValue(); } } return new Matrix(result); } public Vector mul(Vector other) { double[] result = new double[this.value.length]; for (int i = 0; i < other.getValue().length; i++) { for (int j = 0; j < this.value.length; j++) { result[i] += this.value[i][j] * other.getValue()[j]; } } return new Vector(result); } public Matrix mul(Matrix other) { double[][] result = new double[this.value.length][other.value[0].length]; for (int i = 0; i < this.value.length; i++) { for (int j = 0; j < other.value[i].length; j++) { for (int k = 0; k < other.value.length; k++) { result[i][j] += this.value[i][k] * other.value[k][j]; } } } return new Matrix(result); } @Override protected Var reverseMul(Scalar other) { return other.mul(this); } @Override protected Var reverseMul(Vector other) { return other.mul(this); } @Override protected Var reverseMul(Matrix other) { return other.mul(this); } @Override public Var div(Var other) { return other.reverseDiv(this); } public Matrix div(Scalar other) { double[][] result = new double[value.length][value[0].length]; for (int i = 0; i < value.length; i++) { for (int j = 0; j < value[i].length; j++) { result[i][j] = value[i][j] / other.getValue(); } } return new Matrix(result); } }
[ "herasimau.jahor@gmail.com" ]
herasimau.jahor@gmail.com
d7c88e023111b7dfcf5ebe390f2ed15b96a9bee0
75c09fc02ff4eb1cd8af6ecdc88c0947bd12bbae
/lshop_web/src/main/java/com/lshop/web/pay/service/impl/OrderServiceImpl.java
32aded36910a9e911f9b9cd878fedf3b7595203f
[]
no_license
apollo2099/lshop
f8372a3d80ef92958acf403f13d4ee3425b66452
4130d32ce54814b46473380c25c967ded20d2157
refs/heads/master
2020-03-13T15:10:43.574187
2018-05-05T03:45:28
2018-05-05T03:45:28
131,172,292
0
0
null
null
null
null
UTF-8
Java
false
false
6,593
java
package com.lshop.web.pay.service.impl; import java.util.Date; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import javax.annotation.Resource; import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.stereotype.Service; import com.gv.core.datastructure.Dto; import com.gv.core.exception.ServiceException; import com.gv.core.hibernate3.HibernateBaseDAO; import com.gv.core.util.ObjectUtils; import com.gv.core.util.StringUtil; import com.lshop.common.datastructure.ResultMsg; import com.lshop.common.pojo.logic.LvEmailTpl; import com.lshop.common.pojo.logic.LvGroupBuy; import com.lshop.common.pojo.logic.LvOrder; import com.lshop.common.pojo.logic.LvOrderAddress; import com.lshop.common.pojo.logic.LvOrderDetails; import com.lshop.common.pojo.user.LvAccount; import com.lshop.common.util.Constants; import com.lshop.emailsend.service.EmailSendService; import com.lshop.web.activity.service.ActivityService; import com.lshop.web.group.service.GroupService; import com.lshop.web.pay.service.OrderService; @Service("OrderService") public class OrderServiceImpl implements OrderService { private static final Log logger = LogFactory.getLog(OrderServiceImpl.class); @Resource private HibernateBaseDAO lvlogicReadDao; @Resource private HibernateBaseDAO lvlogicWriteDao; @Resource private HibernateBaseDAO lvuserReadDao; @Resource private EmailSendService emailSendService; @Resource private ActivityService activityService; @Resource private GroupService groupService; /** * 修改订单状态 */ @SuppressWarnings( { "unchecked", "unchecked" }) public Boolean updateOrderStatus(Dto dto) throws ServiceException{ String oid = dto.getAsString("oid"); Short payStatus = (Short) dto.get("payStatus");// 获取支付状态 Short status = (Short) dto.get("status");// 订单状态 String thirdpartyorder = dto.getAsString("thirdpartyorder");// 第三方订单 Float totalPrice=(Float) dto.get("totalPrice"); Map param = new HashMap(); String hql = ""; if (status == Constants.ORDER_STATUS_0) {//待付款 hql = "FROM LvOrder WHERE oid=:oid AND payStatus=0 AND status=0";//查询是否是已付款 } if (!"".equals(hql)) { param.put("oid", oid); LvOrder order = (LvOrder) lvlogicReadDao.findUnique(hql, param); if (order != null&&totalPrice!=null&&totalPrice>=order.getTotalPrice()) { String updateString = "UPDATE LvOrder SET payStatus=:payStatus,status=:status,thirdPartyOrder=:thirdpartyorder,overtime=:overtime WHERE id=:id"; param.clear(); Date overtime = null; if (order.getOvertime() == null) { overtime = new Date();//设置支付成功时间 } param.put("id", order.getId()); param.put("payStatus", payStatus); param.put("status", status); param.put("overtime", overtime); param.put("thirdpartyorder", thirdpartyorder); lvlogicWriteDao.update(updateString, param); /** * 发送支付成功提醒邮件 */ if (payStatus == Constants.PAY_STATUS_OK) { param.clear(); hql = "FROM LvOrderAddress WHERE orderId=:orderId"; param.put("orderId", oid); LvOrderAddress lvOrderAdress = (LvOrderAddress) lvlogicReadDao.findUnique(hql, param); Map map = new HashMap(); map.put("storeId", order.getStoreId()); hql="FROM LvEmailTpl WHERE tplKey='PAY_OK_EMAIL_TEMP' and storeId=:storeId"; LvEmailTpl emailTpl=(LvEmailTpl) lvlogicWriteDao.findUnique(hql, map); if(null!=emailTpl){ String mailtemp=emailTpl.getEn()+emailTpl.getZh(); mailtemp=mailtemp.replace("{oid}",order.getOid()); mailtemp=mailtemp.replace("{paymethod}", Constants.PAY_METHODS.get(order.getPaymethod()).toString()); mailtemp=mailtemp.replace("{totalPrice}", order.getTotalPrice().toString()); mailtemp=mailtemp.replace("{relname}", lvOrderAdress.getRelName()); mailtemp=mailtemp.replace("{currency}", order.getCurrency()); mailtemp=mailtemp.replace("{sendtime}",StringUtil.dateFormat(new Date())); dto.put("userEmail", order.getUserEmail()); dto.put("title", emailTpl.getEnTitle().replace("{oid}",order.getOid())); dto.put("content", mailtemp); dto.put("mallFlag", Constants.STORE_TO_MALL_SYSTEM.get(order.getStoreId())); //获取当前店铺所属系统(华扬orBanana) Boolean emailFlag=(boolean)emailSendService.sendEmailNotice(dto);//发邮件 } } return true; } } return false; } @Override public LvOrder getOrder(Dto dto) throws ServiceException { // TODO Auto-generated method stub String oid = dto.getAsString("oid"); Map paramMap=new HashMap(); paramMap.put("oid", oid); return (LvOrder)lvlogicReadDao.findUnique("FROM LvOrder WHERE oid=:oid",paramMap); } @Override public void orderPayCallBack(Dto dto) throws Exception { String oid = dto.getAsString("oid"); String userCode = dto.getAsString("uid"); //获取订单详情,以便找到相应的产品信息 LvOrder order=(LvOrder)lvlogicReadDao.findUniqueByProperty(LvOrder.class, "oid", oid); if (ObjectUtils.isNotEmpty(order)) { if (null!=order.getIsGroup() && order.getIsGroup()==1){ //说明是团购订单 groupService.finishOrderGroup(order); } else { String hql; Map<String, Object> param = new HashMap<String, Object>(); if (StringUtils.isBlank(userCode)) { //查找用户号 hql = "SELECT memid from LvOrder WHERE oid=:oid"; param.put("oid", oid); Integer userid = (Integer) lvlogicReadDao.findUnique(hql, param); hql = "SELECT code FROM LvAccount WHERE id=:userid"; param = new HashMap<String, Object>(); param.put("userid", userid); userCode = lvuserReadDao.findUnique(hql, param).toString(); } //查看订单中商品列表 hql = "from LvOrderDetails where orderId=:oid"; param = new HashMap<String, Object>(); param.put("oid", oid); Map<String, Integer> prodNumMap = new HashMap<String, Integer>(); List<LvOrderDetails> orderDetails = lvlogicReadDao.find(hql, param); for (Iterator<LvOrderDetails> iterator = orderDetails.iterator(); iterator.hasNext();) { LvOrderDetails lvOrderDetails = iterator.next(); prodNumMap.put(lvOrderDetails.getProductCode(), lvOrderDetails.getPnum()); } ResultMsg msg = activityService.finishOrderActivity(oid, userCode, prodNumMap); if (!msg.isSuccess()) { logger.error("订单支付成功回调活动失败:"+oid); } } } } }
[ "liaoxiongjian@globalegrow.com" ]
liaoxiongjian@globalegrow.com
bc738b540632ba5a503b1c0d559133a04fb0e88e
9d9c0d9aba0c3102787a0215621b24dbe7f64b59
/jeecms-common/src/main/java/com/jeecms/common/wechat/bean/request/applet/ChangeVisitstatusRequest.java
b82bf01f598d35321cdd1e90fdd16d0b81f9599d
[]
no_license
hd19901110/jeecms1.4.1test
b354019c57a06384524d53aa667614c1f4e5a743
4e3e0cb31513e53004aa20c108f79741203becb0
refs/heads/master
2022-12-08T06:10:06.868825
2020-08-31T09:59:19
2020-08-31T09:59:19
285,445,431
0
1
null
null
null
null
UTF-8
Java
false
false
826
java
package com.jeecms.common.wechat.bean.request.applet; /** * * @Description: 修改小程序线上代码的可见状态---request * @author: chenming * @date: 2018年10月31日 下午8:23:13 * @Copyright: 江西金磊科技发展有限公司 All rights reserved. * Notice 仅限于授权后使用,禁止非授权传阅以及私自用于商业目的。 */ public class ChangeVisitstatusRequest { /** 设置可访问状态,发布后默认可访问,close为不可见,open为可见*/ private String action; public String getAction() { return action; } public void setAction(String action) { this.action = action; } public ChangeVisitstatusRequest(String action) { super(); this.action = action; } public ChangeVisitstatusRequest() { super(); } }
[ "2638177992@qq.com" ]
2638177992@qq.com
4e41e6d86acfab203ca613c24d392f4ad8914509
05488788d8b120e6198143365a37168bb2ef0cf0
/iteach-service-impl/src/main/java/net/iteach/service/dao/model/TCoordinate.java
a9e996edac938e7f7b9d9a92459696907f9039f2
[]
no_license
dcoraboeuf/iteach-0
e0a271a8498c35acda32ed324bcaf28380549a14
9f4a61273f5fd908f1f92fb91a3ce30858e85b43
refs/heads/master
2020-04-06T03:31:54.713665
2014-04-08T19:43:36
2014-04-08T19:43:36
null
0
0
null
null
null
null
UTF-8
Java
false
false
213
java
package net.iteach.service.dao.model; import lombok.Data; import net.iteach.core.model.CoordinateType; @Data public class TCoordinate { private final CoordinateType type; private final String value; }
[ "damien.coraboeuf@gmail.com" ]
damien.coraboeuf@gmail.com
b8b192fa66229eb22e5ea9f9875d57895b5938bc
13e26f709064e08bfba1539c2ce04acd829e5da2
/src/test/java/com/microsoft/security/jwt/TokenProviderTest.java
31fa39de710b2f90145e867a6440e2794adf4379
[]
no_license
vkacherov/notificationServiceSample
ad5b4a9542e44351e411334b0184e1d3a9a67ca6
45ff82c89b02917439fafe8f7920877e0998cada
refs/heads/master
2021-06-29T01:29:37.852295
2018-05-10T17:33:55
2018-05-10T17:33:55
132,831,564
0
1
null
null
null
null
UTF-8
Java
false
false
3,684
java
package com.microsoft.security.jwt; import com.microsoft.security.AuthoritiesConstants; import io.github.jhipster.config.JHipsterProperties; import io.jsonwebtoken.Jwts; import io.jsonwebtoken.SignatureAlgorithm; import org.junit.Before; import org.junit.Test; import org.mockito.Mockito; import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; import org.springframework.security.core.Authentication; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.authority.SimpleGrantedAuthority; import org.springframework.test.util.ReflectionTestUtils; import java.util.ArrayList; import java.util.Collection; import java.util.Date; import static org.assertj.core.api.Assertions.assertThat; public class TokenProviderTest { private final String secretKey = "e5c9ee274ae87bc031adda32e27fa98b9290da83"; private final long ONE_MINUTE = 60000; private JHipsterProperties jHipsterProperties; private TokenProvider tokenProvider; @Before public void setup() { jHipsterProperties = Mockito.mock(JHipsterProperties.class); tokenProvider = new TokenProvider(jHipsterProperties); ReflectionTestUtils.setField(tokenProvider, "secretKey", secretKey); ReflectionTestUtils.setField(tokenProvider, "tokenValidityInMilliseconds", ONE_MINUTE); } @Test public void testReturnFalseWhenJWThasInvalidSignature() { boolean isTokenValid = tokenProvider.validateToken(createTokenWithDifferentSignature()); assertThat(isTokenValid).isEqualTo(false); } @Test public void testReturnFalseWhenJWTisMalformed() { Authentication authentication = createAuthentication(); String token = tokenProvider.createToken(authentication, false); String invalidToken = token.substring(1); boolean isTokenValid = tokenProvider.validateToken(invalidToken); assertThat(isTokenValid).isEqualTo(false); } @Test public void testReturnFalseWhenJWTisExpired() { ReflectionTestUtils.setField(tokenProvider, "tokenValidityInMilliseconds", -ONE_MINUTE); Authentication authentication = createAuthentication(); String token = tokenProvider.createToken(authentication, false); boolean isTokenValid = tokenProvider.validateToken(token); assertThat(isTokenValid).isEqualTo(false); } @Test public void testReturnFalseWhenJWTisUnsupported() { String unsupportedToken = createUnsupportedToken(); boolean isTokenValid = tokenProvider.validateToken(unsupportedToken); assertThat(isTokenValid).isEqualTo(false); } @Test public void testReturnFalseWhenJWTisInvalid() { boolean isTokenValid = tokenProvider.validateToken(""); assertThat(isTokenValid).isEqualTo(false); } private Authentication createAuthentication() { Collection<GrantedAuthority> authorities = new ArrayList<>(); authorities.add(new SimpleGrantedAuthority(AuthoritiesConstants.ANONYMOUS)); return new UsernamePasswordAuthenticationToken("anonymous", "anonymous", authorities); } private String createUnsupportedToken() { return Jwts.builder() .setPayload("payload") .signWith(SignatureAlgorithm.HS512, secretKey) .compact(); } private String createTokenWithDifferentSignature() { return Jwts.builder() .setSubject("anonymous") .signWith(SignatureAlgorithm.HS512, "e5c9ee274ae87bc031adda32e27fa98b9290da90") .setExpiration(new Date(new Date().getTime() + ONE_MINUTE)) .compact(); } }
[ "jhipster-bot@users.noreply.github.com" ]
jhipster-bot@users.noreply.github.com
67195ba0f56206061d3359405a04a6e6c60dbb90
bf92629bef0dea162c468a9b939dec3ac55ae677
/examples/composition/iot/iot.simpleexpression.ale/src-gen/iot_simpleexpression_exec/revisitor/operations/iot_simpleexpression_exec/InputOperation.java
1caa857001eb914c5097870c7d5dc292ab060a5c
[]
no_license
tdegueul/ale-xbase
32db3ee08792e53769971698962a9dcdc80a90a4
3f6de93c322367fd78b1d4d23b20a24edba268d3
refs/heads/master
2021-01-21T21:15:12.645906
2018-08-27T13:47:15
2018-08-27T13:47:15
98,518,635
1
1
null
null
null
null
UTF-8
Java
false
false
230
java
package iot_simpleexpression_exec.revisitor.operations.iot_simpleexpression_exec; @SuppressWarnings("all") public interface InputOperation extends activitydiagram_exec.revisitor.operations.activitydiagram_exec.InputOperation { }
[ "manuel.leduc@inria.fr" ]
manuel.leduc@inria.fr
e59ed82074295794b2ea9c015c10b51a4bb73ab5
fa1408365e2e3f372aa61e7d1e5ea5afcd652199
/src/testcases/CWE190_Integer_Overflow/s03/CWE190_Integer_Overflow__int_PropertiesFile_square_74b.java
2a64d0df396ce0c9e0e0c04a97190bbaa61ddd46
[]
no_license
bqcuong/Juliet-Test-Case
31e9c89c27bf54a07b7ba547eddd029287b2e191
e770f1c3969be76fdba5d7760e036f9ba060957d
refs/heads/master
2020-07-17T14:51:49.610703
2019-09-03T16:22:58
2019-09-03T16:22:58
206,039,578
1
2
null
null
null
null
UTF-8
Java
false
false
2,343
java
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE190_Integer_Overflow__int_PropertiesFile_square_74b.java Label Definition File: CWE190_Integer_Overflow__int.label.xml Template File: sources-sinks-74b.tmpl.java */ /* * @description * CWE: 190 Integer Overflow * BadSource: PropertiesFile Read data from a .properties file (in property named data) * GoodSource: A hardcoded non-zero, non-min, non-max, even number * Sinks: square * GoodSink: Ensure there will not be an overflow before squaring data * BadSink : Square data, which can lead to overflow * Flow Variant: 74 Data flow: data passed in a HashMap from one method to another in different source files in the same package * * */ package testcases.CWE190_Integer_Overflow.s03; import testcasesupport.*; import java.util.HashMap; import javax.servlet.http.*; public class CWE190_Integer_Overflow__int_PropertiesFile_square_74b { public void badSink(HashMap<Integer,Integer> dataHashMap ) throws Throwable { int data = dataHashMap.get(2); /* POTENTIAL FLAW: if (data*data) > Integer.MAX_VALUE, this will overflow */ int result = (int)(data * data); IO.writeLine("result: " + result); } /* goodG2B() - use GoodSource and BadSink */ public void goodG2BSink(HashMap<Integer,Integer> dataHashMap ) throws Throwable { int data = dataHashMap.get(2); /* POTENTIAL FLAW: if (data*data) > Integer.MAX_VALUE, this will overflow */ int result = (int)(data * data); IO.writeLine("result: " + result); } /* goodB2G() - use BadSource and GoodSink */ public void goodB2GSink(HashMap<Integer,Integer> dataHashMap ) throws Throwable { int data = dataHashMap.get(2); /* FIX: Add a check to prevent an overflow from occurring */ /* NOTE: Math.abs of the minimum int or long will return that same value, so we must check for it */ if ((data != Integer.MIN_VALUE) && (data != Long.MIN_VALUE) && (Math.abs(data) <= (long)Math.sqrt(Integer.MAX_VALUE))) { int result = (int)(data * data); IO.writeLine("result: " + result); } else { IO.writeLine("data value is too large to perform squaring."); } } }
[ "bqcuong2212@gmail.com" ]
bqcuong2212@gmail.com
f89e7f94e2e471c18b33697febf24ac5e4ec3fc6
6baf1fe00541560788e78de5244ae17a7a2b375a
/hollywood/com.oculus.horizon-Horizon/sources/X/AnonymousClass1w5.java
f247fd78ea1351b28fcecf96fc62779e5d05a012
[]
no_license
phwd/quest-tracker
286e605644fc05f00f4904e51f73d77444a78003
3d46fbb467ba11bee5827f7cae7dfeabeb1fd2ba
refs/heads/main
2023-03-29T20:33:10.959529
2021-04-10T22:14:11
2021-04-10T22:14:11
357,185,040
4
2
null
2021-04-12T12:28:09
2021-04-12T12:28:08
null
UTF-8
Java
false
false
206
java
package X; /* renamed from: X.1w5 reason: invalid class name */ public class AnonymousClass1w5 extends AnonymousClass1w6<byte[]> { public AnonymousClass1w5(byte[] bArr) { super(bArr); } }
[ "cyuubiapps@gmail.com" ]
cyuubiapps@gmail.com
71a85e6c4070b309abeddcf4b864ecabfd79e7da
80eb2289f2568fcd385a34f8ef45a8db1859345a
/src/code/Main012.java
38fa27fb887c9b86def986ef685d4a9a803aa962
[]
no_license
twiceyuan/Lanqiao6
c81da24b3853c580ccbed75bd399f86ad1f73020
c031420f151ebde4978c250132b1e7ebea73be93
refs/heads/master
2016-09-06T02:21:25.193034
2015-03-18T03:47:34
2015-03-18T03:47:34
32,215,871
0
0
null
null
null
null
UTF-8
Java
false
false
1,015
java
package code; /** * Created by twiceYuan on 3/18/15. */ public class Main012 { public static void main(String args[]) { //An=sin(1–sin(2+sin(3–sin(4+...sin(n))...) //A3=sin(1-sin(2+sin(3-sin(3)))) int n = 3; System.out.println(getAn(n)); System.out.println(getSn(n)); } private static String getSn(int n) { //Sn=((A1+n) A2+n-1)A3+...+2)An+1 // ((sin(1)+3)sin(1–sin(2))+2)sin(1–sin(2+sin(3)))+1 String temp = getAn(1) + "+" + n; int index = 2; while (index <= n) { int number = n - index + 1; temp = "(" + temp + ")" + getAn(index) + "+" + number; index++; } return temp; } private static String getAn(int n) { String temp = n + ""; n--; while (n > 0) { temp = n + (n % 2 == 0 ? "+" : "-") + "sin(" + temp + ")"; n--; } temp = "sin(" + temp + ")"; return temp; } }
[ "twiceyuan@gmail.com" ]
twiceyuan@gmail.com
3478ed30d0ea3f2189a446079f1d4b324981b3a5
424df50cc846521c366d05fbba4303589853fc03
/app/src/main/java/com/biyoex/app/common/Constants.java
83be8095cb681f5059a059c45542406104f1185f
[]
no_license
niplus/biyoes
cc2198b9303c5981716ddeeefc71124e36bfc722
f4d6e4cc6ac5bed94a8d58f837c7b5309b2ecb74
refs/heads/main
2023-04-10T21:14:56.826444
2021-03-16T09:34:20
2021-03-16T09:34:20
346,194,349
1
0
null
null
null
null
UTF-8
Java
false
false
3,424
java
package com.biyoex.app.common; import java.math.BigDecimal; import java.text.NumberFormat; /** * Created by xxx on 2018/8/8. */ public class Constants { public static String BaseUrl = "https://www.vb.pub";//正式 // public static String BaseUrl = "http://xxly.natapp1.cc";//测试 public static String BASE_URL = BaseUrl + "/api/"; // public static final String REALM_NAME = "http://xxly.natapp1.cc/"; public static String REALM_NAME = BaseUrl; public static String PosRule = REALM_NAME + "/pos/guize"; public static final String ZenkenAccountKey = "HMyFTvomfQLr7wGVnauOVGduVVggA8rI"; /** * b * websocket的base url */ public static String shareId = ""; public static String BaseWebSocketUrl = "wss://www.vb.pub"; public static String WEBSOCKET_URL = BaseWebSocketUrl + "/socket.io/?"; // public static final String WEBSOCKET_URL = "ws://xxly.nat100.top/socket.io/?"; //帮助中心 public static final String HELP_URL = "https://biyoex.com/mobile/#/index"; //提交工单 public static final String POST_IDEA = "https://vbt.zendesk.com/hc/zh-sg/requests/new"; //绑定google操作 public static final String BIND_Google = "https://vbt.zendesk.com/hc/zh-sg/articles/360024239773"; //微信的appId public static final String APP_ID = "wx9ab15729996414bc"; public static String coinName = "VBT";//用來存儲當前是選擇那种币种/默认显示VBT public static String coinGroup = "USDT"; public static boolean isBuy = true; /** * 超时连接30s */ public static final int TIME_OUT = 30 * 1000; /** * 法币C2C支付方式 */ public static class PayType { public static final int ALI_PAY = 1; public static final int WECHAT_PAY = 2; public static final int BANK_PAY = 3; } //EventBus public static final int REFRESH_OTC_ORDER = 0x1; //未读消息 public static final int UNREAD_MESSAGE_EVENT = 0x2; /** * 订单状态变更 */ public static final int ORDER_STATUS_CHANGED = 0x3; /** * 切换语言或者切换模式需要重启 */ public static final int RESTART_EVENT = 0x4; /** * 去除一下小数点 */ public static String numberFormat(double number, int scale) { BigDecimal bigDecimal = new BigDecimal(number); String format = NumberFormat.getInstance().format(bigDecimal.setScale(scale, BigDecimal.ROUND_DOWN).doubleValue()); return format; } public static String numberFormat(double number) { BigDecimal bigDecimal = new BigDecimal(number); String format = NumberFormat.getInstance().format(bigDecimal.setScale(0, BigDecimal.ROUND_DOWN).doubleValue()); return format; } /** * 请求网络失败原因 */ public static class ExceptionReason { /** * 解析数据失败C */ public static final int PARSE_ERROR = 0x0; /** * 网络问题 */ public static final int BAD_NETWORK = 0x2; /** * 连接错误 */ public static final int CONNECT_ERROR = 0x3; /** * 连接超时 */ public static final int CONNECT_TIMEOUT = 0x4; /** * 未知错误 */ public static final int UNKNOWN_ERROR = 0x5; } }
[ "841270527@qq.com" ]
841270527@qq.com
d3d3abe87f0259c2c3d36a25369dfc0140079ce3
c5f6be1c13ab1d0c99b597130443273e13bc06e7
/flinglistview/src/main/java/cn/teachcourse/view/SlidingRemovedToLeftListView.java
7feb236260d47e9e07476b970e810e5f9b8becc6
[]
no_license
chenzhe/BlogSource
e82a0648b6addebbe0ab6f4da3ae8c1f03e42852
284bd5e1131b98923076c88f356831623e315d94
refs/heads/master
2021-02-06T10:16:36.754496
2018-06-07T08:09:10
2018-06-07T08:09:10
null
0
0
null
null
null
null
UTF-8
Java
false
false
7,708
java
package cn.teachcourse.view; import android.content.Context; import android.util.AttributeSet; import android.view.MotionEvent; import android.view.VelocityTracker; import android.view.View; import android.view.ViewConfiguration; import android.widget.ListAdapter; import android.widget.ListView; import android.widget.Scroller; /** * Created by 钊林IT on 2018/1/29. */ public class SlidingRemovedToLeftListView extends ListView { private static final String TAG = "FlingRemovedListView3"; private static final int SNAP_VELOCITY = 600; private static final int SLIDE_MASK = 0x1;//是否可以滑动 private static final int DELETE_VISIBLE_MASK = SLIDE_MASK << 1;//是否滑出删除按钮 private int flags;//标识位 private Scroller scroller; private VelocityTracker velocityTracker; private float preX; //手指滑动过程中上一个点的 x 坐标 private float firstX, firstY; //手指第一次按下的点的 x 坐标和 y 坐标 private SlidingRemovedItemToLeft willFlingView;//要滑动的列表项 View private int position = INVALID_POSITION;//要滑动的列表项 View 的索引位置 private int touchSlop;//最小滑动距离 private OnItemRemovedListener onItemRemovedListener; public SlidingRemovedToLeftListView(Context context) { this(context, null); } public SlidingRemovedToLeftListView(Context context, AttributeSet attrs) { this(context, attrs, 0); } public SlidingRemovedToLeftListView(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); scroller = new Scroller(context); touchSlop = ViewConfiguration.get(context).getScaledTouchSlop(); } @Override public boolean dispatchTouchEvent(MotionEvent ev) { int action = ev.getAction(); int x = (int) ev.getX(); int y = (int) ev.getY(); obtainVelocity(ev); switch (action) { case MotionEvent.ACTION_DOWN: if (!scroller.isFinished()) return super.dispatchTouchEvent(ev); firstX = preX = x; firstY = y; //确定点击的item position = this.pointToPosition(x, y); if (position != INVALID_POSITION) { int visibleIndex = position - getFirstVisiblePosition(); willFlingView = (SlidingRemovedItemToLeft) getChildAt(visibleIndex); doDelete(willFlingView); } //恢复已经滑动的item restoreListItems(); break; case MotionEvent.ACTION_MOVE: //标记是否满足滑动条件 float xVelocity = velocityTracker.getXVelocity(); if ((Math.abs(xVelocity) > SNAP_VELOCITY || Math.abs(x - firstX) > touchSlop && Math.abs(y - firstY) < touchSlop)) flags |= SLIDE_MASK; break; case MotionEvent.ACTION_UP: //恢复已经滑动的item releaseVelocity(); break; } return super.dispatchTouchEvent(ev); } @Override public boolean onTouchEvent(MotionEvent ev) { if ((flags & SLIDE_MASK) == SLIDE_MASK && position != INVALID_POSITION && willFlingView != null) { float x = (int) ev.getX(); switch (ev.getAction()) { case MotionEvent.ACTION_DOWN: break; case MotionEvent.ACTION_MOVE: float dx = preX - x; willFlingView.scrollBy((int) dx, 0); preX = x; break; case MotionEvent.ACTION_CANCEL: case MotionEvent.ACTION_UP: int deleteButtonWidth = willFlingView.getDeleteButton().getWidth(); //判断是否向右滑动 if (x < firstX && Math.abs(x - firstX) >= deleteButtonWidth * 0.8) { forwardToLeft(); } else if (x > firstX || Math.abs(x - firstX) < deleteButtonWidth * 0.8) { rollbackToRight(); } postInvalidate(); flags &= ~SLIDE_MASK;//左右滑动已取消 } return true; } return super.onTouchEvent(ev); } @Override public void computeScroll() { if (scroller.computeScrollOffset()) { willFlingView.scrollTo(scroller.getCurrX(), 0); postInvalidate(); } } public void setOnItemRemovedListener( OnItemRemovedListener onItemRemovedListener) { this.onItemRemovedListener = onItemRemovedListener; } private void obtainVelocity(MotionEvent event) { if (velocityTracker == null) { velocityTracker = VelocityTracker.obtain(); } velocityTracker.addMovement(event); } private void releaseVelocity() { if (velocityTracker != null) { velocityTracker.clear(); velocityTracker.recycle(); velocityTracker = null; } } /** * 继续向左滑动 */ private void forwardToLeft() { int scrollX = willFlingView.getScrollX(); int deleteButtonWidth = willFlingView.getDeleteButton().getWidth(); int remain = deleteButtonWidth - scrollX; //继续滑动 scroller.startScroll(scrollX, 0, remain, 0, Math.abs(remain)); //设置删除按钮滑出标识 flags |= DELETE_VISIBLE_MASK; } /** * 向右回退 */ private void rollbackToRight() { int scrollX = willFlingView.getScrollX(); int deleteButtonWidth = willFlingView.getDeleteButton().getWidth(); int remain = deleteButtonWidth + scrollX; scroller.startScroll(scrollX, 0, -remain, 0, Math.abs(remain)); //取消删除按钮滑出标识 flags &= ~DELETE_VISIBLE_MASK; } /** * 恢复所有列表项的状态 */ private void restoreListItems() { for (int i = 0; i < getChildCount(); i++) { View child = getChildAt(i); if (child instanceof SlidingRemovedItemToLeft) { SlidingRemovedItemToLeft childLayout = (SlidingRemovedItemToLeft) child; if (willFlingView != childLayout) { int deleteButtonWidth = willFlingView.getDeleteButton().getWidth(); childLayout.scrollTo(-deleteButtonWidth, 0); } } } } /** * 执行删除 * * @param slidingRemovedItemToLeft */ private void doDelete(SlidingRemovedItemToLeft slidingRemovedItemToLeft) { View deleteButton = slidingRemovedItemToLeft.getDeleteButton(); if (deleteButton == null) return; deleteButton.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { if (onItemRemovedListener != null) { //回调 onItemRemovedListener.itemRemoved(position, getAdapter()); rollbackToRight(); } } }); } /** * 删除列表项的回调接口 */ public interface OnItemRemovedListener { /** * 删除列表项 * * @param position 删除的列表项索引 * @param adapter 适配器 */ void itemRemoved(int position, ListAdapter adapter); } }
[ "123456" ]
123456
e6750e566c4b1eec81b57787fa8feb53e73d5a09
d2e5278751d4f02f9909b6e3f342c83b4d2beecd
/src/lec12/ex09/v3/PlaylistFormatException.java
412bed467c4716376872ae416e11d96a9aa97321
[]
no_license
Spring2020COMP401-001/Lec12
318253030a2ab1e85f64da4d5c5e1cdd3292fa0e
f370be1ed446786b39021c13c6983ece71db0050
refs/heads/master
2021-01-06T07:20:52.039425
2020-02-18T01:25:54
2020-02-18T01:25:54
241,244,448
0
1
null
null
null
null
UTF-8
Java
false
false
154
java
package lec12.ex09.v3; public class PlaylistFormatException extends Exception { public PlaylistFormatException(String message) { super(message); } }
[ "kmp@cs.unc.edu" ]
kmp@cs.unc.edu
54669afc8592693b49708b4d66fc84942e2c9d9d
4ca55f971655ae0b320a0d792f7dba3777cc4664
/tests/org.jboss.tools.freemarker.ui.bot.test/src/org/jboss/tools/freemarker/ui/bot/test/FreemarkerPreferencePage.java
573576e5ffd9823edf454d3bdb06d023bf0adda8
[]
no_license
apodhrad/jbosstools-integration-tests
40d2b61c29a402104e8056c7ea71578f821cd4c7
6d45589002c2c1fa57dd0171c32fdfaec87210b8
refs/heads/master
2021-01-16T19:44:42.784600
2014-01-10T09:28:53
2014-01-10T09:34:01
null
0
0
null
null
null
null
UTF-8
Java
false
false
565
java
package org.jboss.tools.freemarker.ui.bot.test; import org.jboss.reddeer.eclipse.jface.preference.PreferencePage; import org.jboss.reddeer.swt.impl.button.CheckBox; public class FreemarkerPreferencePage extends PreferencePage { public FreemarkerPreferencePage() { super("FreeMarker Editor"); } public void setHighLightRelatedDirectives(boolean value) { CheckBox cb = new CheckBox("Highlight Related Directives"); cb.toggle(value); } public boolean getHighLightRelatedDirectives() { CheckBox b = new CheckBox(); return b.isChecked(); } }
[ "vpakan@redhat.com" ]
vpakan@redhat.com
8058869d8d83f1cdd2f1182b2e93ce32ebb64819
86505462601eae6007bef6c9f0f4eeb9fcdd1e7b
/bin/modules/b2b-commerce/b2bapprovalprocess/testsrc/de/hybris/platform/b2b/services/impl/DefaultB2BEmailServiceMockTest.java
04e51b4e1999f472f72f4d4a28d0f179f57ab6f6
[]
no_license
jp-developer0/hybrisTrail
82165c5b91352332a3d471b3414faee47bdb6cee
a0208ffee7fee5b7f83dd982e372276492ae83d4
refs/heads/master
2020-12-03T19:53:58.652431
2020-01-02T18:02:34
2020-01-02T18:02:34
231,430,332
0
4
null
2020-08-05T22:46:23
2020-01-02T17:39:15
null
UTF-8
Java
false
false
6,325
java
/* * Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. */ package de.hybris.platform.b2b.services.impl; import static org.mockito.Matchers.any; import static org.mockito.Matchers.anyString; import static org.mockito.Mockito.doAnswer; import static org.mockito.Mockito.mock; import de.hybris.bootstrap.annotations.UnitTest; import de.hybris.platform.b2b.dao.PrincipalGroupMembersDao; import de.hybris.platform.b2b.dao.impl.BaseDao; import de.hybris.platform.b2b.dao.impl.DefaultB2BWorkflowActionDao; import de.hybris.platform.b2b.dao.impl.DefaultB2BWorkflowDao; import de.hybris.platform.b2b.mail.OrderInfoContextDtoFactory; import de.hybris.platform.b2b.mail.impl.OrderInfoContextDto; import de.hybris.platform.b2b.mock.HybrisMokitoTest; import de.hybris.platform.b2b.model.B2BBudgetModel; import de.hybris.platform.b2b.model.B2BCustomerModel; import de.hybris.platform.b2b.model.B2BUnitModel; import de.hybris.platform.b2b.process.approval.actions.B2BPermissionResultHelperImpl; import de.hybris.platform.b2b.services.B2BApproverService; import de.hybris.platform.b2b.services.B2BBudgetService; import de.hybris.platform.b2b.services.B2BCartService; import de.hybris.platform.b2b.services.B2BCurrencyConversionService; import de.hybris.platform.b2b.services.B2BCustomerService; import de.hybris.platform.b2b.services.B2BUnitService; import de.hybris.platform.commons.model.renderer.RendererTemplateModel; import de.hybris.platform.commons.renderer.RendererService; import de.hybris.platform.core.Registry; import de.hybris.platform.core.model.order.OrderModel; import de.hybris.platform.orderscheduling.ScheduleOrderService; import de.hybris.platform.servicelayer.i18n.CommonI18NService; import de.hybris.platform.servicelayer.type.impl.DefaultTypeService; import de.hybris.platform.servicelayer.user.UserService; import de.hybris.platform.workflow.WorkflowActionService; import de.hybris.platform.workflow.WorkflowAttachmentService; import de.hybris.platform.workflow.WorkflowProcessingService; import de.hybris.platform.workflow.WorkflowService; import de.hybris.platform.workflow.WorkflowTemplateService; import java.io.StringWriter; import javax.mail.internet.InternetAddress; import org.junit.Before; import org.junit.Ignore; import org.junit.Test; import org.mockito.Mock; import org.mockito.Mockito; import org.mockito.invocation.InvocationOnMock; import org.mockito.stubbing.Answer; @Ignore @UnitTest public class DefaultB2BEmailServiceMockTest extends HybrisMokitoTest { private final DefaultB2BEmailService b2BEmailService = new DefaultB2BEmailService(); @Mock private UserService mockUserService; @Mock private BaseDao mockBaseDao; @Mock private B2BUnitService<B2BUnitModel, B2BCustomerModel> mockB2bUnitService; @Mock private CommonI18NService mockCommonI18NService; @Mock private DefaultB2BWorkflowDao mockB2BWorkflowDao; @Mock private DefaultB2BWorkflowActionDao mockB2BWorkflowActionDao; @Mock private WorkflowActionService mockwWorkflowActionService; @Mock private WorkflowAttachmentService mockwWorkflowAttachmentService; @Mock private WorkflowProcessingService mockWorkflowProcessingService; @Mock private WorkflowService mockWorkflowService; @Mock private WorkflowTemplateService mockWorkflowTemplateService; @Mock private OrderInfoContextDtoFactory orderInfoContextDtoFactory; @Mock private RendererService rendererService; @Mock private B2BCurrencyConversionService mockB2BCurrencyConversionService; @Mock private B2BBudgetService<B2BBudgetModel, B2BCustomerModel> b2BudgetService; @Mock private B2BCartService mockB2BCartService; @Mock private B2BCustomerService<B2BCustomerModel, B2BUnitModel> mockB2BCustomerService; @Mock private ScheduleOrderService mockScheduleOrderService; @Mock private B2BApproverService mockB2BApproverService; @Mock private B2BPermissionResultHelperImpl mockB2BPermissionResultHelperImpl; @Mock private DefaultTypeService mockTypeService; @Mock private PrincipalGroupMembersDao mockPrincipalGroupMemberDao; @Mock private RendererTemplateModel rendererTemplateModel; @Mock private StringWriter mailMessageWriter; @Before public void setUp() throws Exception { Registry.activateMasterTenant(); b2BEmailService.setOrderInfoContextDtoFactory(orderInfoContextDtoFactory); b2BEmailService.setRendererService(rendererService); Mockito.when(rendererService.getRendererTemplateForCode(anyString())).thenReturn(rendererTemplateModel); } @Test public void testCreateOrderApprovalEmail() throws Exception { final InternetAddress from = new InternetAddress("test@test.com"); final String emailTemplateCode = "order_confirmation"; final String subject = "Order Approved"; final OrderModel order = mock(OrderModel.class); final OrderInfoContextDto ctx = mock(OrderInfoContextDto.class); final B2BCustomerModel user = mock(B2BCustomerModel.class); Mockito.when(user.getEmail()).thenReturn("test@test.com"); Mockito.when(ctx.getOrderNumber()).thenReturn("123"); Mockito.when(orderInfoContextDtoFactory.createOrderInfoContextDto(order)).thenReturn(ctx); b2BEmailService.createOrderApprovalEmail(emailTemplateCode, order, user, from, subject); doAnswer(new Answer<Object>() { @Override public Object answer(final InvocationOnMock invocation) { final Object[] args = invocation.getArguments(); ((StringWriter) args[2]).append("fake email body"); invocation.getMock(); return null; } }).when(rendererService).render(any(RendererTemplateModel.class), any(OrderInfoContextDto.class), any(StringWriter.class)); } @Test public void testCreateOrderRejectionEmail() throws Exception { final InternetAddress from = new InternetAddress("test@test.com"); final String emailTemplateCode = "order_rejection"; final String subject = "Order Rejected"; final OrderModel order = mock(OrderModel.class); final OrderInfoContextDto ctx = mock(OrderInfoContextDto.class); final B2BCustomerModel user = mock(B2BCustomerModel.class); Mockito.when(user.getEmail()).thenReturn("test@test.com"); Mockito.when(ctx.getOrderNumber()).thenReturn("123"); Mockito.when(orderInfoContextDtoFactory.createOrderInfoContextDto(order)).thenReturn(ctx); b2BEmailService.createOrderRejectionEmail(emailTemplateCode, order, user, from, subject); } }
[ "juan.gonzalez.working@gmail.com" ]
juan.gonzalez.working@gmail.com
b2d2d8291b172890145a86cac1068f5807856215
208ba847cec642cdf7b77cff26bdc4f30a97e795
/ee/ef/src/main/java/org.xmlrpc.ef/XMLRPCException.java
248d5cb95b7ce0737e4a56afc57152d9462feb4a
[]
no_license
kageiit/perf-android-large
ec7c291de9cde2f813ed6573f706a8593be7ac88
2cbd6e74837a14ae87c1c4d1d62ac3c35df9e6f8
refs/heads/master
2021-01-12T14:00:19.468063
2016-09-27T13:10:42
2016-09-27T13:10:42
69,685,305
0
0
null
2016-09-30T16:59:49
2016-09-30T16:59:48
null
UTF-8
Java
false
false
310
java
package org.xmlrpc.ef; public class XMLRPCException extends Exception { /** * */ private static final long serialVersionUID = 7499675036625522379L; public XMLRPCException(Exception e) { super(e); } public XMLRPCException(String string) { super(string); } }
[ "cedric.champeau@gmail.com" ]
cedric.champeau@gmail.com
bdb27407187f1a6c51d52630e0fc12de6d5254dc
c804b9820bca225f4ed6be161a83869b7aee20ba
/app/src/main/java/cn/bjhdltcdn/p2plive/widget/PkCoverVideoPlayer.java
db065407e8c9c1cb200d6342a434c6d5c57c931a
[]
no_license
led-os/youban
5075817d649c516dec9ab6716b560b08d2844003
56ff42280cfd8e0a04038b365fd710ce212fa4d8
refs/heads/master
2021-09-27T19:51:26.126774
2018-11-11T03:04:26
2018-11-11T03:04:26
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,303
java
package cn.bjhdltcdn.p2plive.widget; import android.content.Context; import android.util.AttributeSet; import android.widget.ImageView; import com.bumptech.glide.Glide; import com.bumptech.glide.request.RequestOptions; import com.shuyu.gsyvideoplayer.video.StandardGSYVideoPlayer; import com.shuyu.gsyvideoplayer.video.base.GSYBaseVideoPlayer; import cn.bjhdltcdn.p2plive.R; /** * Created by xiawenquan on 18/3/30. */ public class PkCoverVideoPlayer extends StandardGSYVideoPlayer { ImageView mCoverImage; String mCoverOriginUrl; int mDefaultRes; public PkCoverVideoPlayer(Context context, Boolean fullFlag) { super(context, fullFlag); } public PkCoverVideoPlayer(Context context) { super(context); } public PkCoverVideoPlayer(Context context, AttributeSet attrs) { super(context, attrs); } @Override protected void init(Context context) { super.init(context); mCoverImage = findViewById(R.id.thumbImage); if (mThumbImageViewLayout != null && (mCurrentState == -1 || mCurrentState == CURRENT_STATE_NORMAL || mCurrentState == CURRENT_STATE_ERROR)) { mThumbImageViewLayout.setVisibility(VISIBLE); } } @Override public int getLayoutId() { return R.layout.pk_cover_video_player_layout; } public void loadCoverImage(String url, int res) { mCoverOriginUrl = url; mDefaultRes = res; Glide.with(getContext().getApplicationContext()) .setDefaultRequestOptions( new RequestOptions() .frame(1000000) .centerCrop() .error(res) .placeholder(res)) .load(url) .into(mCoverImage); } @Override public GSYBaseVideoPlayer startWindowFullscreen(Context context, boolean actionBar, boolean statusBar) { GSYBaseVideoPlayer gsyBaseVideoPlayer = super.startWindowFullscreen(context, actionBar, statusBar); PkCoverVideoPlayer sampleCoverVideo = (PkCoverVideoPlayer) gsyBaseVideoPlayer; sampleCoverVideo.loadCoverImage(mCoverOriginUrl, mDefaultRes); return gsyBaseVideoPlayer; } }
[ "782891615@qq.com" ]
782891615@qq.com
5a1d026135edc2e1c3aa3ac5b9ed4a389feaeeb4
26f4683e1a6522433e8d66e0a998395b72ea668c
/src/main/java/com/hien/project/service/CourseServiceImpl.java
af928aff49a651d262879f278d1af72800a621c9
[]
no_license
hiejulia/elearning-platform
6cc5c8abc1e1706101c0f42a4cc803a28b12ca33
dc0b63e3c1d87ac7504e5cefc91b1912437487b6
refs/heads/master
2020-03-07T11:31:57.106581
2018-03-31T18:43:00
2018-03-31T18:43:00
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,139
java
package com.hien.project.service; import com.hien.project.domain.*; import com.hien.project.domain.es.EsCourse; import com.hien.project.repository.CourseRepository; import com.hien.project.service.es.EsCourseService; import org.springframework.stereotype.Service; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; //import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.stereotype.Service; import javax.transaction.Transactional; @Service public class CourseServiceImpl implements CourseService { @Autowired private CourseRepository courseRepository; @Autowired private EsCourseService esCourseService; @Transactional @Override public Course saveCourse(Course course) { boolean isNew = (course.getId()==null); EsCourse esCourse = null; Course returnCourse=courseRepository.save(course); if(isNew){ esCourse=new EsCourse(returnCourse); }else{ esCourse=esCourseService.getEsCourseByCourseId(course.getId()); esCourse.update(returnCourse); } esCourseService.updateEsCourse(esCourse); return returnCourse; } @Transactional @Override public void removeCourse(Long id) { courseRepository.delete(id); EsCourse esCourse=esCourseService.getEsCourseByCourseId(id);//es中nosql数据库中的博客数据也进行删除 esCourseService.removeEsCourse(esCourse.getId()); } @Override public Course getCourseById(Long id) { return courseRepository.findOne(id); } @Override public Page<Course> listCoursesByTitleVote(User user, String title, Pageable pageable) { title = "%" + title + "%"; Page<Course> courses = courseRepository.findByUserAndTitleLike(user, title, pageable); return courses; } @Override public Page<Course> listCoursesByTitleVoteAndSort(User user, String title, Pageable pageable) { title = "%" + title + "%"; String tags = title; Page<Course> courses = courseRepository .findByTitleLikeAndUserOrTagsLikeAndUserOrderByCreateTimeDesc(user, tags, pageable); return courses; } @Override public void readingIncrease(Long id) { Course course = courseRepository.findOne(id); course.setReadSize(course.getReadSize() + 1); this.saveCourse(course); } @Override public Course createComment(Long courseId, String commentContent) { Course originalCourse = courseRepository.findOne(courseId); User user = (User) SecurityContextHolder.getContext().getAuthentication().getPrincipal();//获取当前用户信息 Comment comment = new Comment(user, commentContent); originalCourse.addComment(comment); return this.saveCourse(originalCourse); } @Override public void removeComment(Long courseId, Long commentId) { Course originalCourse = courseRepository.findOne(courseId); originalCourse.removeComment(commentId); this.saveCourse(originalCourse); } @Override public Course createVote(Long courseId) { Course originalCourse = courseRepository.findOne(courseId); User user = (User) SecurityContextHolder.getContext().getAuthentication().getPrincipal(); Vote vote = new Vote(user); boolean isExist = originalCourse.addVote(vote); if(isExist){ throw new IllegalArgumentException("该用户已经点过赞了"); } return this.saveCourse(originalCourse); } @Override public void removeVote(Long courseId, Long voteId) { Course originalCourse = courseRepository.findOne(courseId); originalCourse.removeVote(voteId); this.saveCourse(originalCourse); } @Override public Page<Course> listCoursesByCatalog(Catalog catalog, Pageable pageable) { Page<Course> courses=courseRepository.findByCatalog(catalog,pageable); return courses; } }
[ "hienminhnguyen711@gmail.com" ]
hienminhnguyen711@gmail.com
62fe94a6b4308bd853fa73bc382384c5dbff1d69
0bf22c62ed79475cb11a92f8a8a53ada49ae35a0
/src/TestNg/annotation3.java
c8b8052cd9b76793ceaf853c79bd157be3c7f675
[]
no_license
nabin-maity/Selenium
8449c32a880b0d79f9a4b82c788a8feac3483bab
6e2bc289e318e126d88b15904e57280be41ddee0
refs/heads/master
2020-04-12T21:58:23.087314
2018-12-22T03:27:30
2018-12-22T03:27:30
162,777,823
0
0
null
null
null
null
UTF-8
Java
false
false
316
java
package TestNg; import org.testng.Reporter; import org.testng.annotations.Test; public class annotation3 { //************** invocation (to run more than 1 time we use invocation)****************) @Test(invocationCount=5) public void script5() { Reporter.log("Script 5", true); } }
[ "user@user-PC" ]
user@user-PC
90b7b474e319588788df22102af188c9b39c0de9
256e48674780b67ffe43e05dfff8256303f7761a
/app/src/main/java/com/mdsd/telemedicine/Http/ApiStrategy.java
2ec14091642210f4c52e308f645b496640edda16
[]
no_license
zhangzzqq/remotegit
4a2f54ef23d267140a698c970cd6a6b653ad8e70
d144af2f9c9c0f78495ccc8beae99e9432aa4c88
refs/heads/master
2021-05-04T16:00:42.253235
2018-08-28T09:37:05
2018-08-28T09:40:48
120,243,238
0
0
null
null
null
null
UTF-8
Java
false
false
5,986
java
package com.mdsd.telemedicine.Http; import android.content.Context; import android.text.TextUtils; import android.util.Log; import com.mdsd.telemedicine.BuildConfig; import com.mdsd.telemedicine.base.BaseApplication; import com.mdsd.telemedicine.utils.NetWorkUtils; import java.io.File; import java.io.IOException; import java.util.concurrent.TimeUnit; import okhttp3.Cache; import okhttp3.CacheControl; import okhttp3.Interceptor; import okhttp3.OkHttpClient; import okhttp3.Request; import okhttp3.Response; import okhttp3.logging.HttpLoggingInterceptor; import retrofit2.Retrofit; import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory; import retrofit2.converter.gson.GsonConverterFactory; /** * Created by DeMon on 2017/9/6. */ public class ApiStrategy { public static String baseUrl = "https://api.douban.com/v2/movie/"; //读超时长,单位:毫秒 public static final int READ_TIME_OUT = 7676; //连接时长,单位:毫秒 public static final int CONNECT_TIME_OUT = 7676; private static final String TAG ="ApiStrategy"; public static ApiService apiService; public static ApiService getApiService() { if (apiService == null) { synchronized (ApiStrategy.class) { if (apiService == null) { new ApiStrategy(); } } } return apiService; } private ApiStrategy() { HttpLoggingInterceptor logInterceptor = new HttpLoggingInterceptor(); if (BuildConfig.DEBUG) { logInterceptor.setLevel(HttpLoggingInterceptor.Level.BODY); } else { logInterceptor.setLevel(HttpLoggingInterceptor.Level.BASIC); } //缓存 Cache cache=null; if(BaseApplication.getContext().getCacheDir()!=null){ File cacheFile = new File(BaseApplication.getContext().getCacheDir(), "cache"); cache = new Cache(cacheFile, 1024 * 1024 * 100); //100Mb } //增加头部信息 Interceptor headerInterceptor = new Interceptor() { @Override public Response intercept(Chain chain) throws IOException { Request build = chain.request().newBuilder() // .addHeader("Content-Type", "application/json")//设置允许请求json数据 .build(); return chain.proceed(build); } }; //创建一个OkHttpClient并设置超时时间 OkHttpClient client = new OkHttpClient.Builder() .readTimeout(READ_TIME_OUT, TimeUnit.MILLISECONDS) .connectTimeout(CONNECT_TIME_OUT, TimeUnit.MILLISECONDS) .addInterceptor(mRewriteCacheControlInterceptor) .addNetworkInterceptor(mRewriteCacheControlInterceptor) .addInterceptor(headerInterceptor) .addInterceptor(logInterceptor) .cache(cache) .build(); Retrofit retrofit = new Retrofit.Builder() .client(client) .baseUrl(baseUrl) .addConverterFactory(GsonConverterFactory.create())//请求的结果转为实体类 //适配RxJava2.0,RxJava1.x则为RxJavaCallAdapterFactory.create() .addCallAdapterFactory(RxJava2CallAdapterFactory.create()) .build(); apiService = retrofit.create(ApiService.class); } /** * 设缓存有效期为两天 */ private static final long CACHE_STALE_SEC = 60 * 60 * 24 * 2; /** * 云端响应头拦截器,用来配置缓存策略 * Dangerous interceptor that rewrites the server's cache-control header. */ private final Interceptor mRewriteCacheControlInterceptor = new Interceptor() { @Override public Response intercept(Chain chain) throws IOException { Request request = chain.request(); String cacheControl = request.cacheControl().toString(); if (!NetWorkUtils.isNetConnected(BaseApplication.getContext())) { request = request.newBuilder() .cacheControl(TextUtils.isEmpty(cacheControl) ? CacheControl .FORCE_NETWORK : CacheControl.FORCE_CACHE) .build(); } Response originalResponse = chain.proceed(request); if (NetWorkUtils.isNetConnected(BaseApplication.getContext())) { return originalResponse.newBuilder() .header("Cache-Control", cacheControl) .removeHeader("Pragma") .build(); } else { return originalResponse.newBuilder() .header("Cache-Control", "public, only-if-cached, max-stale=" + CACHE_STALE_SEC) .removeHeader("Pragma") .build(); } } }; // public class HttpLogger implements HttpLoggingInterceptor.Logger { // @Override // public void log(String message) { // Log.d("HttpLogInfo", message); // } // } // public static File getPhotoCacheDir(Context context, File file) { // File cacheDir = context.getCacheDir(); // if (cacheDir != null) { // File mCacheDir = new File(cacheDir,"cache"); // if (!mCacheDir.mkdirs() && (!mCacheDir.exists() || !mCacheDir.isDirectory())) { // return file; // }else { // return new File(mCacheDir, file.getName()); // } // } // if (Log.isLoggable(TAG, Log.ERROR)) { // Log.e(TAG, "default disk cache dir is null"); // } // return file; // } }
[ "zhangqihappyzq@163.com" ]
zhangqihappyzq@163.com
78ef2816ce0915ee871e343a55ceb4a5a39f0d5a
d4506724ba8a4f2ae64b999d9e6631c7a149b45c
/src/main/java/yd/swig/_GBufferedOutputStreamClass.java
47ae4be46d37ca64b6952b8e8939c64a3f5b5295
[]
no_license
ydaniels/frida-java
6dc70b327ae8e8a6d808a0969e861225dcc0192b
cf3c198b2a4b7c7a3a186359b5c8c768deacb285
refs/heads/master
2022-12-08T21:28:27.176045
2019-10-24T09:51:44
2019-10-24T09:51:44
214,268,850
2
1
null
2022-11-25T19:46:38
2019-10-10T19:30:26
Java
UTF-8
Java
false
false
2,422
java
/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package yd.swig; public class _GBufferedOutputStreamClass { private transient long swigCPtr; protected transient boolean swigCMemOwn; protected _GBufferedOutputStreamClass(long cPtr, boolean cMemoryOwn) { swigCMemOwn = cMemoryOwn; swigCPtr = cPtr; } protected static long getCPtr(_GBufferedOutputStreamClass obj) { return (obj == null) ? 0 : obj.swigCPtr; } @SuppressWarnings("deprecation") protected void finalize() { delete(); } public synchronized void delete() { if (swigCPtr != 0) { if (swigCMemOwn) { swigCMemOwn = false; fridacoreJNI.delete__GBufferedOutputStreamClass(swigCPtr); } swigCPtr = 0; } } public void setParent_class(_GFilterOutputStreamClass value) { fridacoreJNI._GBufferedOutputStreamClass_parent_class_set(swigCPtr, this, _GFilterOutputStreamClass.getCPtr(value), value); } public _GFilterOutputStreamClass getParent_class() { long cPtr = fridacoreJNI._GBufferedOutputStreamClass_parent_class_get(swigCPtr, this); return (cPtr == 0) ? null : new _GFilterOutputStreamClass(cPtr, false); } public void set_g_reserved1(SWIGTYPE_p_f_void__void value) { fridacoreJNI._GBufferedOutputStreamClass__g_reserved1_set(swigCPtr, this, SWIGTYPE_p_f_void__void.getCPtr(value)); } public SWIGTYPE_p_f_void__void get_g_reserved1() { long cPtr = fridacoreJNI._GBufferedOutputStreamClass__g_reserved1_get(swigCPtr, this); return (cPtr == 0) ? null : new SWIGTYPE_p_f_void__void(cPtr, false); } public void set_g_reserved2(SWIGTYPE_p_f_void__void value) { fridacoreJNI._GBufferedOutputStreamClass__g_reserved2_set(swigCPtr, this, SWIGTYPE_p_f_void__void.getCPtr(value)); } public SWIGTYPE_p_f_void__void get_g_reserved2() { long cPtr = fridacoreJNI._GBufferedOutputStreamClass__g_reserved2_get(swigCPtr, this); return (cPtr == 0) ? null : new SWIGTYPE_p_f_void__void(cPtr, false); } public _GBufferedOutputStreamClass() { this(fridacoreJNI.new__GBufferedOutputStreamClass(), true); } }
[ "yomi@erpsoftapp.com" ]
yomi@erpsoftapp.com
8a1e60b31d46abcba8a63715d81bcc67b33c96a6
7731416ca9afff3e69141d5d0087c193ca3e7180
/src/CAL_Platform/src/org/openquark/cal/services/UserResourcePathStoreHelper.java
1fa51bd1c243dc36f653a8ff4e8c40f56a60e451
[]
no_license
rdwebster/Open-Quark
288d38f823e21ec2e338adb2d05f3e05b027f603
86397b53eea2518851b4995edae2aa687f8d8812
refs/heads/master
2021-01-20T15:50:03.540743
2014-07-23T18:11:37
2014-07-23T18:11:37
481,429
0
0
null
null
null
null
UTF-8
Java
false
false
3,081
java
/* * Copyright (c) 2007 BUSINESS OBJECTS SOFTWARE LIMITED * 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 Business Objects nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ /* * UserResourcePathStoreHelper.java * Creation date: Jun 2, 2006. * By: Joseph Wong */ package org.openquark.cal.services; import java.util.ArrayList; import java.util.List; import org.openquark.cal.compiler.ModuleName; /** * This is a helper class which contains methods to determine which features are * present in a user resource path store. * * @author Joseph Wong */ class UserResourcePathStoreHelper { /** * Private constructor. */ private UserResourcePathStoreHelper() { } /** * Get the names of resources associated with the module. * @param pathStore the path store. * @param moduleName the name of a module. * @return the names of resources associated with the module. */ public static List<ResourceName> getModuleResourceNameList(AbstractResourcePathStore pathStore, ModuleName moduleName) { List<ResourceName> result = new ArrayList<ResourceName>(); ResourcePath.Folder moduleFolder = (ResourcePath.Folder)((ResourcePathMapper.Module)pathStore.getPathMapper()).getModuleResourcePath(moduleName); for (final ResourceName resourceName : pathStore.getFolderResourceNames(moduleFolder)) { if (resourceName != null) { result.add(resourceName); } } return result; } }
[ "luke@eversosoft.com" ]
luke@eversosoft.com
ddbd60ca52b4f861114a8738274efeeac60d5c1d
c59f358be394b3e4a736a5b7b17446695b9ea3fb
/insclix.ui.gwt/src/insclix/ui/gwt/client/widget/Column.java
c0a8b4e3fb28e2c4f95b532658e18836681772f5
[]
no_license
enterstudio/insclix.ui.gwt
ba8966065c7b525cefa75ef4707f13eeca3ac533
0d40667728349e8209c4c97cb0213dc2a59a5c3e
refs/heads/master
2021-01-20T14:08:46.568299
2015-10-23T01:42:21
2015-10-23T01:42:21
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,160
java
package insclix.ui.gwt.client.widget; import java.util.Iterator; import gwt.material.design.client.custom.HasGrid; import gwt.material.design.client.ui.MaterialColumn; import com.google.gwt.user.client.ui.HasWidgets; import com.google.gwt.user.client.ui.IsWidget; import com.google.gwt.user.client.ui.Widget; public class Column implements HasGrid, IsWidget, HasWidgets{ private MaterialColumn column; public Column(String html) { column = new MaterialColumn(""); } @Override public void setGrid(String grid) { column.setGrid(grid); } @Override public void setOffset(String offset) { column.setOffset(offset); } @Override public Widget asWidget() { // TODO Auto-generated method stub return column; } @Override public void add(Widget w) { // TODO Auto-generated method stub column.add(w); } @Override public void clear() { // TODO Auto-generated method stub column.clear(); } @Override public Iterator<Widget> iterator() { // TODO Auto-generated method stub return column.iterator(); } @Override public boolean remove(Widget w) { // TODO Auto-generated method stub return column.remove(w); } }
[ "kevzlou7979@gmail.com" ]
kevzlou7979@gmail.com
1676e761955296c9ab361a19f484543c67282d05
15274f5065c785297baba29934a1bc6052f64e29
/hw-gae-client_fro/src/main/java/hu/hw/cloud/client/fro/i18n/FroMessages.java
1c6ff7bdbc7d2316289e50c4c274160f5b2defaf
[ "Apache-2.0" ]
permissive
LetsCloud/hw-gae
e5196cc9f1c7744c341e6d34fda2bfc0100d82de
e4a55f8fe152ad588156942ddc28e852faf8ebcd
refs/heads/master
2018-11-04T03:43:23.338526
2018-10-06T20:36:14
2018-10-06T20:36:14
115,553,009
0
1
Apache-2.0
2018-10-06T20:36:15
2017-12-27T19:55:26
Java
UTF-8
Java
false
false
697
java
/** * */ package hu.hw.cloud.client.fro.i18n; import com.google.gwt.i18n.client.Messages; /** * @author CR * */ public interface FroMessages extends Messages { /* * MAIN MENU */ @DefaultMessage("Reservation") String mainMenuItemDashboard(); @DefaultMessage("Front Desk") String mainMenuGroupReception(); @DefaultMessage("Reservation") String mainMenuItemReservation(); @DefaultMessage("Roomplan") String mainMenuItemRoomplan(); @DefaultMessage("Cashier") String mainMenuGroupCashier(); @DefaultMessage("Billing") String mainMenuItemBilling(); @DefaultMessage("Configuration") String mainMenuGroupConfiguration(); }
[ "csernikr@gmail.com" ]
csernikr@gmail.com
1c2eb87bb54c72b0be806d0ac9ff424de37ad7e9
e2c7c39088cf7d572c5051a457dad8d3ddd1a2e1
/src/main/java/com/altas/gateway/permission/PermissionManage.java
4ced645fe27542e042b325097eaf5fa3b2f7d5f0
[]
no_license
enjoy0924/sample-netty-httpserver
c993994e3bfeed303e2a98084d5c2345cddc0e6a
05bfabf4d6bf106d47ac4b8a168537f0cd7e8b12
refs/heads/master
2021-05-09T17:30:25.548896
2018-04-02T04:19:07
2018-04-02T04:19:07
119,140,395
0
0
null
null
null
null
UTF-8
Java
false
false
1,508
java
package com.altas.gateway.permission; import com.altas.core.annotation.pojo.PermissionConstraint; import com.altas.gateway.loader.GlobalConfig; import com.altas.gateway.session.Session; import com.altas.gateway.tars.globalservants.GlobalServantsConst; import java.util.List; public class PermissionManage { private static final PermissionManage permissionManage = new PermissionManage(); public static PermissionManage instance() { return permissionManage; } /** * 根据权限约束类判断是否有权限 * * @param permissionConstraint * @param session * @return */ public int hasPermission(PermissionConstraint permissionConstraint, Session session) { List<String> permissions = permissionConstraint.getPermissions(); if (null == permissions) { return GlobalServantsConst.ERROR_CODE_OK; } int error = GlobalServantsConst.ERROR_CODE_OK; try { for (String permission : permissions) { Permission permissionInvoke = GlobalConfig.instance().getPermissionInvokerByPermission(permission); if(null == permissionInvoke) { error = GlobalServantsConst.ERROR_CODE_OK; }else { error = permissionInvoke.validatePermission(session); } } } catch (Exception e) { error = GlobalServantsConst.ERROR_CODE_UNKNOWN; } return error; } }
[ "enjoy0924@163.com" ]
enjoy0924@163.com
96a67ef2565ead2e6017b09361fd03254dd13f56
08b8d598fbae8332c1766ab021020928aeb08872
/src/gcom/cobranca/bean/CobrancaAcaoAtividadeHelper.java
866817a073d3850cdf20956f5874a8166cd6ae3a
[]
no_license
Procenge/GSAN-CAGEPA
53bf9bab01ae8116d08cfee7f0044d3be6f2de07
dfe64f3088a1357d2381e9f4280011d1da299433
refs/heads/master
2020-05-18T17:24:51.407985
2015-05-18T23:08:21
2015-05-18T23:08:21
25,368,185
3
1
null
null
null
null
WINDOWS-1252
Java
false
false
4,512
java
/* * Copyright (C) 2007-2007 the GSAN – Sistema Integrado de Gestão de Serviços de Saneamento * * This file is part of GSAN, an integrated service management system for Sanitation * * GSAN is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License. * * GSAN is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place – Suite 330, Boston, MA 02111-1307, USA */ /* * GSAN – Sistema Integrado de Gestão de Serviços de Saneamento * Copyright (C) <2007> * Adriano Britto Siqueira * Alexandre Santos Cabral * Ana Carolina Alves Breda * Ana Maria Andrade Cavalcante * Aryed Lins de Araújo * Bruno Leonardo Rodrigues Barros * Carlos Elmano Rodrigues Ferreira * Cláudio de Andrade Lira * Denys Guimarães Guenes Tavares * Eduardo Breckenfeld da Rosa Borges * Fabíola Gomes de Araújo * Flávio Leonardo Cavalcanti Cordeiro * Francisco do Nascimento Júnior * Homero Sampaio Cavalcanti * Ivan Sérgio da Silva Júnior * José Edmar de Siqueira * José Thiago Tenório Lopes * Kássia Regina Silvestre de Albuquerque * Leonardo Luiz Vieira da Silva * Márcio Roberto Batista da Silva * Maria de Fátima Sampaio Leite * Micaela Maria Coelho de Araújo * Nelson Mendonça de Carvalho * Newton Morais e Silva * Pedro Alexandre Santos da Silva Filho * Rafael Corrêa Lima e Silva * Rafael Francisco Pinto * Rafael Koury Monteiro * Rafael Palermo de Araújo * Raphael Veras Rossiter * Roberto Sobreira Barbalho * Rodrigo Avellar Silveira * Rosana Carvalho Barbosa * Sávio Luiz de Andrade Cavalcante * Tai Mu Shih * Thiago Augusto Souza do Nascimento * Tiago Moreno Rodrigues * Vivianne Barbosa Sousa * * Este programa é software livre; você pode redistribuí-lo e/ou * modificá-lo sob os termos de Licença Pública Geral GNU, conforme * publicada pela Free Software Foundation; versão 2 da * Licença. * Este programa é distribuído na expectativa de ser útil, mas SEM * QUALQUER GARANTIA; sem mesmo a garantia implícita de * COMERCIALIZAÇÃO ou de ADEQUAÇÃO A QUALQUER PROPÓSITO EM * PARTICULAR. Consulte a Licença Pública Geral GNU para obter mais * detalhes. * Você deve ter recebido uma cópia da Licença Pública Geral GNU * junto com este programa; se não, escreva para Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA * 02111-1307, USA. */ package gcom.cobranca.bean; import gcom.cobranca.CobrancaAcao; import gcom.cobranca.CobrancaAtividade; import java.io.Serializable; import org.apache.commons.lang.builder.EqualsBuilder; import org.apache.commons.lang.builder.HashCodeBuilder; /** * [UC0312] Inserir Cromograma de Cobrança * * @author Sávio Luiz * @date 04/07/2007 */ public class CobrancaAcaoAtividadeHelper implements Serializable { private static final long serialVersionUID = 1L; private CobrancaAcao cobrancaAcao; private CobrancaAtividade cobrancaAtividade; public CobrancaAcao getCobrancaAcao(){ return cobrancaAcao; } public void setCobrancaAcao(CobrancaAcao cobrancaAcao){ this.cobrancaAcao = cobrancaAcao; } public CobrancaAtividade getCobrancaAtividade(){ return cobrancaAtividade; } public void setCobrancaAtividade(CobrancaAtividade cobrancaAtividade){ this.cobrancaAtividade = cobrancaAtividade; } /** * Description of the Method * * @param other * Description of the Parameter * @return Description of the Return Value */ public boolean equals(Object other){ if((this == other)){ return true; } if(!(other instanceof CobrancaAcaoAtividadeHelper)){ return false; } CobrancaAcaoAtividadeHelper castOther = (CobrancaAcaoAtividadeHelper) other; return new EqualsBuilder().append(this.getCobrancaAcao().getId(), castOther.getCobrancaAcao().getId()).append( this.getCobrancaAtividade().getId(), castOther.getCobrancaAtividade().getId()).isEquals(); } public int hashCode(){ return new HashCodeBuilder().append(this.getCobrancaAcao().getId()).append(this.getCobrancaAtividade().getId()).toHashCode(); } }
[ "Yara.Souza@procenge.com.br" ]
Yara.Souza@procenge.com.br
ec818e6d28b7cd40f0e6c81e8ce3225c4ca077ea
1f2fb8f498b4c187bca818be0e87b6454547ed6e
/third-party-gateway/src/main/java/com/babeeta/butterfly/application/third/resource/OppoTagResource.java
011180ed484bc1161d033c58d16cbd0621bf532b
[]
no_license
zhaom/application-1.5.6
549c9ac6750ff4ac68a6d73b6baaad62c9a6b1c0
33edb3dee6a8fc4782a025a46e6616524ab1b602
refs/heads/master
2021-01-01T05:12:35.130980
2016-04-27T07:38:19
2016-04-27T07:38:19
57,193,472
0
0
null
null
null
null
UTF-8
Java
false
false
5,799
java
package com.babeeta.butterfly.application.third.resource; import java.util.ArrayList; import java.util.List; import javax.ws.rs.Consumes; import javax.ws.rs.DELETE; import javax.ws.rs.GET; import javax.ws.rs.HeaderParam; import javax.ws.rs.PUT; import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import org.apache.commons.codec.binary.Base64; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Controller; import com.babeeta.butterfly.application.third.service.tag.OppoTagService; import com.babeeta.butterfly.application.third.service.tag.TagResult; /*** * oppo tag * @author zeyong.xia * @date 2011-9-23 */ @Controller @Path("/1/api/tag") @Scope(value = "prototype") public class OppoTagResource { private OppoTagService oppoTagServiceImpl; private final static Logger logger = LoggerFactory .getLogger(OppoTagResource.class); private String[] getAuthContent(String authorization) { try { String base64Content = authorization.split(" ")[1]; String authContent = new String(Base64.decodeBase64(base64Content), "UTF-8"); return authContent.split(":"); } catch (Exception e) { logger.error("[authorization header] {}", e.getMessage()); return null; } } private String getGroupTagListString(String tagList, String appId) { // prepare group name list string StringBuilder groupNameList = new StringBuilder(); if (tagList.indexOf(",") > -1) { String[] tagArray = tagList.split(","); boolean append = false; for (String tag : tagArray) { if (append) { groupNameList.append(","); } else { append = true; } groupNameList.append(appId + "@" + tag); } } else { groupNameList.append(appId + "@" + tagList); } return groupNameList.toString(); } private List<String> exciseAppId(String appId, String[] tagList) { if (tagList == null || tagList.length == 0) { return null; } else { List<String> resultList = new ArrayList<String>(); for (String tag : tagList) { int hasAppId = tag.indexOf(appId); if (hasAppId > -1) { String groupName = tag.substring(tag.indexOf("@") + 1); if (!resultList.contains(groupName)) { resultList.add(groupName); } } } return resultList; } } @PUT @Path("/client/{cid}") @Consumes("text/plain;charset=UTF-8") @Produces("text/plain;charset=UTF-8") public Response setTagForClient(@PathParam("cid")String cid, String tagList,@HeaderParam("authorization") String authorization) { logger.debug("[OppoTagResource]setTagForClient tag [{}] to client [{}].", tagList, cid); String aid=getAuthContent(authorization)[0]; if (aid == null) { return Response.status(404).build(); } if (cid == null) { return Response.status(404).build(); } if (tagList == null || tagList.length() == 0) { return Response.status(422).build(); } String[] authContent = getAuthContent(authorization); TagResult result = oppoTagServiceImpl.setGroupTag(cid,aid, getGroupTagListString(tagList, authContent[0])); if (result.isSuccess()) { return Response.status(200).build(); } else { logger.debug("[OppoTagResource]setTagForClient tag [{}] to client [{}] fail", tagList, cid); return Response.status(result.getStatusCode()).build(); } } @DELETE @Path("/client/{cid}/{tagList}") public Response removeTagForClient( @PathParam("cid") String cid, @PathParam("tagList") String tagList, @HeaderParam("authorization") String authorization) { logger.debug("[OppoTagResource]removeTag tag [{}] from client [{}].", tagList, cid); String aid=getAuthContent(authorization)[0]; if (cid == null) { return Response.status(404).build(); } if (aid == null) { return Response.status(404).build(); } if (tagList == null || tagList.length() == 0) { return Response.status(422).build(); } String[] authContent = getAuthContent(authorization); TagResult result = oppoTagServiceImpl.removeGroupTag(cid,aid, getGroupTagListString(tagList, authContent[0])); if (result.isSuccess()) { return Response.status(200).build(); } else { logger.debug("[OppoTagResource]removeTag tag [{}] from client [{}] fail", tagList, cid); return Response.status(result.getStatusCode()).build(); } } @GET @Path("/client/{cid}") @Produces(MediaType.APPLICATION_JSON) public Response getTagForClient( @PathParam("cid") String cid, @HeaderParam("authorization") String authorization) { logger.debug("[OppoTagResource]getTag of client [{}].", cid); String aid=getAuthContent(authorization)[0]; if (cid == null) { return Response.status(404).build(); } if (aid == null) { return Response.status(404).build(); } String[] authContent = getAuthContent(authorization); TagResult result = oppoTagServiceImpl.listGroupTag(cid,aid); if (result.isSuccess()) { String[] groupTagList = result.getStringList(); if (groupTagList == null || groupTagList.length == 0) { return Response.status(404).build(); } else { List<String> resultList = exciseAppId(authContent[0], groupTagList); if (resultList == null) { logger.debug("[OppoTagResource]getTag of client [{}].fail ", cid); return Response.status(500).build(); } return Response.status(200).entity(resultList.toArray()) .build(); } } else { logger.debug("[OppoTagResource]getTag of client [{}].fail ", cid); return Response.status(result.getStatusCode()).build(); } } public void setOppoTagServiceImpl(OppoTagService oppoTagServiceImpl) { this.oppoTagServiceImpl = oppoTagServiceImpl; } }
[ "zhaominhe@gmail.com" ]
zhaominhe@gmail.com
060b16005d761c62ba92671947ebbeeec656abc1
f4fd782488b9cf6d99d4375d5718aead62b63c69
/com/planet_ink/coffee_mud/Abilities/Prayers/Prayer_CureFatigue.java
77e2a94455ef2b433970fcfd4187697502784421
[ "Apache-2.0" ]
permissive
sfunk1x/CoffeeMud
89a8ca1267ecb0c2ca48280e3b3930ee1484c93e
0ac2a21c16dfe3e1637627cb6373d34615afe109
refs/heads/master
2021-01-18T11:20:53.213200
2015-09-17T19:16:30
2015-09-17T19:16:30
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,917
java
package com.planet_ink.coffee_mud.Abilities.Prayers; import com.planet_ink.coffee_mud.core.interfaces.*; import com.planet_ink.coffee_mud.core.*; import com.planet_ink.coffee_mud.core.collections.*; import com.planet_ink.coffee_mud.Abilities.interfaces.*; import com.planet_ink.coffee_mud.Areas.interfaces.*; import com.planet_ink.coffee_mud.Behaviors.interfaces.*; import com.planet_ink.coffee_mud.CharClasses.interfaces.*; import com.planet_ink.coffee_mud.Commands.interfaces.*; import com.planet_ink.coffee_mud.Common.interfaces.*; import com.planet_ink.coffee_mud.Exits.interfaces.*; import com.planet_ink.coffee_mud.Items.interfaces.*; import com.planet_ink.coffee_mud.Libraries.interfaces.*; import com.planet_ink.coffee_mud.Locales.interfaces.*; import com.planet_ink.coffee_mud.MOBS.interfaces.*; import com.planet_ink.coffee_mud.Races.interfaces.*; import java.util.*; /* Copyright 2005-2015 Bo Zimmerman Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ @SuppressWarnings("rawtypes") public class Prayer_CureFatigue extends Prayer implements MendingSkill { @Override public String ID() { return "Prayer_CureFatigue"; } private final static String localizedName = CMLib.lang().L("Cure Fatigue"); @Override public String name() { return localizedName; } @Override public int classificationCode(){return Ability.ACODE_PRAYER|Ability.DOMAIN_RESTORATION;} @Override public int abstractQuality(){ return Ability.QUALITY_BENEFICIAL_OTHERS;} @Override public long flags(){return Ability.FLAG_HOLY;} @Override protected long minCastWaitTime(){return CMProps.getTickMillis()/2;} @Override public boolean supportsMending(Physical item) { return (item instanceof MOB) &&(((((MOB)item).curState()).getFatigue()>0) ||((((MOB)item).curState()).getMovement()<(((MOB)item).maxState()).getMovement())); } @Override public int castingQuality(MOB mob, Physical target) { if(mob!=null) { if(target instanceof MOB) { if(!supportsMending(target)) return Ability.QUALITY_INDIFFERENT; } } return super.castingQuality(mob,target); } @Override public boolean invoke(MOB mob, Vector commands, Physical givenTarget, boolean auto, int asLevel) { final MOB target=this.getTarget(mob,commands,givenTarget); if(target==null) return false; if(!super.invoke(mob,commands,givenTarget,auto,asLevel)) return false; final boolean success=proficiencyCheck(mob,0,auto); if(success) { final CMMsg msg=CMClass.getMsg(mob,target,this,verbalCastCode(mob,target,auto),auto?L("A soft white glow surrounds <T-NAME>."):L("^S<S-NAME> @x1, delivering a light invigorating touch to <T-NAMESELF>.^?",prayWord(mob))); if(mob.location().okMessage(mob,msg)) { mob.location().send(mob,msg); final int healing=CMLib.dice().roll(3,adjustedLevel(mob,asLevel),10); if(target.maxState().getFatigue()>Long.MIN_VALUE/2) target.curState().adjFatigue(-(target.curState().getFatigue()/2),target.maxState()); target.curState().adjMovement(healing,target.maxState()); target.tell(L("You feel slightly more invigorated!")); lastCastHelp=System.currentTimeMillis(); } } else beneficialWordsFizzle(mob,target,auto?"":L("<S-NAME> @x1 for <T-NAMESELF>, but nothing happens.",prayWord(mob))); // return whether it worked return success; } }
[ "bo@zimmers.net" ]
bo@zimmers.net
e5b8d6e7c759c3ea9e73755ca875b24016a5936c
552f9c5f59bf8ea607f996595f77d9321ca917ea
/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/vnfr/rev170228/project/vnfr/catalog/vnfr/vdur/_interface/connection/point/type/Internal.java
f2d0119d354b256b2c7d1666b77dbb79fecb0337
[]
no_license
openslice/io.openslice.sol005nbi.osm7
9bba3c8b830b300b58606fe56a0a47d2bf522ead
3f46220606181625f24d0d7ef5afaa1998f70d86
refs/heads/master
2021-08-26T07:41:16.213883
2020-06-15T15:51:07
2020-06-15T15:51:07
247,079,115
0
0
null
2021-08-02T17:21:09
2020-03-13T13:35:51
Java
UTF-8
Java
false
false
1,572
java
package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.vnfr.rev170228.project.vnfr.catalog.vnfr.vdur._interface.connection.point.type; import java.lang.String; import javax.annotation.Nullable; import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.vnfr.rev170228.$YangModuleInfoImpl; import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.vnfr.rev170228.project.vnfr.catalog.vnfr.vdur._interface.ConnectionPointType; import org.opendaylight.yangtools.yang.binding.Augmentable; import org.opendaylight.yangtools.yang.binding.DataObject; import org.opendaylight.yangtools.yang.common.QName; /** * * <p> * This class represents the following YANG schema fragment defined in module <b>vnfr</b> * <pre> * case internal { * leaf internal-connection-point-ref { * type leafref { * path ../../../../internal-connection-point/id; * } * } * } * </pre>The schema path to identify an instance is * <i>vnfr/project/(urn:etsi:osm:yang:vnfr?revision=2017-02-28)vnfr-catalog/vnfr/vdur/interface/connection-point-type/internal</i> * */ public interface Internal extends DataObject, Augmentable<Internal>, ConnectionPointType { public static final QName QNAME = $YangModuleInfoImpl.qnameOf("internal"); /** * Leaf Ref to the particular internal connection point * * * * @return <code>java.lang.String</code> <code>internalConnectionPointRef</code>, or <code>null</code> if not present */ @Nullable String getInternalConnectionPointRef(); }
[ "ioannischatzis@gmail.com" ]
ioannischatzis@gmail.com
14a706377f8cd9def345a544bea669cd52675306
b280a34244a58fddd7e76bddb13bc25c83215010
/scmv6/center-batch/src/main/java/com/smate/center/batch/dao/sns/pub/PublicationListDao.java
345af7f340b9bdaa7746d4c10add3b95f88725e7
[]
no_license
hzr958/myProjects
910d7b7473c33ef2754d79e67ced0245e987f522
d2e8f61b7b99a92ffe19209fcda3c2db37315422
refs/heads/master
2022-12-24T16:43:21.527071
2019-08-16T01:46:18
2019-08-16T01:46:18
202,512,072
2
3
null
2022-12-16T05:31:05
2019-08-15T09:21:04
Java
UTF-8
Java
false
false
1,048
java
package com.smate.center.batch.dao.sns.pub; import org.springframework.stereotype.Repository; import com.smate.center.batch.model.sns.pub.PublicationList; import com.smate.core.base.utils.data.SnsHibernateDao; /** * 成果收录情况DAO. * * @author LY * */ @Repository public class PublicationListDao extends SnsHibernateDao<PublicationList, Long> { /** * 更新pubid查重成果的收录情况. * * @param pubId * @return */ public PublicationList getPublicationList(Long pubId) { return super.findUnique(" from PublicationList t where t.id=?", pubId); } /** * 保存收录情况. * * @see com.iris.scm.service.orm.Hibernate.SimpleHibernateDao#save(java.lang.Object) */ public void save(PublicationList pubList) { super.getSession().saveOrUpdate(pubList); } /** * 删除引用情况. * * @param pubId */ public void deletePubList(Long pubId) { String hql = "delete from PublicationList t where t.id = ?"; super.createQuery(hql, pubId).executeUpdate(); } }
[ "zhiranhe@irissz.com" ]
zhiranhe@irissz.com
48aa847fd76b0f5780f8e18e653a4f01e3dafbf7
65d6c3e7fe8ada4684863b7b4561a31e96dbedff
/app/src/main/java/org/devfleet/zkillboard/zkilla/arch/ZKillUseCase.java
b8661c343a3eb468cd88702ec044728372e36adf
[ "MIT" ]
permissive
evanova/zkillboard-android
a055350aa4cf18cc68098d94ab5937563af6e13f
c9feca71a719906d33593baf600a874987b6f526
refs/heads/master
2020-03-19T15:35:38.010421
2018-06-10T21:43:35
2018-06-10T21:43:35
136,676,028
0
0
null
null
null
null
UTF-8
Java
false
false
140
java
package org.devfleet.zkillboard.zkilla.arch; public abstract class ZKillUseCase<T extends ZKillData> { public abstract T getData(); }
[ "evanova.mobile@gmail.com" ]
evanova.mobile@gmail.com
8bd26f099691ac083608dea97168aab8ef7fe48c
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/18/18_54b85d93c1fa4c91a7c16e4640d4db73a1573881/TCGADefinitions/18_54b85d93c1fa4c91a7c16e4640d4db73a1573881_TCGADefinitions_s.java
bf45ef13b1a81bd0e01b5d6a5ffeb53eb57d48d5
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
3,109
java
/******************************************************************************* * Caleydo - visualization for molecular biology - http://caleydo.org * * Copyright(C) 2005, 2012 Graz University of Technology, Marc Streit, Alexander * Lex, Christian Partl, Johannes Kepler University Linz </p> * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see <http://www.gnu.org/licenses/> *******************************************************************************/ package org.caleydo.datadomain.genetic; import java.util.Arrays; import java.util.regex.Pattern; import org.caleydo.core.io.IDSpecification; import org.caleydo.core.io.IDTypeParsingRules; /** * * Known source ID formats covered by correctly applying these expressions: * * Known source ID formats not covered correctly: * * <li>OV_20_0990 - known expression: "^[a-z]+\\-", * setReplacementExpression("\\_", "-");</li> * * @author Alexander Lex * */ public class TCGADefinitions { public static final String[] KNOWN_ID_EXAMPLES = { "TCGA-06-0171-02", "tcga-06-0125-02", "TCGA-02-0003-01A-01R-0177-01", "TCGA-02-0004-01A-21-1898-20", "OV_20_0990" }; // tcga\\-|TCGA\\-|^[a-zA-Z]|\\-..\\z public static final String TCGA_ID_SUBSTRING_REGEX = "^[a-zA-Z]*\\-|\\-..\\z|\\-...\\-"; public static final String[] TCGA_REPLACING_EXPRESSIONS = { "\\.", "\\_" }; public static final String TCGA_REPLACEMENT_STRING = "-"; public static IDSpecification createSampleIDSpecification(boolean isDefault) { IDTypeParsingRules rule = new IDTypeParsingRules(); rule.setSubStringExpression(TCGA_ID_SUBSTRING_REGEX); rule.setReplacementExpression(TCGA_REPLACEMENT_STRING, TCGA_REPLACING_EXPRESSIONS); rule.setToLowerCase(true); rule.setDefault(isDefault); IDSpecification id = new IDSpecification("TCGA_SAMPLE", "TCGA_SAMPLE"); id.setIdTypeParsingRules(rule); return id; } public static IDSpecification createGeneIDSpecificiation() { IDTypeParsingRules rule = new IDTypeParsingRules(); rule.setSubStringExpression(Pattern.quote("|")); // using the first element before the | separator rule.setDefault(false); IDSpecification geneIDSpecification = new IDSpecification(); geneIDSpecification.setIDTypeGene(true); geneIDSpecification.setIdType("GENE_SYMBOL"); geneIDSpecification.setIdTypeParsingRules(rule); return geneIDSpecification; } public static void main(String[] args) { System.out.println(Arrays.toString("PITX2|5308".split(Pattern.quote("|")))); } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
d5c628e78949d15d4e5f9b9e7e392947ca019611
3e40b87768a30858a60903fdc8d084260760b0ad
/core/src/main/java/org/juzu/impl/fs/Filter.java
f5cc8a9eac3c0a3559428535645df8cb94160510
[]
no_license
kmenzli/juzu
c964314835391b08191e7af719ebdbeb8145d35f
636094f6237754a58eb699860986b8afeee203bb
refs/heads/master
2021-01-16T21:55:17.813174
2012-05-04T12:34:03
2012-05-15T15:14:13
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,458
java
/* * Copyright (C) 2011 eXo Platform SAS. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.juzu.impl.fs; import java.io.IOException; /** @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a> */ public interface Filter<P> { boolean acceptDir(P dir, String name) throws IOException; boolean acceptFile(P file, String name) throws IOException; /** * A default implementation for the filter. */ public static class Default<P> implements Filter<P> { public boolean acceptDir(P dir, String name) throws IOException { return true; } public boolean acceptFile(P file, String name) throws IOException { return true; } } }
[ "julien@julienviet.com" ]
julien@julienviet.com
40641561173918414a386452578f7c2213cdd34c
fe2ee8754a304be7839f9f1c61336cbf0ddb5390
/src/main/java/com/leoman/entity/Help.java
f12c35b5c89d3d45a067b4340352765b5a430eb4
[]
no_license
ys305751572/dayshowServer
852b639b62e675889365cdc6e486eebc00686836
98287e304e9fd5649873798881222e9b4819fd4d
refs/heads/master
2021-01-21T12:58:04.875784
2016-05-31T03:52:15
2016-05-31T03:52:15
53,376,848
0
0
null
null
null
null
UTF-8
Java
false
false
640
java
package com.leoman.entity; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Table; /** * Created by Administrator on 2016/3/17. */ @Entity @Table(name = "tb_help") public class Help extends BaseEntity{ @Column(name = "content") private String content; @Column(name = "type") private String type; public String getContent() { return content; } public void setContent(String content) { this.content = content; } public String getType() { return type; } public void setType(String type) { this.type = type; } }
[ "305751572@qq.com" ]
305751572@qq.com
1dadad20a98b6eaea02cd4d4618750ac574cdc7d
656ce78b903ef3426f8f1ecdaee57217f9fbc40e
/src/o/oz.java
41cb6c8183b071e39734600f270ec81bfafde8a5
[]
no_license
zhuharev/periscope-android-source
51bce2c1b0b356718be207789c0b84acf1e7e201
637ab941ed6352845900b9d465b8e302146b3f8f
refs/heads/master
2021-01-10T01:47:19.177515
2015-12-25T16:51:27
2015-12-25T16:51:27
48,586,306
8
10
null
null
null
null
UTF-8
Java
false
false
466
java
// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: braces fieldsfirst space lnc package o; // Referenced classes of package o: // nx final class oz { nx MI; boolean Ny; boolean Nz; boolean connected; String name; oz() { } oz(String s, nx nx) { name = s; MI = nx; connected = false; } }
[ "hostmaster@zhuharev.ru" ]
hostmaster@zhuharev.ru
d008b121fcbe198bb3eb66cdb9d0ea50b614e81d
d217153d3a9ae32e3dab6a91e1e05a9aa881c074
/src/com/huiyin/utils/imageupload/ImageUploadGridView.java
dcc6d2c5d8af523c04cb4dbd2d38bd2e9ca912a8
[]
no_license
sengeiou/huiyinlehu
c892c6d804a5410de9d1f56db34b5df0f407be58
47a6523104746353950a482ab95600e19887b2e0
refs/heads/master
2020-05-30T11:00:09.656997
2015-07-28T07:32:52
2015-07-28T07:32:52
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,792
java
package com.huiyin.utils.imageupload; import java.util.ArrayList; import java.util.List; import com.huiyin.R; import com.huiyin.utils.StringUtils; import com.huiyin.utils.ViewHolder; import com.huiyin.wight.MyGridView; import android.content.Context; import android.graphics.Bitmap; import android.util.AttributeSet; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.ImageView; import android.widget.LinearLayout; public class ImageUploadGridView extends LinearLayout { private MyGridView update_grid_view; private ImageView add_pic; private Context mContext; private List<Bitmap> imagesBitmap; private ArrayList<String> imagesHostUrl; private MyGridAdapter mAdapter; public ImageUploadGridView(Context context) { super(context); mContext = context; findView(); SetListener(); InitView(); } public ImageUploadGridView(Context context, AttributeSet attrs) { super(context, attrs); mContext = context; findView(); SetListener(); InitView(); } public ImageUploadGridView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); mContext = context; findView(); SetListener(); InitView(); } private void findView() { imagesBitmap = new ArrayList<Bitmap>(); imagesHostUrl = new ArrayList<String>(); LayoutInflater.from(mContext).inflate(R.layout.image_base_layout, this, true); update_grid_view = (MyGridView) findViewById(R.id.update_grid_view); add_pic = (ImageView) findViewById(R.id.add_pic); } private void SetListener() { add_pic.setOnClickListener(new OnClickListener() { @Override public void onClick(View arg0) { if (listener != null) { listener.addPicOnClick(); } } }); } /** * 增加图片 * * @param map */ public void addPics(Bitmap map, String hostPath) { if (map == null || StringUtils.isBlank(hostPath)) return; imagesBitmap.add(map); imagesHostUrl.add(hostPath); if (imagesBitmap.size() <= 1) { mAdapter = new MyGridAdapter(); update_grid_view.setAdapter(mAdapter); } else { mAdapter.notifyDataSetChanged(); if (imagesBitmap.size() >= 5) { add_pic.setVisibility(View.GONE); } } } public ArrayList<String> getImagesHostUrl() { return imagesHostUrl; } private void InitView() { } private addPicListener listener; public interface addPicListener { public void addPicOnClick(); } public addPicListener getListener() { return listener; } public void setListener(addPicListener listener) { this.listener = listener; } public class MyGridAdapter extends BaseAdapter { public MyGridAdapter() { } @Override public int getCount() { return imagesBitmap == null ? 0 : imagesBitmap.size(); } @Override public Object getItem(int position) { return imagesBitmap.get(position); } @Override public long getItemId(int position) { return position; } @Override public View getView(int position, View convertView, ViewGroup parent) { if (convertView == null) { convertView = LayoutInflater.from(mContext).inflate(R.layout.image_view, null); } ImageView imageView = ViewHolder.get(convertView, R.id.img); ImageView del = ViewHolder.get(convertView, R.id.del); imageView.setImageBitmap(imagesBitmap.get(position)); del.setOnClickListener(new delOnClick(position)); return convertView; } public class delOnClick implements View.OnClickListener { int positon; public delOnClick(int positon) { this.positon = positon; } @Override public void onClick(View v) { imagesBitmap.remove(positon); imagesHostUrl.remove(positon); notifyDataSetChanged(); add_pic.setVisibility(View.VISIBLE); } } } }
[ "293575570@qq.com" ]
293575570@qq.com
32249af3f3e98f69976597d6229eb3336961db7f
a28b2589ee75ef1a9c2456f29e5ad29d167d125e
/src/main/java/org/hl7/v3/SinusUnspecifiedRoute.java
2b15f996d3b477874cc8ee58abfdd407d27320af
[]
no_license
tigawa/soap-ssl
ee4ce38ba34335ab395f0fc8a8a5650072be8c11
ac27ece15bc35efa5653de461db8534395eb52a7
refs/heads/master
2021-05-11T20:01:40.194678
2018-01-14T12:18:15
2018-01-14T12:18:15
117,428,279
0
0
null
null
null
null
UTF-8
Java
false
false
834
java
package org.hl7.v3; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlType; /** * <p>SinusUnspecifiedRouteのJavaクラス。 * * <p>次のスキーマ・フラグメントは、このクラス内に含まれる予期されるコンテンツを指定します。 * <p> * <pre> * &lt;simpleType name="SinusUnspecifiedRoute"> * &lt;restriction base="{urn:hl7-org:v3}cs"> * &lt;enumeration value="ENDOSININJ"/> * &lt;enumeration value="SININSTIL"/> * &lt;/restriction> * &lt;/simpleType> * </pre> * */ @XmlType(name = "SinusUnspecifiedRoute") @XmlEnum public enum SinusUnspecifiedRoute { ENDOSININJ, SININSTIL; public String value() { return name(); } public static SinusUnspecifiedRoute fromValue(String v) { return valueOf(v); } }
[ "ihciiat@gmail.com" ]
ihciiat@gmail.com
dfd45a767710bc535fcabb5f70e47cdbffe77dc7
be4a8376b4e8c994a79d117d9fe5ee5508a50fcc
/2.1 (2017-2018)/lostshard/src/main/java/com/lostshard/lostshard/objects/InventoryGUI/GUI.java
dedf1e6e1ee53c55ceb4d14f267f63fd8ae29a33
[ "MIT" ]
permissive
BuntsFidleyBits/Lostshard-ARCHIVE
5b140d36c058421ce02ff12eaee143850a274db1
6094e3c12b181e86c313edc7ec2f13fd0907f716
refs/heads/master
2021-09-28T13:44:52.398297
2018-11-17T14:52:51
2018-11-17T14:52:51
157,993,584
0
2
MIT
2018-11-17T14:42:58
2018-11-17T14:42:58
null
UTF-8
Java
false
false
3,028
java
package com.lostshard.lostshard.Objects.InventoryGUI; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import org.bukkit.Bukkit; import org.bukkit.entity.Player; import org.bukkit.event.inventory.InventoryClickEvent; import org.bukkit.event.inventory.InventoryCloseEvent; import org.bukkit.event.inventory.InventoryInteractEvent; import org.bukkit.inventory.Inventory; import org.bukkit.inventory.ItemStack; import com.lostshard.lostshard.Manager.PlayerManager; import com.lostshard.lostshard.Objects.Player.PseudoPlayer; public abstract class GUI { PlayerManager pm = PlayerManager.getManager(); private PseudoPlayer player; private List<GUIItem> items; private String name; public GUI(String name, PseudoPlayer pPlayer, GUIItem... items) { this.name = name; this.player = pPlayer; this.items = new ArrayList<GUIItem>(Arrays.asList(items)); } public void forceClose() { this.player.setGui(null); this.player.getOnlinePlayer().closeInventory(); } public Inventory getGUI() { final Inventory inv = Bukkit.createInventory(null, (int) Math.max(9.0D, Math.ceil(this.items.size() / 9.0D) * 9.0D), this.getName()); if (this.items == null || this.items.isEmpty()) { return inv; } final ItemStack[] itemStacks = new ItemStack[this.items.size()]; for (int i = 0; i < this.items.size(); i++) { itemStacks[i] = this.items.get(i).getItemStack(); } inv.setContents(itemStacks); return inv; } public List<GUIItem> getItems() { return this.items; } public String getName() { return this.name; } public PseudoPlayer getPlayer() { return this.player; } public void inventoryClick(InventoryClickEvent event) { if (event.getClickedInventory() == null) { return; } if (event.getClick() == null) { return; } if (!this.getPlayer().getGui().equals(this)) { return; } event.setCancelled(true); if (event.getSlot() >= this.items.size()) { return; } final GUIClick click = this.items.get(event.getSlot()).getClick(); if (click != null && event.getCurrentItem() != null && event.getClick() != null && event.getWhoClicked() != null) { click.click((Player) event.getWhoClicked(), this.getPlayer(), event.getCurrentItem(), event.getClick(), event.getInventory(), event.getSlot()); } } public void inventoryClose(InventoryCloseEvent event) { this.player.setGui(null); } public void inventoryInteract(InventoryInteractEvent event) { event.setCancelled(true); } public void openInventory(Player player) { player.openInventory(this.getGUI()); player.updateInventory(); this.getPlayer().setGui(this); } public void setItem(int slot, GUIItem item) { this.items.set(slot, item); } public void setItems(GUIItem... items) { this.items = new ArrayList<GUIItem>(Arrays.asList(items)); } public void setItems(List<GUIItem> items) { this.items = items; } public void setName(String name) { this.name = name; } public void setPlayer(PseudoPlayer player) { this.player = player; } }
[ "mu@imi.co" ]
mu@imi.co
8dc39b59b3555d0648b6152e1547f40feb86205b
6cd87cbbcad0dee9073f720f36f1a9392480a47e
/SPLAR/src/splar/plugins/reasoners/bdd/javabdd/BDDTraversal.java
a2133d46fcde1b3b994ea01124078f6309c37eca
[]
no_license
bressan3/bvr
503c2a61846b929ae5aade81ad8c5c5a3b5bebac
428cdf47b779e81ae1009d75f649e85f268e94f9
refs/heads/master
2020-03-23T08:16:38.594676
2019-01-23T18:45:05
2019-01-23T18:45:05
141,317,887
0
0
null
2018-07-17T16:47:28
2018-07-17T16:47:27
null
UTF-8
Java
false
false
3,529
java
/******************************************************************************* * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE, Version 3, 29 June 2007; * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.gnu.org/licenses/lgpl-3.0.txt * * 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 splar.plugins.reasoners.bdd.javabdd; import java.util.Arrays; import java.util.LinkedHashSet; import java.util.Set; import net.sf.javabdd.BDD; public class BDDTraversal { protected Set<String> path; protected byte[] bddPath; public static final byte DONTCARE = 2; public static final byte TRUE = 1; public static final byte FALSE = 0; public BDDTraversal() { path = new LinkedHashSet<String>(); bddPath = null; } public void dfs(BDD bdd) { path.clear(); bddPath = new byte[bdd.getFactory().varNum()]; Arrays.fill(bddPath, (byte)DONTCARE); dfsTraversal(bdd); onTraversalDone(); } protected byte[] getSolution() { return bddPath; } protected Set<String> getPath() { return path; } public boolean searchStopped() { return false; } private void dfsTraversal(BDD bdd) { if ( !searchStopped() ) { if ( bdd.isOne() ) { onOneTerminalFound(path, bddPath); } else if ( bdd.isZero() ) { onZeroTerminalFound(path, bddPath); } else { onVisitingNode(bdd, path, bddPath); BDD firstNode = bdd.low(), secondNode = bdd.high(); boolean polarity = false; if (!visitLowNodeFirst(bdd) ) { firstNode = bdd.high(); secondNode = bdd.low(); polarity = true; } // visit child one if ( !searchStopped() ) { if ( canVisitNode(bdd, polarity) ) { String pathEntry = bdd.var() + ":" + polarity; path.add(pathEntry); bddPath[bdd.var()] = (byte)((polarity)?TRUE:FALSE); dfsTraversal(firstNode); bddPath[bdd.var()] = DONTCARE; path.remove(pathEntry); } else { onSkippedNode(bdd, polarity, path, bddPath); } } // visit child two if ( !searchStopped() ) { if ( canVisitNode(bdd, !polarity) ) { String pathEntry = bdd.var() + ":" + !polarity; path.add(pathEntry); bddPath[bdd.var()] = (byte)((!polarity)?TRUE:FALSE); dfsTraversal(secondNode); bddPath[bdd.var()] = DONTCARE; path.remove(pathEntry); } else { onSkippedNode(bdd, !polarity, path, bddPath); } } onVisitedNode(bdd, path, bddPath); bdd.free(); } } } public void onVisitingNode(BDD bddNode, Set<String> path, byte solution[]) { } public void onVisitedNode(BDD bddNode, Set<String> path, byte solution[]) { } public void onZeroTerminalFound(Set<String> path, byte solution[]) { } public void onOneTerminalFound(Set<String> path, byte solution[]) { } public boolean canVisitNode(BDD bddNode, boolean polarity) { return true; } public void onSkippedNode(BDD bdNode, boolean polarity, Set<String> path, byte solution[]) { } public boolean visitLowNodeFirst(BDD bddNode) { return true; } public void onTraversalDone() { } }
[ "Anatoly.Vasilevskiy@sintef.no" ]
Anatoly.Vasilevskiy@sintef.no
05c171bdf97c8abdab60a63ff00a32fab78f1ae2
81d4e9ef022b6c9c46592ecb9f5403a2ffebfc0c
/src/main/java/net/fabricmc/fabric/mixin/networking/MixinServerPlayNetworkHandler.java
849153cf57b0a2a7e27578664a77cfc9a4dfa2c5
[ "Apache-2.0" ]
permissive
i509VCB/fabric
023ae80c4e756e026f58ebb5fce0a70be936f70c
524f8cfb7f1c0dbc4c5724d9a02ac102cc414f7a
refs/heads/master
2021-06-23T14:07:43.850966
2018-11-08T00:14:35
2018-11-08T00:14:51
200,315,904
0
1
Apache-2.0
2020-11-05T07:37:04
2019-08-03T01:03:51
Java
UTF-8
Java
false
false
2,183
java
/* * Copyright (c) 2016, 2017, 2018 FabricMC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package net.fabricmc.fabric.mixin.networking; import net.fabricmc.api.Side; import net.fabricmc.fabric.networking.CustomPayloadHandlerRegistry; import net.fabricmc.fabric.networking.PacketContext; import net.fabricmc.fabric.networking.SPacketCustomPayloadAccessor; import net.fabricmc.fabric.networking.impl.PacketContextImpl; import net.minecraft.entity.player.EntityPlayerServer; import net.minecraft.network.handler.ServerPlayNetworkHandler; import net.minecraft.network.packet.server.SPacketCustomPayload; import net.minecraft.server.MinecraftServer; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; @Mixin(ServerPlayNetworkHandler.class) public class MixinServerPlayNetworkHandler { @Shadow private MinecraftServer server; @Shadow private EntityPlayerServer player; private PacketContext fabricPacketContext; @Inject(method = "onCustomPayload", at = @At("HEAD"), cancellable = true) public void onCustomPayload(SPacketCustomPayload packet, CallbackInfo info) { if (fabricPacketContext == null || fabricPacketContext.getPlayer() != player) { fabricPacketContext = new PacketContextImpl(Side.SERVER, player, server); } SPacketCustomPayloadAccessor accessor = ((SPacketCustomPayloadAccessor) packet); if (CustomPayloadHandlerRegistry.SERVER.accept(accessor.getChannel(), fabricPacketContext, accessor.getData())) { info.cancel(); } } }
[ "kontakt@asie.pl" ]
kontakt@asie.pl
97e5f950037713efd2af5ead5207fa7397982bf9
d105d63e493123d6441a1eb48bda737df1585f18
/Code_Java/test/src/com/genesis/test/core/redisson/RBucketTest.java
6424a375bb07105601f14bab8c39cc0012cb53a8
[]
no_license
junit/GenesisServer
83fe1188279fa1aeed198b312308ef88e71f35ad
550258cd5c753837d8e3216774cc3cc163d2fdc7
refs/heads/master
2020-06-24T14:04:03.936774
2018-03-30T01:59:44
2018-03-30T01:59:44
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,712
java
package com.genesis.test.core.redisson; import com.genesis.core.redis.redisson.RedisUtils; import org.junit.Test; import org.redisson.api.RBucket; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.is; /** * RBucket 映射为 redis server 的 string 类型 * 只能存放最后存储的一个字符串 * redis server 命令: * 查看所有键---->keys * * 查看key的类型--->type testBucket * 查看key的值 ---->get testBucket */ public class RBucketTest extends AbstractRedissonTest { /** * RBucket<String> 的相关测试 */ @Test public void testRBucketString() { RBucket<String> rBucket = RedisUtils.getRBucket(redisson, "testBucket"); //同步放置 rBucket.set("redisBucketASync"); String value = rBucket.get(); assertThat(value, is("redisBucketASync")); //异步放置 rBucket.setAsync("测试"); try { Thread.sleep(1000); } catch (InterruptedException e) { e.printStackTrace(); } String bucketString = rBucket.get(); assertThat(bucketString, is("测试")); } /** * RBucket<Integer> 的相关测试 */ @Test public void testRBucketInt() { // 0 RBucket<Integer> bucket = RedisUtils.getRBucket(redisson, "testBucketInt"); bucket.set(20); boolean bRet = bucket.compareAndSet(15, 25); assertThat(bRet, is(false)); Integer value = bucket.get(); assertThat(value, is(20)); bRet = bucket.compareAndSet(20, 25); assertThat(bRet, is(true)); value = bucket.get(); assertThat(value, is(25)); bRet = bucket.trySet(100); assertThat(bRet, is(false)); // 2 RBucket<Integer> bucket2 = RedisUtils.getRBucket(redisson, "testBucketInt2"); bRet = bucket2.trySet(100); assertThat(bRet, is(true)); value = bucket2.get(); assertThat(value, is(100)); Integer value2 = bucket2.getAndDelete(); assertThat(value2, is(100)); bRet = bucket2.isExists(); assertThat(bRet, is(false)); } @Test public void testCompareAndSet() { boolean bRet = false; int value = -1; RBucket<Integer> bucket1 = RedisUtils.getRBucket(redisson, "RBucketTest_testCompareAndSet"); bucket1.delete(); // 1.0 key不存在,compareAndSet 必失败 bRet = bucket1.compareAndSet(1, 2); assertThat(bRet, is(false)); //value = bucket1.get(); // 这里这样调用是会抛空指针异常 // 2.0 key不存在,trySet必成功 bRet = bucket1.trySet(99); assertThat(bRet, is(true)); // 3.0 key不等于1,所以失败 bRet = bucket1.compareAndSet(1, 2); assertThat(bRet, is(false)); // 4.0 key等于99,所以成功 bRet = bucket1.compareAndSet(99, 2); assertThat(bRet, is(true)); } @Test public void testTrySet() { boolean bRet = false; int value = -1; RBucket<Integer> bucket = RedisUtils.getRBucket(redisson, "RBucketTest_testTrySet"); bucket.delete(); //key不存在,trySet必成功 bRet = bucket.trySet(1); assertThat(bRet, is(true)); //key存在,trySet必失败 bRet = bucket.trySet(2); assertThat(bRet, is(false)); //key存在,trySet必失败(哪怕是设置相同的值) bRet = bucket.trySet(1); assertThat(bRet, is(false)); } }
[ "85789685@qq.com" ]
85789685@qq.com
3556e4e7641b2b79682d8c1dbd0e8c02a6a2b18b
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/2/2_55423a5e26efb8c4838d464f0f18b3fecff3e500/MenuButtonsViewObject/2_55423a5e26efb8c4838d464f0f18b3fecff3e500_MenuButtonsViewObject_t.java
473997a8866341323d7bca835117d73ad3fb4114
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
3,614
java
/* * Copyright (C) 2010 Pavel Stastny * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package cz.incad.Kramerius.views.inc; import java.util.ArrayList; import java.util.List; import java.util.StringTokenizer; import javax.servlet.http.HttpServletRequest; import com.google.inject.Inject; import com.google.inject.Provider; import cz.incad.kramerius.shib.utils.ShibbolethUtils; import cz.incad.kramerius.utils.ApplicationURL; import cz.incad.kramerius.utils.conf.KConfiguration; public class MenuButtonsViewObject { @Inject Provider<HttpServletRequest> requestProvider; @Inject KConfiguration kConfiguration; String[] getConfigredItems() { String[] langs = kConfiguration.getPropertyList("interface.languages"); return langs; } public String getQueryString() { HttpServletRequest request = this.requestProvider.get(); if (request.getQueryString() != null) return request.getQueryString(); else return ""; } public String getShibbLogout() { HttpServletRequest req = this.requestProvider.get(); if (ShibbolethUtils.isUnderShibbolethSession(req)) { String property = KConfiguration.getInstance().getProperty("security.shib.logout"); return property; } return null; } public List<LanguageItem> getLanguageItems() { String[] items = getConfigredItems(); List<LanguageItem> links = new ArrayList<LanguageItem>(); StringBuffer buffer = new StringBuffer(); String queryString = getQueryString(); StringTokenizer tokenizer = new StringTokenizer(queryString,"&"); while(tokenizer.hasMoreTokens()) { String token = tokenizer.nextToken(); if (!token.trim().startsWith("language")) { if (buffer.length() > 0) { buffer.append("&"); } buffer.append(token); } } for (int i = 0; i < items.length; i++) { String name = items[i]; String link = "?language="+ items[++i] + "&" + buffer.toString() ; LanguageItem itm = new LanguageItem(link, name, items[i]); links.add(itm); } return links; } public static class LanguageItem { private String link; private String name; private String key; private LanguageItem(String link, String name, String key) { super(); this.link = link; this.name = name; this.key = key; } public String getLink() { return link; } public String getName() { return name; } public String getKey(){ return this.key; } } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
3cd7b87fc9c865fca578dc71341f4f7a4ad7f417
0af8b92686a58eb0b64e319b22411432aca7a8f3
/large-multiproject/project88/src/main/java/org/gradle/test/performance88_1/Production88_8.java
abf731e00658399309e9d9e4f0b846fd9296e033
[]
no_license
gradle/performance-comparisons
b0d38db37c326e0ce271abebdb3c91769b860799
e53dc7182fafcf9fedf07920cbbea8b40ee4eef4
refs/heads/master
2023-08-14T19:24:39.164276
2022-11-24T05:18:33
2022-11-24T05:18:33
80,121,268
17
15
null
2022-09-30T08:04:35
2017-01-26T14:25:33
null
UTF-8
Java
false
false
299
java
package org.gradle.test.performance88_1; public class Production88_8 extends org.gradle.test.performance17_1.Production17_8 { private final String property; public Production88_8() { this.property = "foo"; } public String getProperty() { return property; } }
[ "cedric.champeau@gmail.com" ]
cedric.champeau@gmail.com
8113a928a09725dc2a13256a50a903eb523ffb7d
eace11a5735cfec1f9560e41a9ee30a1a133c5a9
/CMT/cptiscas/程序变异体的backup/改名前/SimpleTree/simpleTree60/Bin.java
ddd769ae7c66710539875099cc8b43e8bebdad33
[]
no_license
phantomDai/mypapers
eb2fc0fac5945c5efd303e0206aa93d6ac0624d0
e1aa1236bbad5d6d3b634a846cb8076a1951485a
refs/heads/master
2021-07-06T18:27:48.620826
2020-08-19T12:17:03
2020-08-19T12:17:03
162,563,422
0
1
null
null
null
null
UTF-8
Java
false
false
794
java
/* * Bin.java * * Created on March 9, 2007, 9:05 PM * * From "Multiprocessor Synchronization and Concurrent Data Structures", * by Maurice Herlihy and Nir Shavit. * Copyright 2007 Elsevier Inc. All rights reserved. */ package mutants.SimpleTree.simpleTree60; import java.util.ArrayList; import java.util.List; /** * Simple bin implementation used to service priority queues. * @param T item type * @author mph */ public class Bin<T> { List<T> list; public Bin() { list = new ArrayList<T>(); } synchronized void put(T item) { list.add(item); } synchronized T get() { try { return list.remove(0); } catch (IndexOutOfBoundsException e) { return null; } } synchronized boolean isEmpty() { return list.isEmpty(); } }
[ "daihepeng@sina.cn" ]
daihepeng@sina.cn
c7ec873b59431c3c2bb3269f5ef953ee2631b2c7
b7d00d4cce06fd692aa3b45d9fd269b61c7b4421
/ajah-thread/src/main/java/com/ajah/thread/gang/SimpleWorkerGang.java
98fe8740e5ab3b764af6b09d2120da8d58e5c2a2
[ "Apache-2.0" ]
permissive
efsavage/ajah
6aeb210230b91e43418909df7ceae23a3aa72be0
8d6c0233061a185194c742c58b6b4158210dc23d
refs/heads/master
2022-10-04T13:15:34.548378
2020-02-12T03:18:15
2020-02-12T03:18:15
1,445,299
2
2
Apache-2.0
2022-09-01T22:57:08
2011-03-06T04:00:15
Java
UTF-8
Java
false
false
1,872
java
/* * Copyright 2011 Eric F. Savage, code@efsavage.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.ajah.thread.gang; import java.util.ArrayList; import java.util.List; /** * A simple gang that can execute a list of jobs. * * @author <a href="http://efsavage.com">Eric F. Savage</a>, <a * href="mailto:code@efsavage.com">code@efsavage.com</a>. * */ public class SimpleWorkerGang { private final List<Worker<?>> workers = new ArrayList<>(); private final boolean autoStart; /** * Constructor with autoStart enabled. */ public SimpleWorkerGang() { this.autoStart = true; } /** * Public constructor. * * @param autoStart * Should jobs be started as they are added? */ public SimpleWorkerGang(final boolean autoStart) { this.autoStart = autoStart; } /** * Adds a worker to this gang. * * @param worker * The worker to add to the gang. If autostart is active it will * begin execution immediately. */ public void add(final Worker<?> worker) { this.workers.add(worker); if (this.autoStart) { worker.go(); } } /** * Invokes {@link Worker#go()} on all workers in this gang. This isn't * necessary if autoStart is true. */ public void go() { for (final Worker<?> worker : this.workers) { worker.go(); } } }
[ "code@efsavage.com" ]
code@efsavage.com
e5a0f070b8043a481a5af8ba283e1076ac828bdb
97111be75ee99ce2c397e89d96849d6b77cc5386
/his-cloud/his-cloud-service-pms/src/main/java/com/neu/his/cloud/service/pms/mapper/SmsDeptMapper.java
77cd3a9de239ca6558a1fdf65db0990bb1880791
[ "Apache-2.0" ]
permissive
ZainZhao/HIS
f75f3c681cb280efd14652ac0c7014ecb217c492
e9ee047d3efd54df6a71172f0210f666572e9699
refs/heads/master
2023-05-13T20:32:37.844243
2022-12-16T06:46:25
2022-12-16T06:46:25
196,420,709
1,046
478
Apache-2.0
2023-05-06T06:42:33
2019-07-11T15:28:30
Java
UTF-8
Java
false
false
883
java
package com.neu.his.cloud.service.pms.mapper; import com.neu.his.cloud.service.pms.model.SmsDept; import com.neu.his.cloud.service.pms.model.SmsDeptExample; import java.util.List; import org.apache.ibatis.annotations.Param; public interface SmsDeptMapper { int countByExample(SmsDeptExample example); int deleteByExample(SmsDeptExample example); int deleteByPrimaryKey(Long id); int insert(SmsDept record); int insertSelective(SmsDept record); List<SmsDept> selectByExample(SmsDeptExample example); SmsDept selectByPrimaryKey(Long id); int updateByExampleSelective(@Param("record") SmsDept record, @Param("example") SmsDeptExample example); int updateByExample(@Param("record") SmsDept record, @Param("example") SmsDeptExample example); int updateByPrimaryKeySelective(SmsDept record); int updateByPrimaryKey(SmsDept record); }
[ "ZainZhao@994130442@qq.com" ]
ZainZhao@994130442@qq.com
c0cc736428e1392852ff4ba99fb48b01cf010456
5f498d9c751a7c0263e129544c5a42606541627f
/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/editparts/borders/RoundRectangleBorderWithDecoration.java
5a06725b9d4a0eafd423ff3789a82d526a7fe058
[]
no_license
saatkamp/simpl09
2c2f65ea12245888b19283cdcddb8b73d03b9cf0
9d81c4f50bed863518497ab950af3d6726f2b3c8
refs/heads/master
2021-01-10T03:56:30.975085
2011-11-09T19:36:14
2011-11-09T19:36:14
55,900,095
0
0
null
null
null
null
UTF-8
Java
false
false
2,258
java
/******************************************************************************* * Copyright (c) 2005 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.eclipse.bpel.ui.editparts.borders; import org.eclipse.draw2d.Graphics; import org.eclipse.draw2d.IFigure; import org.eclipse.draw2d.ImageFigure; import org.eclipse.draw2d.geometry.Insets; import org.eclipse.draw2d.geometry.Rectangle; import org.eclipse.swt.graphics.Image; public class RoundRectangleBorderWithDecoration extends RoundRectangleBorder { Image decoration; private int decoXOffset; private int decoYOffset; private IFigure decorationFigure; public RoundRectangleBorderWithDecoration(IFigure parent, Image decoration) { this(parent,decoration,new Insets(5,5,5,5)); } public RoundRectangleBorderWithDecoration(IFigure parent, Image decoration, Insets insets) { super(insets); this.decoration = decoration; decoXOffset = 0; decoYOffset = -(decoration.getBounds().height/2); this.decorationFigure = new ImageFigure(decoration); this.decorationFigure.setParent(parent); } @Override public void paint(IFigure figure, Graphics graphics, Insets insets) { super.paint(figure, graphics, insets); if (decoration != null) { Rectangle r = figure.getBounds(); graphics.pushState(); Rectangle decoBounds = new Rectangle(r.x+decoXOffset,r.y+decoYOffset,decoration.getBounds().width,decoration.getBounds().height); decorationFigure.setBounds(decoBounds); graphics.setClip(decoBounds); decorationFigure.paint(graphics); graphics.popState(); } } public int getDecoXOffset() { return decoXOffset; } public int getDecoYOffset() { return decoYOffset; } public Image getDecoration() { return decoration; } public IFigure getDecorationFigure() { return decorationFigure; } }
[ "hahnml@t-online.de" ]
hahnml@t-online.de
2a2f94417dca44fba274af577a1f51c1fa3269b7
3c3d515b5a092f1696eb23efd4364e52a07f8c3d
/trunk/ZeroCode/src/main/java/org/zerokode/designer/model/rules/TabRules.java
4b4c7530e33a49b8c13c526916499f7143bbf6fa
[]
no_license
BGCX261/zkoss-svn-to-git
f5e4644ea9e5ae9e1f8e585dcfeafca7dccdc1ca
123cac59a2dc0202f18d0cee429270dd446d3a44
refs/heads/master
2016-09-06T14:35:23.372577
2015-08-25T15:38:10
2015-08-25T15:38:10
41,600,017
0
0
null
null
null
null
UTF-8
Java
false
false
2,220
java
package org.zerokode.designer.model.rules; import org.zerokode.designer.model.rules.engine.IRulable; import org.zerokode.designer.model.rules.engine.RulesResult; import org.zerokode.designer.model.rules.engine.exceptions.RulesException; import org.zkoss.zk.ui.Component; public class TabRules implements IRulable { /* (non-Javadoc) * @see com.zk.designer.model.rules.engine.IRulable#applyPreCreationRules() */ public RulesResult applyPreCreationRules() throws RulesException { return null; } /* (non-Javadoc) * @see com.zk.designer.ui.model.rules.IRulable#applyCreationRules(com.potix.zk.ui.Component) */ public RulesResult applyCreationRules(Component cmp) throws RulesException { return null; } /* (non-Javadoc) * @see com.zk.designer.ui.model.rules.IRulable#applyModelToZUMLRules(com.potix.zk.ui.Component) */ public RulesResult applyModelToZUMLRules(Component cmp) throws RulesException { return null; } /* (non-Javadoc) * @see com.zk.designer.ui.model.rules.engine.IRulable#getModelToZUMLExcludedProperties() */ public String[] getModelToZUMLExcludedAttributes() { return new String[] {"selected"}; } /* (non-Javadoc) * @see com.zk.designer.model.rules.engine.IRulable#getExcludedProperties() */ public String[] getExcludedProperties() { return null; } /* (non-Javadoc) * @see com.zk.designer.model.rules.engine.IRulable#applyComponentDisplayRules(com.potix.zk.ui.Component) */ public RulesResult applyComponentDisplayRules(Component cmp) { return null; } /* (non-Javadoc) * @see com.zk.designer.model.rules.engine.IRulable#showChildren() */ public boolean showChildren() { return true; } /* (non-Javadoc) * @see com.zk.designer.model.rules.engine.IRulable#exportChildrenToZUML() */ public boolean exportChildrenToZUML() { return true; } public RulesResult applyCopyRules(Component source) throws RulesException { // TODO Auto-generated method stub return null; } public RulesResult applyPrePasteRules(Component source, Component target) throws RulesException { // TODO Auto-generated method stub return null; } }
[ "you@example.com" ]
you@example.com
f33ad52a8e9894dbed7415a2a7609f8e563154a6
ea8013860ed0b905c64f449c8bce9e0c34a23f7b
/SystemUIGoogle/sources/com/android/systemui/controls/ui/ControlsUiControllerImpl_Factory.java
1b8ed3547151ea149f8ce7db214906482b2ced01
[]
no_license
TheScarastic/redfin_b5
5efe0dc0d40b09a1a102dfb98bcde09bac4956db
6d85efe92477576c4901cce62e1202e31c30cbd2
refs/heads/master
2023-08-13T22:05:30.321241
2021-09-28T12:33:20
2021-09-28T12:33:20
411,210,644
1
0
null
null
null
null
UTF-8
Java
false
false
4,976
java
package com.android.systemui.controls.ui; import android.content.Context; import android.content.SharedPreferences; import com.android.systemui.controls.ControlsMetricsLogger; import com.android.systemui.controls.CustomIconCache; import com.android.systemui.controls.controller.ControlsController; import com.android.systemui.controls.management.ControlsListingController; import com.android.systemui.plugins.ActivityStarter; import com.android.systemui.statusbar.phone.ShadeController; import com.android.systemui.statusbar.policy.KeyguardStateController; import com.android.systemui.util.concurrency.DelayableExecutor; import dagger.Lazy; import dagger.internal.DoubleCheck; import dagger.internal.Factory; import javax.inject.Provider; /* loaded from: classes.dex */ public final class ControlsUiControllerImpl_Factory implements Factory<ControlsUiControllerImpl> { private final Provider<ActivityStarter> activityStarterProvider; private final Provider<DelayableExecutor> bgExecutorProvider; private final Provider<Context> contextProvider; private final Provider<ControlActionCoordinator> controlActionCoordinatorProvider; private final Provider<ControlsController> controlsControllerProvider; private final Provider<ControlsListingController> controlsListingControllerProvider; private final Provider<ControlsMetricsLogger> controlsMetricsLoggerProvider; private final Provider<CustomIconCache> iconCacheProvider; private final Provider<KeyguardStateController> keyguardStateControllerProvider; private final Provider<ShadeController> shadeControllerProvider; private final Provider<SharedPreferences> sharedPreferencesProvider; private final Provider<DelayableExecutor> uiExecutorProvider; public ControlsUiControllerImpl_Factory(Provider<ControlsController> provider, Provider<Context> provider2, Provider<DelayableExecutor> provider3, Provider<DelayableExecutor> provider4, Provider<ControlsListingController> provider5, Provider<SharedPreferences> provider6, Provider<ControlActionCoordinator> provider7, Provider<ActivityStarter> provider8, Provider<ShadeController> provider9, Provider<CustomIconCache> provider10, Provider<ControlsMetricsLogger> provider11, Provider<KeyguardStateController> provider12) { this.controlsControllerProvider = provider; this.contextProvider = provider2; this.uiExecutorProvider = provider3; this.bgExecutorProvider = provider4; this.controlsListingControllerProvider = provider5; this.sharedPreferencesProvider = provider6; this.controlActionCoordinatorProvider = provider7; this.activityStarterProvider = provider8; this.shadeControllerProvider = provider9; this.iconCacheProvider = provider10; this.controlsMetricsLoggerProvider = provider11; this.keyguardStateControllerProvider = provider12; } @Override // javax.inject.Provider public ControlsUiControllerImpl get() { return newInstance(DoubleCheck.lazy(this.controlsControllerProvider), this.contextProvider.get(), this.uiExecutorProvider.get(), this.bgExecutorProvider.get(), DoubleCheck.lazy(this.controlsListingControllerProvider), this.sharedPreferencesProvider.get(), this.controlActionCoordinatorProvider.get(), this.activityStarterProvider.get(), this.shadeControllerProvider.get(), this.iconCacheProvider.get(), this.controlsMetricsLoggerProvider.get(), this.keyguardStateControllerProvider.get()); } public static ControlsUiControllerImpl_Factory create(Provider<ControlsController> provider, Provider<Context> provider2, Provider<DelayableExecutor> provider3, Provider<DelayableExecutor> provider4, Provider<ControlsListingController> provider5, Provider<SharedPreferences> provider6, Provider<ControlActionCoordinator> provider7, Provider<ActivityStarter> provider8, Provider<ShadeController> provider9, Provider<CustomIconCache> provider10, Provider<ControlsMetricsLogger> provider11, Provider<KeyguardStateController> provider12) { return new ControlsUiControllerImpl_Factory(provider, provider2, provider3, provider4, provider5, provider6, provider7, provider8, provider9, provider10, provider11, provider12); } public static ControlsUiControllerImpl newInstance(Lazy<ControlsController> lazy, Context context, DelayableExecutor delayableExecutor, DelayableExecutor delayableExecutor2, Lazy<ControlsListingController> lazy2, SharedPreferences sharedPreferences, ControlActionCoordinator controlActionCoordinator, ActivityStarter activityStarter, ShadeController shadeController, CustomIconCache customIconCache, ControlsMetricsLogger controlsMetricsLogger, KeyguardStateController keyguardStateController) { return new ControlsUiControllerImpl(lazy, context, delayableExecutor, delayableExecutor2, lazy2, sharedPreferences, controlActionCoordinator, activityStarter, shadeController, customIconCache, controlsMetricsLogger, keyguardStateController); } }
[ "warabhishek@gmail.com" ]
warabhishek@gmail.com
6daa91ed51e1a0c9374616b4667f7008e6f6ee42
32b72e1dc8b6ee1be2e80bb70a03a021c83db550
/ast_results/gstraube_cythara/app/src/main/java/be/tarsos/dsp/io/TarsosDSPAudioInputStream.java
a006b3434c29c0412be3808233b4fd451f3a93e8
[]
no_license
cmFodWx5YWRhdjEyMTA5/smell-and-machine-learning
d90c41a17e88fcd99d543124eeb6e93f9133cb4a
0564143d92f8024ff5fa6b659c2baebf827582b1
refs/heads/master
2020-07-13T13:53:40.297493
2019-01-11T11:51:18
2019-01-11T11:51:18
null
0
0
null
null
null
null
UTF-8
Java
false
false
521
java
// isComment package be.tarsos.dsp.io; import java.io.IOException; /** * isComment */ public interface isClassOrIsInterface { /** * isComment */ long isMethod(long isParameter) throws IOException; /** * isComment */ int isMethod(byte[] isParameter, int isParameter, int isParameter) throws IOException; /** * isComment */ public void isMethod() throws IOException; /** * isComment */ TarsosDSPAudioFormat isMethod(); long isMethod(); }
[ "matheus@melsolucoes.net" ]
matheus@melsolucoes.net
c969aa74d13593a2082748289299b5ed7c879895
63a6edfc1940cbf4f6adc8ac50fdef663519445b
/src/main/java/com/academy/telesens/lesson04/HomeTasks.java
898d39e7a87d55dcc1c8e574d639f207defb2451
[]
no_license
Oleg-Afanasiev/qa-ja-10
75afa1810029602aa134b8f657aec2efee4bbeb9
a50d044829d9b48f4716fc4df89a279629e9b4fe
refs/heads/master
2023-04-03T23:37:13.269469
2021-04-14T09:46:32
2021-04-14T09:46:32
331,697,004
0
0
null
null
null
null
UTF-8
Java
false
false
1,065
java
package com.academy.telesens.lesson04; public class HomeTasks { public static void main(String[] args) { String palindrome = "qwertyytrewq"; String notPalindrome = "Hello world!"; System.out.println(isPalindrome(palindrome)); System.out.println(isPalindrome(notPalindrome)); System.out.println(countSubs("java programming java java", "java")); } public static boolean isPalindrome(String testString) { for (int i=0, k=testString.length()-1; i < k; i++, k--) { if (testString.charAt(i) != testString.charAt(k)) { return false; // найдено не соответствие } } // for return true; // цикл закончился => символы равны } public static int countSubs(String origin, String subs) { int count = 0; int index = 0; while( (index = origin.indexOf(subs, index)) != -1) { count++; index = index + subs.length(); } return count; } }
[ "oleg.kh81@gmail.com" ]
oleg.kh81@gmail.com
99c0fd60b76cf0fa951d3cddc34b209e32033ff3
2075234a974dea7683ed24dd45836d5ac26bb93a
/sabot/kernel/src/test/java/com/dremio/exec/server/options/TestEagerCachingOptionResolver.java
0289ace69f6eecbb20f38557848e23d50fd08f35
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
superbstreak/dremio-oss
30c131f0e285466575134d3189760c63ca71fbdb
31bc9b7ce0aa88ac2ab8ebcbc9fb69fb0d2744a8
refs/heads/master
2022-05-01T11:21:53.621052
2022-02-06T19:01:17
2022-02-06T19:01:17
97,759,386
0
0
null
2017-07-19T20:42:17
2017-07-19T20:42:17
null
UTF-8
Java
false
false
3,966
java
/* * Copyright (C) 2017-2019 Dremio Corporation * * 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.dremio.exec.server.options; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; import org.junit.Before; import org.junit.Test; import com.dremio.options.OptionList; import com.dremio.options.OptionManager; import com.dremio.options.OptionValue; public class TestEagerCachingOptionResolver { private OptionManager optionManager; private OptionList optionList; private OptionValue optionValueA; private OptionValue optionValueB; private OptionValue optionValueC; @Before public void setup() { optionManager = mock(OptionManager.class); optionList = new OptionList(); optionValueA = OptionValue.createDouble(OptionValue.OptionType.SYSTEM, "testOptionA", 2); optionValueB = OptionValue.createBoolean(OptionValue.OptionType.SYSTEM, "testOptionB", true); optionValueC = OptionValue.createString(OptionValue.OptionType.SYSTEM, "testOptionC", "someValue"); optionList.add(optionValueA); optionList.add(optionValueB); optionList.add(optionValueC); when(optionManager.getNonDefaultOptions()).thenReturn(optionList); } @Test public void testInitialization() { new EagerCachingOptionManager(optionManager); verify(optionManager, times(1)).getNonDefaultOptions(); } @Test public void testGetOption() { final OptionManager eagerCachingOptionManager = new EagerCachingOptionManager(optionManager); assertEquals(optionValueA, eagerCachingOptionManager.getOption(optionValueA.getName())); // getOption should not touch underlying option manager verify(optionManager, times(0)).getOption(optionValueA.getName()); } @Test public void testSetOption() { final OptionManager eagerCachingOptionManager = new EagerCachingOptionManager(optionManager); final OptionValue newOption = OptionValue.createBoolean(OptionValue.OptionType.SYSTEM, "newOption", true); eagerCachingOptionManager.setOption(newOption); // setOption should write-through to underlying option manager verify(optionManager, times(1)).setOption(newOption); } @Test public void testDeleteOption() { final OptionManager eagerCachingOptionManager = new EagerCachingOptionManager(optionManager); eagerCachingOptionManager.deleteOption(optionValueC.getName(), OptionValue.OptionType.SYSTEM); assertNull(eagerCachingOptionManager.getOption(optionValueC.getName())); // deleteOption should write-through to underlying option manager verify(optionManager, times(1)).deleteOption(optionValueC.getName(), OptionValue.OptionType.SYSTEM); } @Test public void testDeleteAllOptions() { final OptionManager eagerCachingOptionManager = new EagerCachingOptionManager(optionManager); eagerCachingOptionManager.deleteAllOptions(OptionValue.OptionType.SYSTEM); assertNull(eagerCachingOptionManager.getOption(optionValueA.getName())); assertNull(eagerCachingOptionManager.getOption(optionValueB.getName())); assertNull(eagerCachingOptionManager.getOption(optionValueC.getName())); // deleteOption should write-through to underlying option manager verify(optionManager, times(1)).deleteAllOptions(OptionValue.OptionType.SYSTEM); } }
[ "yongyan@dremio.com" ]
yongyan@dremio.com
6abd65448627e19f339b5da8aa5790469d3fe40f
8ca4c6014c397dba1724c4ac7926f9d0118f07aa
/zzuchenyb-mvc-utils/src/main/java/com/cyb/utils/response/R.java
530a5491997677a043beb01299992e9cf6ce366d
[]
no_license
iezhuhx/cloud
927fbe8ee80b3e1abf0a9a5e340610a350fbfaac
fdbd01551e1764688d4c119958e1c8ff1da47921
refs/heads/master
2022-12-22T04:41:38.538829
2020-12-14T02:50:46
2020-12-14T02:50:46
161,440,294
3
1
null
2022-12-16T10:24:20
2018-12-12T06:02:50
Java
UTF-8
Java
false
false
2,774
java
package com.cyb.utils.response; import java.io.Serializable; import com.wordnik.swagger.annotations.ApiModel; import com.wordnik.swagger.annotations.ApiModelProperty; /** * 作者 : iechenyb<br> * 类描述:返回实体信息<br> * 创建时间: 2018年1月10日 */ @ApiModel(value="统一返回对象",description="统一的返回值定义方式") public class R<T> implements Serializable { private static final long serialVersionUID = 1L; @ApiModelProperty(value="执行结果") private String es = ""; @ApiModelProperty(value="执行状态") private String ec = ResponseStatus.SUCCESS;//默认成功 @ApiModelProperty(value="数据体") protected T d; public R() { super(); } public R(T d) { super(); this.d = d; } /*public ResultBean(PageData<T> d) { super(); this.d = d; }*/ public R(Throwable e) { super(); this.es = e.toString(); this.ec = ResponseStatus.FAIL; } public R<T> success() { this.ec = ResponseStatus.SUCCESS; return this; } public R<T> success(String msg) { this.ec = ResponseStatus.SUCCESS; this.es = msg; return this; } public R<T> data(T data) { this.d = data; return this; } public R<T> fail() { this.ec = ResponseStatus.FAIL; return this; } public R<T> fail(String msg) { this.ec = ResponseStatus.FAIL; this.es = msg; return this; } public R<T> fail(Throwable e) { this.ec = ResponseStatus.FAIL; this.es = e.toString(); return this; } public R<T> msg(String msg) { this.es = msg; return this; } public static String getNoPermission() { return ResponseStatus.NO_PERMISSION; } public R<T> refuse(){ this.ec = ResponseStatus.NO_PERMISSION; return this; } public R<T> sessionTimeOut(String msg){ this.ec = ResponseStatus.SESSION_TIME_OUT; this.es=msg; return this; } public R<T> sessionTimeOut(){ this.ec = ResponseStatus.SESSION_TIME_OUT; return this; } public R<T> refuse(String msg){ this.ec = ResponseStatus.NO_PERMISSION; this.es = msg; return this; } public R<T> needToModifyPassword(){ this.ec = ResponseStatus.USE_DEFAULT_PASSWORD; return this; } public R<T> needToModifyPassword(String msg){ this.ec = ResponseStatus.USE_DEFAULT_PASSWORD; this.es = msg; return this; } public String getEs() { return es; } public void setEs(String es) { this.es = es; } public String getEc() { return ec; } public void setEc(String ec) { this.ec = ec; } public T getD() { return d; } public void setD(T d) { this.d = d; } public static void main(String[] args) { System.out.println("••••••••••"); } }
[ "zzuchenyb@sina.com" ]
zzuchenyb@sina.com
7fcd533cc8c12173ada9be6b84089f008a5691a5
60231321ae07d564d4245ba7182b5ffd455da7a5
/JavaFXProgramming/src/ch17/exam20/RootController.java
f19cf0100313f71e2bd28ddb287c363a9380b2b6
[]
no_license
JeongSemi/TestRepository
1fc7b1b86e75adcf72f5584389bde2311b5c647f
3e16625c5802302f505a507f89bf187265269061
refs/heads/master
2021-01-20T00:45:51.856815
2017-08-29T05:26:45
2017-08-29T05:26:45
89,182,167
0
0
null
null
null
null
UTF-8
Java
false
false
3,699
java
package ch17.exam20; import java.io.IOException; import java.net.URL; import java.util.ResourceBundle; import javafx.beans.value.ChangeListener; import javafx.beans.value.ObservableValue; import javafx.collections.FXCollections; import javafx.collections.ObservableList; import javafx.fxml.FXML; import javafx.fxml.FXMLLoader; import javafx.fxml.Initializable; import javafx.scene.control.Label; import javafx.scene.control.ListCell; import javafx.scene.control.ListView; import javafx.scene.image.Image; import javafx.scene.image.ImageView; import javafx.scene.layout.HBox; import javafx.util.Callback; public class RootController implements Initializable { @FXML private ListView<Phone> listView; @Override public void initialize(URL url, ResourceBundle rb) { listView.setCellFactory(new Callback<ListView<Phone>, ListCell<Phone>>() { @Override public ListCell<Phone> call(ListView<Phone> param) { //listview에 phone이라는 객체가 제공될 때 메소드 자동실행 -> 1개당 1번실행 (cell 리턴)-> 10개의 ListCell 생성 ListCell<Phone> listCell = new ListCell<Phone>() { @Override protected void updateItem(Phone item, boolean empty) { //cell안에 뭐가 들어가는지 정의하는 메소드 super.updateItem(item, empty); //그래픽적인, 이벤트 관련된 코드는 부모 메소드에 있기 때문에 부모 메소드에도 매개값을 넘겨줘야한다. if (empty) { //가장 처음엔 empty가 true인 상태로 수행되고, 그 이후에 차례로 값을 받아오기 때문에 예외처리를 해야한다. return; } try { //Cell에 들어갈 컨테이너 생성 HBox hbox = (HBox) FXMLLoader.load(getClass().getResource("item.fxml")); ImageView phoneImage = (ImageView) hbox.lookup("#image"); //id로 참조할때는 id앞에 #을 붙인다 Label phoneName = (Label) hbox.lookup("#name"); Label phoneContent = (Label) hbox.lookup("#content"); phoneImage.setImage(new Image(getClass().getResource("images/" + item.getImageName()).toString())); phoneName.setText(item.getName()); phoneContent.setText(item.getContent()); //Cell의 내용으로 설정 setGraphic(hbox); } catch (IOException ex) { ex.printStackTrace(); } } }; return listCell; } }); //선택 속성 감시 listView.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<Phone>() { @Override public void changed(ObservableValue<? extends Phone> observable, Phone oldValue, Phone newValue) { System.out.println(newValue.getName() + ": " + newValue.getImageName()); } }); //데이터 세팅 ObservableList<Phone> value = FXCollections.observableArrayList(); value.add(new Phone("phone01.png", "갤럭시S1", "삼성스마트폰의 최초 모델입니다.")); value.add(new Phone("phone02.png", "갤럭시S2", "제가 스무살 때 썼던 모델입니다. 호호")); value.add(new Phone("phone03.png", "갤럭시S3", "이건 누가 썼던거지?")); listView.setItems(value); } }
[ "wjdtpa2@gmail.com" ]
wjdtpa2@gmail.com
75a7841b7d69fa2dcd2c1370b55a3fe60cb7388a
b2ef9c3a2939be4c6a417969aa777e31d5170f24
/src/main/java/edu/emory/mathcs/nlp/text_analysis/dbpedia/DBPediaXML.java
e3a5c174c36bc88ee1ccea2a01d598f3f686709b
[ "Apache-2.0" ]
permissive
ablodge/text_analysis
2785fe3b7950600031d0f562628815c8f2cba653
c55a5913eed9a3beb1e92dbe5ab75f76baf8ffd7
refs/heads/master
2021-01-14T14:15:58.610568
2015-11-30T15:10:29
2015-11-30T15:10:29
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,031
java
/** * Copyright 2015, Emory University * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package edu.emory.mathcs.nlp.text_analysis.dbpedia; /** * @author Jinho D. Choi ({@code jinho.choi@emory.edu}) */ public interface DBPediaXML { String OWL_CLASS = "owl:Class"; String RDF_ABOUT = "rdf:about"; String RDF_RESOURCE = "rdf:resource"; String RDFS_SUBCLASS_OF = "rdfs:subClassOf"; String DBPEDIA_ORG_ONTOLOGY = "http://dbpedia.org/ontology/"; String DBPEDIA_ORG_RESOURCE = "http://dbpedia.org/resource/"; }
[ "jinho.choi@emory.edu" ]
jinho.choi@emory.edu
23e7809c606a39f7d7be8c1c87edf00aed62a9d5
5d1701c99c2df1dfe7c7ab630b4e2074ba3c4c97
/src/main/java/com/example/onedayoneleetcode/CountPalindromicSubstrings.java
0caeb2b88f377640a6049c7b04dd23b939511988
[]
no_license
zredMonkey/OneDayOneLeetCode
a2b3a693b8ec7b703f5ca077bba6df93c33f8dad
4794f6a2a5b73b1330723026f8a64ca4814fe1f8
refs/heads/master
2023-09-01T17:02:32.876792
2023-08-23T16:36:48
2023-08-23T16:36:48
282,588,950
0
0
null
null
null
null
UTF-8
Java
false
false
1,331
java
package com.example.onedayoneleetcode; /** * 回文子串个数 */ public class CountPalindromicSubstrings { public static int countSubstrings(String s) { int n = s.length(); int count = 0; // 记录回文子串的个数 boolean[][] dp = new boolean[n][n]; // dp[i][j]表示s的子串从i到j是否为回文子串 // 所有单个字符都是回文子串 for (int i = 0; i < n; i++) { dp[i][i] = true; count++; } // 检查长度为2的子串 for (int i = 0; i < n - 1; i++) { if (s.charAt(i) == s.charAt(i + 1)) { dp[i][i + 1] = true; count++; } } // 检查长度大于2的子串 for (int len = 3; len <= n; len++) { for (int i = 0; i <= n - len; i++) { int j = i + len - 1; // 子串的结束位置 if (s.charAt(i) == s.charAt(j) && dp[i + 1][j - 1]) { dp[i][j] = true; count++; } } } return count; } public static void main(String[] args) { String input = "abc"; int palindromeCount = countSubstrings(input); System.out.println("Palindrome Substrings Count: " + palindromeCount); } }
[ "=" ]
=
34294b325214c9acc9f4e1c9744e48adcce53731
3c7641cda6f424f37cb3cf706857f52b9576b43c
/batch/src/main/java/com/asofdate/batch/core/QuartzJobLauncher.java
d366f8080bd9b4ac09445c2495a604fa3ec88bd1
[ "MIT" ]
permissive
achuo985/batch-scheduler
574b84ceecd1fc114e0afa31b0d0c96530208a00
45186a439995aceb521f53807fcd0a1c6599fb92
refs/heads/master
2020-12-02T19:42:41.638470
2017-07-05T16:03:21
2017-07-05T16:03:21
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,664
java
package com.asofdate.batch.core; import com.asofdate.batch.entity.TaskArgumentEntity; import com.asofdate.batch.service.ArgumentService; import com.asofdate.batch.service.TaskStatusService; import com.asofdate.utils.JoinCode; import org.quartz.JobExecutionContext; import org.quartz.JobExecutionException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.batch.core.*; import org.springframework.batch.core.configuration.JobRegistry; import org.springframework.batch.core.explore.JobExplorer; import org.springframework.batch.core.launch.JobLauncher; import org.springframework.batch.core.launch.JobOperator; import org.springframework.batch.core.launch.NoSuchJobException; import org.springframework.batch.core.repository.JobExecutionAlreadyRunningException; import org.springframework.batch.core.repository.JobInstanceAlreadyCompleteException; import org.springframework.batch.core.repository.JobRestartException; import org.springframework.scheduling.quartz.QuartzJobBean; import java.util.Collections; import java.util.Comparator; import java.util.List; import java.util.UUID; /** * Created by hzwy23 on 2017/5/21. */ public class QuartzJobLauncher extends QuartzJobBean { private final Logger logger = LoggerFactory.getLogger(QuartzJobLauncher.class); private JobLauncher jobLauncher; private JobRegistry jobRegistry; // private JobExplorer jobExplorer; // private JobOperator jobOperator; private TaskStatusService taskStatusService; private ArgumentService argumentService; private String jobName; public ArgumentService getArgumentService() { return argumentService; } public void setArgumentService(ArgumentService argumentService) { this.argumentService = argumentService; } public TaskStatusService getTaskStatusService() { return taskStatusService; } public void setTaskStatusService(TaskStatusService taskStatusService) { this.taskStatusService = taskStatusService; } public String getJobName() { return jobName; } public void setJobName(String jobName) { this.jobName = jobName; } // public JobOperator getJobOperator() { // return jobOperator; // } // // public void setJobOperator(JobOperator jobOperator) { // this.jobOperator = jobOperator; // } // // public JobExplorer getJobExplorer() { // return jobExplorer; // } // // public void setJobExplorer(JobExplorer jobExplorer) { // this.jobExplorer = jobExplorer; // } public JobRegistry getJobRegistry() { return jobRegistry; } public void setJobRegistry(JobRegistry jobRegistry) { this.jobRegistry = jobRegistry; } public JobLauncher getJobLauncher() { return jobLauncher; } public void setJobLauncher(JobLauncher jobLauncher) { this.jobLauncher = jobLauncher; } @Override protected void executeInternal(JobExecutionContext jobExecutionContext) throws JobExecutionException { try { Job job = jobRegistry.getJob(jobName); JobExecution jobExecution = jobLauncher.run(job, getJobParameters()); if (ExitStatus.COMPLETED.getExitCode().equals(jobExecution.getExitStatus().getExitCode())) { taskStatusService.setTaskCompleted(jobName); jobRegistry.unregister(jobName); } else { taskStatusService.setTaskError(jobName); } } catch (NoSuchJobException e) { e.printStackTrace(); } catch (JobInstanceAlreadyCompleteException e) { e.printStackTrace(); } catch (JobExecutionAlreadyRunningException e) { e.printStackTrace(); } catch (JobParametersInvalidException e) { e.printStackTrace(); } catch (JobRestartException e) { e.printStackTrace(); } } public JobParameters getJobParameters() { JobParametersBuilder builder = new JobParametersBuilder(); String jobId = JoinCode.getTaskCode(jobName); List<TaskArgumentEntity> list = argumentService.queryArgument(jobId); if (list == null) { builder.addString("uuid", UUID.randomUUID().toString()); return builder.toJobParameters(); } String jobParameters = ""; for (TaskArgumentEntity m : list) { jobParameters += " " + m.getArgValue(); } builder.addString("JobParameters", jobParameters.trim()); builder.addString("uuid", UUID.randomUUID().toString()); return builder.toJobParameters(); } }
[ "hzwy23@163.com" ]
hzwy23@163.com
7944745391014f5f90a78f0e95702490dc205e77
548fb618a284a074f650e5a16b0be7e0a1346cce
/Java y Android/ExamenSoa3Inicio1/src/main/java/com/soa/IpTVMessageReceiverInOut.java
bea4c500bd874f5ef9db31ad41284342901853d7
[]
no_license
ArthurRmz/ProyectosEP
be1a095d812b95da68a5c7468ae722b0d2737c5b
1307c31e18e23018273b0a1bce480ae0dde0c73e
refs/heads/master
2020-04-14T06:32:11.025015
2019-01-07T04:21:26
2019-01-07T04:21:26
163,688,950
0
0
null
null
null
null
UTF-8
Java
false
false
7,374
java
/** * IpTVMessageReceiverInOut.java * * This file was auto-generated from WSDL * by the Apache Axis2 version: 1.7.8 Built on : May 19, 2018 (07:06:11 BST) */ package com.soa; /** * IpTVMessageReceiverInOut message receiver */ public class IpTVMessageReceiverInOut extends org.apache.axis2.receivers.AbstractInOutMessageReceiver { // private final org.apache.xmlbeans.XmlOptions _xmlOptions; { _xmlOptions = new org.apache.xmlbeans.XmlOptions(); _xmlOptions.setSaveNoXmlDecl(); _xmlOptions.setSaveAggressiveNamespaces(); _xmlOptions.setSaveNamespacesFirst(); } public void invokeBusinessLogic( org.apache.axis2.context.MessageContext msgContext, org.apache.axis2.context.MessageContext newMsgContext) throws org.apache.axis2.AxisFault { try { // get the implementation class for the Web Service Object obj = getTheImplementationObject(msgContext); IpTVSkeleton skel = (IpTVSkeleton) obj; //Out Envelop org.apache.axiom.soap.SOAPEnvelope envelope = null; //Find the axisOperation that has been set by the Dispatch phase. org.apache.axis2.description.AxisOperation op = msgContext.getOperationContext() .getAxisOperation(); if (op == null) { throw new org.apache.axis2.AxisFault( "Operation is not located, if this is doclit style the SOAP-ACTION should specified via the SOAP Action to use the RawXMLProvider"); } java.lang.String methodName; if ((op.getName() != null) && ((methodName = org.apache.axis2.util.JavaUtils.xmlNameToJavaIdentifier( op.getName().getLocalPart())) != null)) { if ("entrada".equals(methodName)) { com.soa.ResponseServiceDocument responseService5 = null; com.soa.ResquestServiceDocument wrappedParam = (com.soa.ResquestServiceDocument) fromOM(msgContext.getEnvelope() .getBody() .getFirstElement(), com.soa.ResquestServiceDocument.class); responseService5 = skel.entrada(wrappedParam); envelope = toEnvelope(getSOAPFactory(msgContext), responseService5, false, new javax.xml.namespace.QName("http://soa.com", "responseService")); } else { throw new java.lang.RuntimeException("method not found"); } newMsgContext.setEnvelope(envelope); } } catch (java.lang.Exception e) { throw org.apache.axis2.AxisFault.makeFault(e); } } /** * Get the {@link org.apache.xmlbeans.XmlOptions} object that the stub uses when * serializing objects to XML. * * @return the options used for serialization */ public org.apache.xmlbeans.XmlOptions _getXmlOptions() { return _xmlOptions; } private org.apache.axiom.om.OMElement toOM( com.soa.ResquestServiceDocument param, boolean optimizeContent) throws org.apache.axis2.AxisFault { return toOM(param); } private org.apache.axiom.om.OMElement toOM( final com.soa.ResquestServiceDocument param) throws org.apache.axis2.AxisFault { org.apache.axiom.om.OMXMLParserWrapper builder = org.apache.axiom.om.OMXMLBuilderFactory.createOMBuilder(new javax.xml.transform.sax.SAXSource( new org.apache.axis2.xmlbeans.XmlBeansXMLReader(param, _xmlOptions), new org.xml.sax.InputSource())); try { return builder.getDocumentElement(true); } catch (java.lang.Exception e) { throw org.apache.axis2.AxisFault.makeFault(e); } } private org.apache.axiom.om.OMElement toOM( com.soa.ResponseServiceDocument param, boolean optimizeContent) throws org.apache.axis2.AxisFault { return toOM(param); } private org.apache.axiom.om.OMElement toOM( final com.soa.ResponseServiceDocument param) throws org.apache.axis2.AxisFault { org.apache.axiom.om.OMXMLParserWrapper builder = org.apache.axiom.om.OMXMLBuilderFactory.createOMBuilder(new javax.xml.transform.sax.SAXSource( new org.apache.axis2.xmlbeans.XmlBeansXMLReader(param, _xmlOptions), new org.xml.sax.InputSource())); try { return builder.getDocumentElement(true); } catch (java.lang.Exception e) { throw org.apache.axis2.AxisFault.makeFault(e); } } private org.apache.axiom.soap.SOAPEnvelope toEnvelope( org.apache.axiom.soap.SOAPFactory factory, com.soa.ResponseServiceDocument param, boolean optimizeContent, javax.xml.namespace.QName elementQName) throws org.apache.axis2.AxisFault { org.apache.axiom.soap.SOAPEnvelope envelope = factory.getDefaultEnvelope(); if (param != null) { envelope.getBody().addChild(toOM(param, optimizeContent)); } return envelope; } /** * get the default envelope */ private org.apache.axiom.soap.SOAPEnvelope toEnvelope( org.apache.axiom.soap.SOAPFactory factory) { return factory.getDefaultEnvelope(); } public org.apache.xmlbeans.XmlObject fromOM( org.apache.axiom.om.OMElement param, java.lang.Class type) throws org.apache.axis2.AxisFault { try { if (com.soa.ResquestServiceDocument.class.equals(type)) { org.apache.axiom.om.OMXMLStreamReaderConfiguration configuration = new org.apache.axiom.om.OMXMLStreamReaderConfiguration(); configuration.setPreserveNamespaceContext(true); return com.soa.ResquestServiceDocument.Factory.parse(param.getXMLStreamReader( false, configuration)); } if (com.soa.ResponseServiceDocument.class.equals(type)) { org.apache.axiom.om.OMXMLStreamReaderConfiguration configuration = new org.apache.axiom.om.OMXMLStreamReaderConfiguration(); configuration.setPreserveNamespaceContext(true); return com.soa.ResponseServiceDocument.Factory.parse(param.getXMLStreamReader( false, configuration)); } } catch (java.lang.Exception e) { throw org.apache.axis2.AxisFault.makeFault(e); } return null; } private org.apache.axis2.AxisFault createAxisFault(java.lang.Exception e) { org.apache.axis2.AxisFault f; Throwable cause = e.getCause(); if (cause != null) { f = new org.apache.axis2.AxisFault(e.getMessage(), cause); } else { f = new org.apache.axis2.AxisFault(e.getMessage()); } return f; } } //end of class
[ "arturormzh1223@gmail.com" ]
arturormzh1223@gmail.com
a7b7eaccd78c5a002ddbe720d4f4c5c0b3757e78
3161693f2ba73d8555da54ecafc982a4ee19c131
/src/main/java/onyx/components/storage/sizer/SizerJobScheduler.java
5f592c1cc3cad62fbeac7cd2ba04a7579cf8f482
[ "MIT" ]
permissive
markkolich/onyx
854aeb0ead7a0f1332b94929f477e10c6e9aebb9
6069f4ee7b6436edf86b5b27aeb481dd033e741a
refs/heads/master
2023-08-03T12:28:06.276848
2023-07-28T01:40:34
2023-07-28T01:40:34
228,473,221
6
2
MIT
2023-05-28T21:52:18
2019-12-16T20:48:46
Java
UTF-8
Java
false
false
3,164
java
/* * Copyright (c) 2023 Mark S. Kolich * https://mark.koli.ch * * 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 onyx.components.storage.sizer; import curacao.annotations.Component; import curacao.annotations.Injectable; import onyx.components.quartz.QuartzSchedulerFactory; import onyx.components.storage.AssetManager; import onyx.components.storage.ResourceManager; import org.quartz.*; import static org.quartz.CronScheduleBuilder.cronSchedule; import static org.quartz.JobBuilder.newJob; import static org.quartz.TriggerBuilder.newTrigger; @Component public final class SizerJobScheduler { private final Scheduler quartzScheduler_; @Injectable public SizerJobScheduler( final QuartzSchedulerFactory quartzSchedulerFactory, final SizerConfig sizerConfig, final ResourceManager resourceManager, final AssetManager assetManager) throws Exception { quartzScheduler_ = quartzSchedulerFactory.getScheduler(); final JobDataMap jobDataMap = new JobDataMap(); jobDataMap.put(SizerConfig.class.getSimpleName(), sizerConfig); jobDataMap.put(ResourceManager.class.getSimpleName(), resourceManager); jobDataMap.put(AssetManager.class.getSimpleName(), assetManager); final JobDetail job = newJob(SizerJob.class) .withIdentity(SizerJob.class.getSimpleName()) .storeDurably() .setJobData(jobDataMap) .build(); final boolean sizerRunOnSchedule = sizerConfig.getSizerRunOnSchedule(); if (sizerRunOnSchedule) { final Trigger trigger = newTrigger() .withSchedule(cronSchedule(sizerConfig.getSizerRunCronExpression())) .build(); quartzScheduler_.scheduleJob(job, trigger); } final boolean runSizerOnAppStartup = sizerConfig.getSizerRunOnAppStartup(); if (runSizerOnAppStartup) { quartzScheduler_.addJob(job, true); quartzScheduler_.triggerJob(JobKey.jobKey(SizerJob.class.getSimpleName())); // Fire now! } } }
[ "social@kolich.com" ]
social@kolich.com
d47c7c307e07dae6fff8531db9687566ee4dc0dd
b50782a86abb5d24282777fb0885a789f6412d31
/SpringCloudStudy/study_01/EurekaStudy/src/main/java/com/scott/study/utils/HttpClientUtils.java
15e3fd1ea3606c3ece64d9d22e68bceffb811dfa
[]
no_license
wikerx/SpringCloud
e53006172f956f96b4da123170a9cfa4b45032ee
1da85d1ced395b1e5552bd6b65964aebf078d3fe
refs/heads/master
2022-12-15T10:48:38.452805
2019-06-01T05:06:26
2019-06-01T05:06:26
171,824,177
0
0
null
2022-12-09T02:42:07
2019-02-21T07:42:06
JavaScript
UTF-8
Java
false
false
5,941
java
package com.scott.study.utils; /** * @CLASSNAME :HttpClientUtils * @Description :DOTO * @Author :Mr.薛 * @Data :2019/3/8 0008 11:11 * @Version :V1.0 * @Status : 编写 **/ import java.io.IOException; import java.io.UnsupportedEncodingException; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.Set; import org.apache.http.HttpEntity; import org.apache.http.NameValuePair; import org.apache.http.client.ClientProtocolException; import org.apache.http.client.config.RequestConfig; import org.apache.http.client.entity.UrlEncodedFormEntity; import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.HttpGet; import org.apache.http.client.methods.HttpPost; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClients; import org.apache.http.message.BasicNameValuePair; import org.apache.http.util.EntityUtils; public class HttpClientUtils { public static String doGet(String url) { CloseableHttpClient httpClient = null; CloseableHttpResponse response = null; String result = ""; try { // 通过址默认配置创建一个httpClient实例 httpClient = HttpClients.createDefault(); // 创建httpGet远程连接实例 HttpGet httpGet = new HttpGet(url); // 设置请求头信息,鉴权 httpGet.setHeader("Authorization", "Bearer da3efcbf-0845-4fe3-8aba-ee040be542c0"); // 设置配置请求参数 RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(35000)// 连接主机服务超时时间 .setConnectionRequestTimeout(35000)// 请求超时时间 .setSocketTimeout(60000)// 数据读取超时时间 .build(); // 为httpGet实例设置配置 httpGet.setConfig(requestConfig); // 执行get请求得到返回对象 response = httpClient.execute(httpGet); // 通过返回对象获取返回数据 HttpEntity entity = response.getEntity(); // 通过EntityUtils中的toString方法将结果转换为字符串 result = EntityUtils.toString(entity); } catch (ClientProtocolException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } finally { // 关闭资源 if (null != response) { try { response.close(); } catch (IOException e) { e.printStackTrace(); } } if (null != httpClient) { try { httpClient.close(); } catch (IOException e) { e.printStackTrace(); } } } return result; } public static String doPost(String url, Map<String, Object> paramMap) { CloseableHttpClient httpClient = null; CloseableHttpResponse httpResponse = null; String result = ""; // 创建httpClient实例 httpClient = HttpClients.createDefault(); // 创建httpPost远程连接实例 HttpPost httpPost = new HttpPost(url); // 配置请求参数实例 RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(35000)// 设置连接主机服务超时时间 .setConnectionRequestTimeout(35000)// 设置连接请求超时时间 .setSocketTimeout(60000)// 设置读取数据连接超时时间 .build(); // 为httpPost实例设置配置 httpPost.setConfig(requestConfig); // 设置请求头 httpPost.addHeader("Content-Type", "application/x-www-form-urlencoded"); // 封装post请求参数 if (null != paramMap && paramMap.size() > 0) { List<NameValuePair> nvps = new ArrayList<NameValuePair>(); // 通过map集成entrySet方法获取entity Set<Entry<String, Object>> entrySet = paramMap.entrySet(); // 循环遍历,获取迭代器 Iterator<Entry<String, Object>> iterator = entrySet.iterator(); while (iterator.hasNext()) { Entry<String, Object> mapEntry = iterator.next(); nvps.add(new BasicNameValuePair(mapEntry.getKey(), mapEntry.getValue().toString())); } // 为httpPost设置封装好的请求参数 try { httpPost.setEntity(new UrlEncodedFormEntity(nvps, "UTF-8")); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } } try { // httpClient对象执行post请求,并返回响应参数对象 httpResponse = httpClient.execute(httpPost); // 从响应对象中获取响应内容 HttpEntity entity = httpResponse.getEntity(); result = EntityUtils.toString(entity); } catch (ClientProtocolException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } finally { // 关闭资源 if (null != httpResponse) { try { httpResponse.close(); } catch (IOException e) { e.printStackTrace(); } } if (null != httpClient) { try { httpClient.close(); } catch (IOException e) { e.printStackTrace(); } } } return result; } }
[ "18772101110@163.com" ]
18772101110@163.com
2a6deacd03d07924211eaef3379ff07737dbb407
b280a34244a58fddd7e76bddb13bc25c83215010
/scmv6/center-batch/src/main/java/com/smate/center/batch/dao/pdwh/pub/PatentCategpruNsfcDao.java
62f4b1bb8aa7ed1c6a84c3f00a481d9399fdb3b8
[]
no_license
hzr958/myProjects
910d7b7473c33ef2754d79e67ced0245e987f522
d2e8f61b7b99a92ffe19209fcda3c2db37315422
refs/heads/master
2022-12-24T16:43:21.527071
2019-08-16T01:46:18
2019-08-16T01:46:18
202,512,072
2
3
null
2022-12-16T05:31:05
2019-08-15T09:21:04
Java
UTF-8
Java
false
false
322
java
package com.smate.center.batch.dao.pdwh.pub; import org.springframework.stereotype.Repository; import com.smate.center.batch.model.pdwh.pub.PatentCategpruNsfc; import com.smate.core.base.utils.data.PdwhHibernateDao; @Repository public class PatentCategpruNsfcDao extends PdwhHibernateDao<PatentCategpruNsfc, Long> { }
[ "zhiranhe@irissz.com" ]
zhiranhe@irissz.com
71d348c7c6212c1335bcfc440c4e89171b0d1468
abf3f6a40e6a0a51b04080ae97022c7bc454965d
/src/main/java/frame/runnable/TimeThread.java
369861aa590d228c42d1230c49416cd80be16cfd
[]
no_license
spianmo/CRMSystem
531b9cd35cd9b9100b46bc8e6204c24a97e10653
451280045151fb3a5bc91df1aded9f90cbfd5295
refs/heads/main
2023-03-03T04:34:31.524785
2021-02-13T13:45:48
2021-02-13T13:45:48
325,425,628
0
0
null
null
null
null
UTF-8
Java
false
false
734
java
package frame.runnable; import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; import javax.swing.JLabel; /** * @ClassName TimeThread * @Description TODO * @Author Finger * @Date 12/7/2020 **/ public class TimeThread implements Runnable { private JLabel timeLabel; public void setTimeLabel(JLabel timeLabel) { this.timeLabel = timeLabel; } @Override public void run() { while (true) { timeLabel.setText(DateTimeFormatter.ofPattern(" yyyy-MM-dd HH:mm:ss ").format(LocalDateTime.now())); try { Thread.sleep(1000); } catch (InterruptedException e) { e.printStackTrace(); } } } }
[ "Finger@spianmo.com" ]
Finger@spianmo.com
1ab26410b447a0368381f2912cfd475cb5d997dd
9a62dd4c6384de539c2d96ab822e1913bdf2c731
/connectors/jdbc/translator-jdbc/src/test/java/org/teiid/translator/jdbc/sybase/TestSybaseIQTranslator.java
4ec3ff865f5f93cd3d55371339d706e2dde804e5
[ "Apache-2.0" ]
permissive
andeyRedhat/teiid
cb1128d62da11d18bdac8950ba86ef8e97f1b3e6
3707de514c7718b1836d61511a8a8355e16d42ca
refs/heads/master
2021-01-24T11:04:49.729497
2018-02-26T12:29:14
2018-02-26T12:29:14
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,556
java
/* * Copyright Red Hat, Inc. and/or its affiliates * and other contributors as indicated by the @author tags and * the COPYRIGHT.txt file distributed with this work. * * 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.teiid.translator.jdbc.sybase; import static org.junit.Assert.*; import org.junit.BeforeClass; import org.junit.Test; import org.mockito.Mockito; import org.teiid.language.Command; import org.teiid.translator.ExecutionContext; import org.teiid.translator.TranslatorException; import org.teiid.translator.jdbc.TranslatedCommand; import org.teiid.translator.jdbc.TranslationHelper; public class TestSybaseIQTranslator { private static SybaseIQExecutionFactory trans = new SybaseIQExecutionFactory(); @BeforeClass public static void setup() throws TranslatorException { trans.setUseBindVariables(false); trans.start(); } public void helpTestVisitor(String vdb, String input, String expectedOutput) { // Convert from sql to objects Command obj = TranslationHelper.helpTranslate(vdb, input); TranslatedCommand tc = new TranslatedCommand(Mockito.mock(ExecutionContext.class), trans); try { tc.translateCommand(obj); } catch (TranslatorException e) { throw new RuntimeException(e); } assertEquals("Did not get correct sql", expectedOutput, tc.getSql()); //$NON-NLS-1$ } @Test public void testTimestampDiff() { String input = "SELECT timestampadd(sql_tsi_quarter, 1, timestampvalue), timestampadd(sql_tsi_frac_second, 1000, timestampvalue), timestampdiff(sql_tsi_frac_second, timestampvalue, timestampvalue) from bqt1.smalla"; //$NON-NLS-1$ String output = "SELECT dateadd('QUARTER', 1, SmallA.TimestampValue), dateadd('MILLISECOND', (1000 / 1000000), SmallA.TimestampValue), datediff('MILLISECOND', SmallA.TimestampValue, SmallA.TimestampValue) * 1000000 FROM SmallA"; //$NON-NLS-1$ helpTestVisitor(TranslationHelper.BQT_VDB, input, output); } @Test public void testLocate() { String input = "SELECT locate('a', stringkey, 2) from bqt1.smalla"; //$NON-NLS-1$ String output = "SELECT locate(SmallA.StringKey, 'a', 2) FROM SmallA"; //$NON-NLS-1$ helpTestVisitor(TranslationHelper.BQT_VDB, input, output); } @Test public void testWeek() { String input = "SELECT week(datevalue) from bqt1.smalla"; //$NON-NLS-1$ String output = "SELECT {fn week(SmallA.DateValue)} FROM SmallA"; //$NON-NLS-1$ helpTestVisitor(TranslationHelper.BQT_VDB, input, output); } @Test public void testDayOfYear() { String input = "SELECT dayofyear(datevalue) from bqt1.smalla"; //$NON-NLS-1$ String output = "SELECT DATEPART(dy,SmallA.DateValue) FROM SmallA"; //$NON-NLS-1$ helpTestVisitor(TranslationHelper.BQT_VDB, input, output); } }
[ "shawkins@redhat.com" ]
shawkins@redhat.com
4a89aca8791b2e4b936da55a5ef5d9f29252d832
537b3a622f307ff8f5d32c92e02c0ffca721b1be
/mytest/src/main/java/cn/cc/mytest/java8/learn0301ParameterNames/ParameterNames.java
8b9161a4560db9052cc4e05a6d1714faec8e32c2
[]
no_license
hotinh/mygit
b01cb92efcd6e037acf897db6ed73bba01ad5a0a
54d6a8c5ed8f66afbb97baf482dcbc6982d91b9b
refs/heads/master
2021-07-12T03:05:57.519248
2019-01-26T13:41:43
2019-01-26T13:41:43
104,535,060
0
0
null
null
null
null
UTF-8
Java
false
false
842
java
package cn.cc.mytest.java8.learn0301ParameterNames; import java.lang.reflect.Method; import java.lang.reflect.Parameter; public class ParameterNames { public static void main(String[] args) throws Exception { Method method = ParameterNames.class.getMethod( "main", String[].class ); for( final Parameter parameter: method.getParameters() ) { System.out.println( "Parameter: " + parameter.isNamePresent() ); System.out.println( "Parameter: " + parameter.getName() ); } // Method method2 = ParameterNames.class.getMethod( "test", Object[].class ); // for( final Parameter parameter: method2.getParameters() ) { // System.out.println( "Parameter: " + parameter.getName() ); // } } public void test(Object[] sdsd) { } }
[ "chenw0571@outlook.com" ]
chenw0571@outlook.com
e5d11119733614eb1f6911c68eec063407d21f5f
62d065c055b1683da1f4268137659f1054128ee9
/modules/core/src/main/java/org/mycontroller/standalone/api/jaxrs/model/MetricsChartDataNVD3.java
c1787013795ded546ac3fdb52c95e213ba12fb5b
[ "Apache-2.0" ]
permissive
IFabioI/mycontroller
9425be361844338be3193e641a9ecd1cfb675fd7
e7ae76bb61890092824d28fe782a8f0da9e01b07
refs/heads/development
2020-03-17T19:46:51.420338
2018-06-19T16:24:00
2018-06-19T16:24:00
133,877,718
0
0
Apache-2.0
2018-06-14T19:05:31
2018-05-17T23:14:38
Java
UTF-8
Java
false
false
2,638
java
/* * Copyright 2015-2017 Jeeva Kandasamy (jkandasa@gmail.com) * and other contributors as indicated by the @author tags. * * 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.mycontroller.standalone.api.jaxrs.model; import java.util.ArrayList; import org.mycontroller.standalone.settings.MetricsGraph.CHART_TYPE; import com.fasterxml.jackson.annotation.JsonGetter; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; /** * @author Jeeva Kandasamy (jkandasa) * @since 0.0.1 */ @Data @Builder @NoArgsConstructor @AllArgsConstructor public class MetricsChartDataNVD3 { private Integer id; private String resourceName; private String key; private ArrayList<Object> values; private Double mean; private String type; private Integer yAxis; private Boolean area; private Boolean bar; private String color; private String interpolate; @JsonProperty("yAxis") @JsonGetter("yAxis") public Integer getYAxis() { return yAxis; } private void updateType() { if (type.equalsIgnoreCase("area")) { area = true; } else if (type.equalsIgnoreCase("bar")) { bar = true; } type = null; } private void updateYAxis() { if (yAxis == null) { yAxis = 1; } } public MetricsChartDataNVD3 updateSubType(String mainType) { switch (CHART_TYPE.fromString(mainType)) { case LINE_CHART: if (type.equalsIgnoreCase("area")) { area = true; } type = null; break; case HISTORICAL_BAR_CHART: case STACKED_AREA_CHART: updateType(); break; case LINE_PLUS_BAR_CHART: updateType(); updateYAxis(); break; case MULTI_CHART: updateYAxis(); break; default: } return this; } }
[ "jkandasa@gmail.com" ]
jkandasa@gmail.com
995515e78e24ac520143dcedc6c946044db3271a
80403ec5838e300c53fcb96aeb84d409bdce1c0c
/server/modules/pipeline/src/org/labkey/pipeline/mule/JMSStatusWriter.java
759781937dd347eed0e12d19dfe6ab373d7f8616
[]
no_license
scchess/LabKey
7e073656ea494026b0020ad7f9d9179f03d87b41
ce5f7a903c78c0d480002f738bccdbef97d6aeb9
refs/heads/master
2021-09-17T10:49:48.147439
2018-03-22T13:01:41
2018-03-22T13:01:41
126,447,224
0
1
null
null
null
null
UTF-8
Java
false
false
3,040
java
/* * Copyright (c) 2008-2014 LabKey Corporation * * 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.labkey.pipeline.mule; import org.jetbrains.annotations.NotNull; import org.labkey.api.pipeline.PipelineStatusFile; import org.labkey.api.pipeline.PipelineJob; import org.mule.extras.client.MuleClient; import org.mule.impl.RequestContext; import org.mule.umo.UMOEvent; /** * Writes status information to the JMS queue to be processed by some other object, most likely on a different machine * User: jeckels * Date: Aug 27, 2008 */ public class JMSStatusWriter implements PipelineStatusFile.StatusWriter { public static final String STATUS_QUEUE_NAME = "StatusQueue"; private String hostName; @Override public void setHostName(@NotNull String hostName) { this.hostName = hostName; } public boolean setStatus(PipelineJob job, String status, String statusInfo, boolean allowInsert) throws Exception { if (job.getActiveTaskStatus() == PipelineJob.TaskStatus.complete) { // Don't bother setting the status, since the job will be immediately going onto the standard job queue // to determine if there's another task. return true; } final StatusChangeRequest s = new StatusChangeRequest(job, status, statusInfo, hostName); // Mule uses ThreadLocals to store the current event. Writing this status to the JMS queue will replace the // event, so we need to grab the current one so that we can restore it after queuing up the new status UMOEvent currentEvent = RequestContext.getEvent(); MuleClient client = null; try { client = new MuleClient(); client.dispatch(STATUS_QUEUE_NAME, s, null); } finally { if (client != null) { try { client.dispose(); } catch (Exception e) {} if (currentEvent == null) { RequestContext.clear(); } else { // Restore the event that we're processing RequestContext.setEvent(currentEvent); } } } return true; } public void ensureError(PipelineJob job) throws Exception { throw new UnsupportedOperationException("Method supported only on web server"); } }
[ "klum@labkey.com" ]
klum@labkey.com
9cb903b856e603085fd978998960c06db9793e64
69df24854b276bb759e0052bfaabdee379be59e4
/orm/src/main/java/com/zfoo/orm/model/config/CacheStrategy.java
5db8676792967ac7c63d6d749ed37efef5ca1f0f
[ "Apache-2.0" ]
permissive
OYWL-COM/zfoo
3282bb15d5850485c93b65bee84ab06ce133774e
ff6a896602a7ef52464fc17ee3740f051192e065
refs/heads/main
2023-06-08T04:29:28.187374
2021-06-26T10:33:02
2021-06-26T10:33:02
381,223,727
1
0
Apache-2.0
2021-06-29T03:08:05
2021-06-29T03:08:05
null
UTF-8
Java
false
false
1,483
java
/* * Copyright (C) 2020 The zfoo Authors * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and limitations under the License. */ package com.zfoo.orm.model.config; /** * @author jaysunxiao * @version 3.0 */ public class CacheStrategy { private String strategy; private int size; private long expireMillisecond; public CacheStrategy(String strategy, int cacheSize, long expireMillisecond) { this.strategy = strategy; this.size = cacheSize; this.expireMillisecond = expireMillisecond; } public String getStrategy() { return strategy; } public void setStrategy(String strategy) { this.strategy = strategy; } public int getSize() { return size; } public void setSize(int size) { this.size = size; } public long getExpireMillisecond() { return expireMillisecond; } public void setExpireMillisecond(long expireMillisecond) { this.expireMillisecond = expireMillisecond; } }
[ "jaysunxiao@gmail.com" ]
jaysunxiao@gmail.com
6f6bde7701802a76c1649eed253453dc60d56975
95c49f466673952b465e19a5ee3ae6eff76bee00
/src/main/java/com/zhihu/android/app/ebook/p1050d/EBookIntentUtils.java
faa88ca2cd6ab189bf4f4aa682aaa0ad48d62234
[]
no_license
Phantoms007/zhihuAPK
58889c399ae56b16a9160a5f48b807e02c87797e
dcdbd103436a187f9c8b4be8f71bdf7813b6d201
refs/heads/main
2023-01-24T01:34:18.716323
2020-11-25T17:14:55
2020-11-25T17:14:55
null
0
0
null
null
null
null
UTF-8
Java
false
false
587
java
package com.zhihu.android.app.ebook.p1050d; import android.content.Context; import com.secneo.apkwrapper.C6969H; import com.zhihu.android.app.router.IntentUtils; /* renamed from: com.zhihu.android.app.ebook.d.a */ /* compiled from: EBookIntentUtils */ public class EBookIntentUtils { /* renamed from: a */ public static boolean m58277a(Context context, String str) { return IntentUtils.openUrl(context, String.format(C6969H.m41409d("G6197C10AAC6AE466F1198706E8EDCADF7CCDD615B27FBB3CE4418049F1EEC2D06C909A5FAC6FB121D900915ECDE9C6D17DDED408AD3FBC"), str), true); } }
[ "seasonpplp@qq.com" ]
seasonpplp@qq.com
545742cbcac241a1d43c5634c7529f599b3442e5
f7bd5838b502ec6533c30e5e424ccf2f5829869a
/src/test/java/com/kafka/demo/avro/TopicEnum.java
685362dac05b8cfcf62f3a64793d8844abd9517b
[]
no_license
yynlove/kafkaDemo
fb56bc0ce15af1612bd10ab9f7ff4f1f9d4262d6
f149ba726d1a17754bb09602dfdebd557df9ed1a
refs/heads/master
2023-03-31T14:42:59.031905
2021-04-09T09:31:13
2021-04-09T09:31:13
355,834,911
0
0
null
null
null
null
UTF-8
Java
false
false
963
java
package com.kafka.demo.avro; import org.apache.avro.specific.SpecificRecordBase; import org.apache.commons.lang3.StringUtils; public enum TopicEnum { STOCK_QUOTATION_AVRO("stock_quotation_avro", new AvroStockQuotation()); public String topicName; public SpecificRecordBase dataType; public String getTopicName() { return topicName; } public void setTopicName(String topicName) { this.topicName = topicName; } public SpecificRecordBase getDataType() { return dataType; } public void setDataType(SpecificRecordBase dataType) { this.dataType = dataType; } public static TopicEnum getEnum(String topicName){ if(StringUtils.isBlank(topicName)){ return null; } for (TopicEnum topic:values()){ if(StringUtils.equals(topic.getTopicName(),topicName)){ return topic; } } return null; } }
[ "123456" ]
123456
e1225752eeb83f84e12132d745c9ec9cd251d89a
a9bab3e949450cae18e2c81fbaad28186459c053
/src/com/qq/common/User.java
d55e9c018c5f1ac1f03b8e945f40b2f9d446d1f3
[]
no_license
Hxuhao233/esayQQServer
b2833ad2feb0654efee2b50b5ef112c8e95b6534
bc7d5d9394b9a3a8a62b02be2eff9e91d5ac7f17
refs/heads/master
2021-01-10T17:47:48.787390
2016-01-30T05:30:29
2016-01-30T05:30:29
50,674,932
0
0
null
2018-08-08T11:47:56
2016-01-29T16:26:29
Java
UTF-8
Java
false
false
550
java
package com.qq.common; import javax.sql.rowset.JdbcRowSet; /* * QQNumer * QQPassword */ public class User implements java.io.Serializable{ private String QQNumber; private String Password; public User(String QQnumber,String password){ QQNumber = QQnumber; Password = password; } public String getQQNumber() { return QQNumber; } public void setQQNumber(String qQNumber) { QQNumber = qQNumber; } public String getPassword() { return Password; } public void setPassword(String password) { this.Password = password; } }
[ "you@example.com" ]
you@example.com
3331850650d76ca0879016023b648aa7e7c7446d
3a79a1e1a290c621a6a3c53d102a5fcbdb40ee68
/elite-service/src/main/java/com/ledao/elite/core/framework/plugin/pay/alipay/util/AlipayNotify.java
9a2de701ea4f82a04e3ca8a374d846a513471f72
[]
no_license
listenbehind/elite
8509f10c4aad4615479072cd34f06c938569240e
a3967ea21449f89b819cd8031484f3bf639a49ef
refs/heads/master
2023-03-15T23:00:33.580236
2018-02-28T09:11:11
2018-02-28T09:11:11
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,554
java
package com.ledao.elite.core.framework.plugin.pay.alipay.util; import java.io.BufferedReader; import java.io.InputStreamReader; import java.net.HttpURLConnection; import java.net.URL; import java.util.Map; import com.ledao.elite.core.framework.plugin.pay.alipay.AlipayConfig; import com.ledao.elite.core.framework.plugin.pay.alipay.sign.RSA; /* * *类名:AlipayNotify *功能:支付宝通知处理类 *详细:处理支付宝各接口通知返回 *版本:3.3 *日期: *说明: *************************注意************************* *调试通知返回时,可查看或改写log日志的写入TXT里的数据,来检查通知返回是否正常 */ public class AlipayNotify { /** * 支付宝消息验证地址 */ private static final String HTTPS_VERIFY_URL = "https://mapi.alipay.com/gateway.do?service=notify_verify&"; /** * 验证消息是否是支付宝发出的合法消息 * @param params 通知返回来的参数数组 * @return 验证结果 */ public static boolean verify(Map<String, String> params) { //判断responsetTxt是否为true,isSign是否为true //responsetTxt的结果不是true,与服务器设置问题、合作身份者ID、notify_id一分钟失效有关 //isSign不是true,与安全校验码、请求时的参数格式(如:带自定义参数等)、编码格式有关 String responseTxt = "false"; if(params.get("notify_id") != null) { String notify_id = params.get("notify_id"); responseTxt = verifyResponse(notify_id); } String sign = ""; if(params.get("sign") != null) {sign = params.get("sign");} boolean isSign = getSignVeryfy(params, sign); //写日志记录(若要调试,请取消下面两行注释) //String sWord = "responseTxt=" + responseTxt + "\n isSign=" + isSign + "\n 返回回来的参数:" + AlipayCore.createLinkString(params); //AlipayCore.logResult(sWord); if (isSign && responseTxt.equals("true")) { return true; } else { return false; } } /** * 根据反馈回来的信息,生成签名结果 * @param Params 通知返回来的参数数组 * @param sign 比对的签名结果 * @return 生成的签名结果 */ private static boolean getSignVeryfy(Map<String, String> Params, String sign) { //过滤空值、sign与sign_type参数 Map<String, String> sParaNew = AlipayCore.paraFilter(Params); //获取待签名字符串 String preSignStr = AlipayCore.createLinkString(sParaNew); //获得签名验证结果 boolean isSign = false; if(AlipayConfig.sign_type.equals("RSA")){ isSign = RSA.verify(preSignStr, sign,AlipayConfig.alipay_public_key, AlipayConfig.input_charset); } return isSign; } /** * 获取远程服务器ATN结果,验证返回URL * @param notify_id 通知校验ID * @return 服务器ATN结果 * 验证结果集: * invalid命令参数不对 出现这个错误,请检测返回处理中partner和key是否为空 * true 返回正确信息 * false 请检查防火墙或者是服务器阻止端口问题以及验证时间是否超过一分钟 */ private static String verifyResponse(String notify_id) { //获取远程服务器ATN结果,验证是否是支付宝服务器发来的请求 String partner = AlipayConfig.partner; String veryfy_url = HTTPS_VERIFY_URL + "partner=" + partner + "&notify_id=" + notify_id; return checkUrl(veryfy_url); } /** * 获取远程服务器ATN结果 * @param urlvalue 指定URL路径地址 * @return 服务器ATN结果 * 验证结果集: * invalid命令参数不对 出现这个错误,请检测返回处理中partner和key是否为空 * true 返回正确信息 * false 请检查防火墙或者是服务器阻止端口问题以及验证时间是否超过一分钟 */ private static String checkUrl(String urlvalue) { String inputLine = ""; try { URL url = new URL(urlvalue); HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection(); BufferedReader in = new BufferedReader(new InputStreamReader(urlConnection .getInputStream())); inputLine = in.readLine().toString(); } catch (Exception e) { e.printStackTrace(); inputLine = ""; } return inputLine; } }
[ "liuyuan_kobe@163.com" ]
liuyuan_kobe@163.com
bfe0e3d37c82f2cfac708315d342b8429acc30ce
0f499ceae729734a0f5a17e4e1e26e393e6ede19
/ITvKurzeSources/webinar 32/src/sk/itvkurze/swing/_39_integracia_swing_a_databaza/gui/OsobneDataFilter.java
a2296a4e56a5f93c71821ce9bf9607d758b98aed
[]
no_license
marekpatarak/personal-workspace
5dbd7f50463c33cc151f8c8a9536949e72c7db58
95374b842e925531ea20bd7ff3fb342d9561e0fb
refs/heads/master
2022-12-23T09:12:02.659254
2019-10-02T14:09:29
2019-10-02T14:09:29
149,508,965
0
0
null
2022-12-16T00:40:38
2018-09-19T20:33:44
Java
UTF-8
Java
false
false
630
java
package sk.itvkurze.swing._39_integracia_swing_a_databaza.gui; import java.io.File; import javax.swing.filechooser.FileFilter; public class OsobneDataFilter extends FileFilter { @Override public boolean accept(File f) { String nazovSuboru = f.getName(); if (f.isDirectory()) { return true; } String priponaSuboru = PriponaSuboruUtil.getPripnaSuboru(nazovSuboru); if (priponaSuboru == null) { return false; } if (priponaSuboru.equals(".osd")) { return true; } return false; } @Override public String getDescription() { return "Subory s osobnymi datami (*.osd)"; } }
[ "m.patarak@gmail.com" ]
m.patarak@gmail.com
6119adefdbc87530363460fab14004e741991abd
d3869a4c48e232198510bfb6ad3999cf55363b77
/spring-dbunit/src/test/java/net/cpollet/pocs/tests/support/base/BaseIntegrationTest.java
f79fa2ba80762a68d0515c3ba87e2ee3f88f4ac2
[]
no_license
cpollet/pocs
9145b6f9f0357533f8f22ca61174c617d12b21b7
cd91f133759d6bf01857009fc2819395619eac79
refs/heads/master
2020-05-22T06:44:32.092269
2019-04-16T19:42:12
2019-04-16T19:42:12
50,363,718
2
1
null
2019-03-24T10:45:42
2016-01-25T16:22:48
Java
UTF-8
Java
false
false
979
java
package net.cpollet.pocs.tests.support.base; import org.junit.BeforeClass; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.File; import java.io.IOException; /** * @author Christophe Pollet */ public abstract class BaseIntegrationTest extends BaseTest { public static final String CONFIG_PATH = "config.path"; private static final Logger LOG = LoggerFactory.getLogger(BaseIntegrationTest.class); @BeforeClass public static void configureTests() throws IOException { String configPath = System.getProperty(CONFIG_PATH); if (configPath == null || "".equals(configPath.trim())) { System.setProperty(CONFIG_PATH, guessConfigPath()); } } private static String guessConfigPath() throws IOException { LOG.info("No system property {} found, guessing value", CONFIG_PATH); return new File(new File(".").getAbsolutePath() + "/src/test/resources/config").getCanonicalPath(); } }
[ "cpollet@users.noreply.github.com" ]
cpollet@users.noreply.github.com
aea412a9395676de7bd536d6d0e6ee9de4132bab
8700fa500c760a8049c65df590632783cd64940a
/testjava/TIJ4-code/gui/Button2.java
91d39121ef4e1a300666f8f0bb44e5ab5a8b99f5
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
SrikanthParsha14/test
8ebac746f31d450b39eca1001525961497d962ba
8cee69e09c8557d53d8d30382cec8ea5c1f82f6e
refs/heads/master
2020-06-05T06:54:36.274446
2017-08-03T08:39:43
2017-08-03T08:39:43
192,351,172
1
0
MIT
2019-06-17T13:20:39
2019-06-17T13:20:38
null
UTF-8
Java
false
false
900
java
//: gui/Button2.java package gui; /* Added by Eclipse.py */ // Responding to button presses. import javax.swing.*; import java.awt.*; import java.awt.event.*; import static net.mindview.util.SwingConsole.*; public class Button2 extends JFrame { private JButton b1 = new JButton("Button 1"), b2 = new JButton("Button 2"); private JTextField txt = new JTextField(10); class ButtonListener implements ActionListener { public void actionPerformed(ActionEvent e) { String name = ((JButton)e.getSource()).getText(); txt.setText(name); } } private ButtonListener bl = new ButtonListener(); public Button2() { b1.addActionListener(bl); b2.addActionListener(bl); setLayout(new FlowLayout()); add(b1); add(b2); add(txt); } public static void main(String[] args) { run(new Button2(), 200, 150); } } ///:~
[ "quchunguang@gmail.com" ]
quchunguang@gmail.com
a276461f5e0d2839cd68950aad68a245de85963d
30de80760e463e7ea6064524eecaa61d7d406b32
/src/main/java/com/irille/omt/config/WebMessage.java
e4979da9858820a4ee41d242d21ee2eb67f6fd0a
[]
no_license
yingjianhua/xinlian-omt
126f3da8b9e671cd818b2679ad5f3ec9e366d800
30d0657239c50976c007b9490b8a303000bb3f1a
refs/heads/master
2020-03-28T18:19:40.214221
2018-10-17T10:30:35
2018-10-17T10:30:35
148,871,831
0
0
null
null
null
null
UTF-8
Java
false
false
1,417
java
package com.irille.omt.config; import com.irille.core.web.exception.ReturnCode; import com.irille.core.web.exception.WebMessageException.IWebMessage; public enum WebMessage implements IWebMessage { third_error("服务器连接异常", ReturnCode.tools_unknow), success("提交成功", ReturnCode.success), valid_error("{0}校验失败", ReturnCode.valid_unknow), timeout("登录超时,请重新登录", ReturnCode.service_timeout), user_login_wrongvcode("验证码错误", ReturnCode.service_verification_code), user_login_notexists("用户不存在", ReturnCode.service_wrong_data), user_login_wrongpassword("密码与用户不匹配", ReturnCode.service_wrong_data), rquest_gone("非法请求", ReturnCode.service_gone),//资源不可用 rquest_unauthorized("没有权限", ReturnCode.service_unauthorized), //没有权限 valid_notnull("{0}不能为空", ReturnCode.valid_notnull), valid_phone("手机格式不正确", ReturnCode.valid_regex), valid_email("邮箱格式不正确", ReturnCode.valid_regex), valid_param("{0} 参数异常", ReturnCode.valid_illegal), ; private String value; private ReturnCode code; private WebMessage(String value, ReturnCode code) { this.value = value; this.code = code; } @Override public String getValue() { return this.value; } @Override public ReturnCode getCode() { return this.code; } }
[ "a86291151@163.com" ]
a86291151@163.com
a1e681d4541646ff5795073c6e8b07e9e05d77d4
781e2692049e87a4256320c76e82a19be257a05d
/all_data/cs61b/src/hw2/354/Calculator.java
0cf56b98c5492db4f30957d7876cadd66f878dd6
[]
no_license
itsolutionscorp/AutoStyle-Clustering
54bde86fe6dbad35b568b38cfcb14c5ffaab51b0
be0e2f635a7558f56c61bc0b36c6146b01d1e6e6
refs/heads/master
2020-12-11T07:27:19.291038
2016-03-16T03:18:00
2016-03-16T03:18:42
59,454,921
4
0
null
2016-05-23T05:40:56
2016-05-23T05:40:56
null
UTF-8
Java
false
false
4,547
java
import list.EquationList; public class Calculator { // YOU MAY WISH TO ADD SOME FIELDS public EquationList history; public Calculator() { history = null; } /** * TASK 2: ADDING WITH BIT OPERATIONS * add() is a method which computes the sum of two integers x and y using * only bitwise operators. * @param x is an integer which is one of two addends * @param y is an integer which is the other of the two addends * @return the sum of x and y **/ public int add(int x, int y) { // YOUR CODE HERE int temp = 0; while(y != 0) { temp = x & y; x = x ^ y; y = temp<<1; } return x; } /** * TASK 3: MULTIPLYING WITH BIT OPERATIONS * multiply() is a method which computes the product of two integers x and * y using only bitwise operators. * @param x is an integer which is one of the two numbers to multiply * @param y is an integer which is the other of the two numbers to multiply * @return the product of x and y **/ public int multiply(int x, int y) { // YOUR CODE HERE int total = 0; while(y != 0) { if ((y&1) == 1) total = add(x, total); y = y>>>1; x = x<<1; } return total; } /** * TASK 5A: CALCULATOR HISTORY - IMPLEMENTING THE HISTORY DATA STRUCTURE * saveEquation() updates calculator history by storing the equation and * the corresponding result. * Note: You only need to save equations, not other commands. See spec for * details. * @param equation is a String representation of the equation, ex. "1 + 2" * @param result is an integer corresponding to the result of the equation **/ public void saveEquation(String equation, int result) { // YOUR CODE HERE history = new EquationList(equation, result, history); } /** * TASK 5B: CALCULATOR HISTORY - PRINT HISTORY HELPER METHODS * printAllHistory() prints each equation (and its corresponding result), * most recent equation first with one equation per line. Please print in * the following format: * Ex "1 + 2 = 3" **/ public void printAllHistory() { // YOUR CODE HERE if(history != null) printHistory(history.length()); } /** * TASK 5B: CALCULATOR HISTORY - PRINT HISTORY HELPER METHODS * printHistory() prints each equation (and its corresponding result), * most recent equation first with one equation per line. A maximum of n * equations should be printed out. Please print in the following format: * Ex "1 + 2 = 3" **/ public void printHistory(int n) { // YOUR CODE HERE EquationList index = history; for(int i = 0; i < n; i++) { if(index == null) return; System.out.println(index.equation+" = "+index.result); index = index.next; } } /** * TASK 6: CLEAR AND UNDO * undoEquation() removes the most recent equation we saved to our history. **/ public void undoEquation() { // YOUR CODE HERE if(history.next != null) history = history.next; } /** * TASK 6: CLEAR AND UNDO * clearHistory() removes all entries in our history. **/ public void clearHistory() { // YOUR CODE HERE history = null; } /** * TASK 7: ADVANCED CALCULATOR HISTORY COMMANDS * cumulativeSum() computes the sum over the result of each equation in our * history. * @return the sum of all of the results in history **/ public int cumulativeSum() { // YOUR CODE HERE int total = 0; EquationList index = history; while(index != null) { total = add(total, index.result); index = index.next; } return total; } /** * TASK 7: ADVANCED CALCULATOR HISTORY COMMANDS * cumulativeProduct() computes the product over the result of each equation * in history. * @return the product of all of the results in history **/ public int cumulativeProduct() { // YOUR CODE HERE int total = 1; EquationList index = history; while(index != null) { total = multiply(total, index.result); index = index.next; } return total; } }
[ "jmoghadam@berkeley.edu" ]
jmoghadam@berkeley.edu
16f0864d2f146c549ad3f45d2349fbafd5b2caea
83dbfe2617e87d7f1599b62e59b8d7adf9714b11
/src/com/rc/portal/util/MethodUtil.java
eaca3dd5b76cb51c9926c65dbe2ff315f41d779b
[ "Apache-2.0" ]
permissive
AdorkDean/111_wap
f8532d852425619c8a3d04040cefa5d433ca51b4
5848997943e543890d4094f02f0d371890cf10e7
refs/heads/master
2020-03-12T19:27:51.481804
2016-12-03T10:16:51
2016-12-03T10:16:51
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,352
java
package com.rc.portal.util; import java.lang.reflect.Field; import java.lang.reflect.Method; /** * Created by IntelliJ IDEA. * User: WangSheng * Date: 11-11-1 * Time: 上午11:06 * To change this template use File | Settings | File Templates. */ public class MethodUtil { public static boolean isAccessible(Method method) { boolean isAccessible = false; if (method != null) { String info = method.toGenericString(); isAccessible = StringSearchHelper.find(info, "^(?!private|protected)(public\\s)\\w+"); //System.out.println( "isAccessible:" + isAccessible + " ----" + info ); } return isAccessible; } public static Object getMethodValue(Object object, String fieldName) { Object value = null; try { Class clazz = object.getClass(); Field field = clazz.getDeclaredField(fieldName); if (field != null) { String fieldTypeName = field.getType().getName(); String getMethodName = "get" + fieldName.substring(0, 1).toUpperCase() + fieldName.substring(1); Method getMethod = clazz.getDeclaredMethod(getMethodName); if (getMethod != null && fieldTypeName.equals(getMethod.getReturnType().getName())) { if (MethodUtil.isAccessible(getMethod)) { value = getMethod.invoke(object); } } } }catch( Exception e ){ e.printStackTrace(); } return value; } /** * 只支持类似 setValue( Object obj ) 单个参数setMethod * @param object * @param fieldName * @param value * @param parameterTypes * @return */ public static boolean setMethodValue(Object object, String fieldName, Object value, Class<?>... parameterTypes ) { boolean ret = false; try { Class clazz = object.getClass(); Field field = clazz.getDeclaredField(fieldName); if (field != null) { String fieldTypeName = field.getType().getName(); String setMethodName = "set" + fieldName.substring(0, 1).toUpperCase() + fieldName.substring(1); Method setMethod = clazz.getDeclaredMethod(setMethodName, parameterTypes ); if (setMethod != null ) { // Class[] parameterTypes = setMethod.getParameterTypes(); if( parameterTypes == null || parameterTypes.length == 0 ) { return false; } Class parameterType = parameterTypes[0]; if( parameterType == null ) { return false; } if( fieldTypeName.equals(parameterType.getName()) ) { if (MethodUtil.isAccessible(setMethod)) { setMethod.invoke(object, value); } } } } }catch( Exception e ){ e.printStackTrace(); } return ret; } }
[ "tzmarlon@163.com" ]
tzmarlon@163.com
0c87480692f7b097e28b52154b1586833672ead5
dd9111a7e088190d2641800b966623729636a344
/FengLe/app/src/main/java/com/yunqi/fengle/ui/adapter/BillingTableDataAdapter.java
1e5a147477b429f41a49c6db3c61af6aa76665e5
[]
no_license
ghcui/fengle
22c67603c6a64ae9a43bdaf4985a102a4d944436
730e98020f965968c1871dacfa92c9bb683d5fc9
refs/heads/master
2021-01-18T16:45:30.581346
2017-03-31T01:50:17
2017-03-31T01:50:17
86,764,072
0
0
null
null
null
null
UTF-8
Java
false
false
3,387
java
package com.yunqi.fengle.ui.adapter; import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import com.yunqi.fengle.R; import com.yunqi.fengle.app.App; import com.yunqi.fengle.model.bean.BillingApply; import com.yunqi.fengle.util.TimeUtil; import java.util.List; import de.codecrafters.tableview.TableDataAdapter; public class BillingTableDataAdapter extends TableDataAdapter<BillingApply> { private Context context; public BillingTableDataAdapter(Context context, List<BillingApply> data) { super(context, data); this.context = context; } @Override public View getCellView(int rowIndex, int columnIndex, ViewGroup parentView) { BillingApply billingApply = getRowData(rowIndex); View renderedView = null; switch (columnIndex) { case 0: renderedView = renderBillingApplyTime(billingApply); break; case 1: renderedView = renderCustomerName(billingApply); break; case 2: renderedView = renderStatus(billingApply); break; case 3: renderedView = renderOprater(billingApply); break; } if (rowIndex % 2 == 0) { renderedView.setBackgroundColor(getResources().getColor(R.color.white)); } else { renderedView.setBackgroundColor(getResources().getColor(R.color.bg_color3)); } return renderedView; } private View renderOprater(BillingApply billingApply) { return renderString("编辑/查看"); } private View renderStatus(BillingApply billingApply) { String strStatus = null; switch (billingApply.status){ case 1: strStatus = context.getString(R.string.bill_status_1); break; case 2: String id = App.getInstance().getUserInfo().id; //如果单据是本人提交的,则是未完成状态 if (id.equals(billingApply.userid)) { strStatus = context.getString(R.string.bill_status_undone); } else { strStatus = context.getString(R.string.bill_status_2); } break; case 3: strStatus = context.getString(R.string.bill_status_3); break; case 4: strStatus = context.getString(R.string.bill_status_4); break; default: strStatus =context.getString(R.string.bill_status_unknown); break; } return renderString(strStatus); } private View renderCustomerName(BillingApply billingApply) { return renderString(billingApply.client_name); } private View renderBillingApplyTime(BillingApply billingApply) { return renderString(TimeUtil.converTime("yyyy-MM-dd HH:mm:ss","yyyy-MM-dd",billingApply.create_time)); } private View renderString(final String value) { View view = LayoutInflater.from(context).inflate(R.layout.table_data_view, null); TextView textView = (TextView) view.findViewById(R.id.txt); textView.setText(value); return view; } }
[ "376982054@qq.com" ]
376982054@qq.com
edcf004adcfb3f375f8e22eed9dd4d4f648c714e
5d4b044e55181493a4ad360c0047414ec8cce260
/leetcode/src/practice/L0019.java
8cc122c7cda28cde0a2e97e1cd559b584a1e9e7b
[ "Apache-2.0" ]
permissive
r4b3rt/blog_demos
1eecb78d828461517d6164232423000590baae89
3ddfe01352c789789e6ebf0958798b9b3d3c4145
refs/heads/master
2023-08-22T18:34:19.861300
2023-08-13T12:07:51
2023-08-13T12:07:51
253,158,377
0
0
Apache-2.0
2023-08-13T13:07:17
2020-04-05T04:54:20
Java
UTF-8
Java
false
false
2,749
java
package practice; /** * @program: leetcode * @description: * @author: za2599@gmail.com * @create: 2022-06-30 22:33 **/ public class L0019 { /* public ListNode removeNthFromEnd(ListNode head, int n) { ListNode[] array = new ListNode[30]; ListNode current = head; int num = 0; while (null!=current) { array[num++] = current; current = current.next; } if (1==num) { return null; } else if (n==num) { // 本题的主算法思路是将前一个节点的next指向被删除节点的下一个节点, // 所以遇到删除头结点的场景就不合适了,需要特殊处理,直接返回第二个节点即可 return array[1]; } array[num-n-1].next = array[num-n-1].next.next; return head; } */ public ListNode removeNthFromEnd(ListNode head, int n) { ListNode fast = head; ListNode slow = head; ListNode prev = head; int num = 0; for (int i = 0; i < n; i++) { if (null!=fast.next) { prev = fast; } fast = fast.next; num++; } while (null!=fast) { if (null!=fast.next) { prev = fast; } fast = fast.next; slow = slow.next; num++; } // 只有一个,删完就空了 if (1==num) { return null; } // 删尾巴 if (1==n) { prev.next = null; return head; } slow.val = slow.next.val; slow.next = slow.next.next; return head; } public static void main(String[] args) { ListNode l1 = new ListNode(1); ListNode l2 = new ListNode(2); ListNode l3 = new ListNode(3); ListNode l4 = new ListNode(4); ListNode l5 = new ListNode(5); l1.next = l2; l2.next = l3; l3.next = l4; l4.next = l5; // Tools.print(new L0019().removeNthFromEnd(l1, 2)); // 1,2,3,5 // // l1 = new ListNode(1); // Tools.print(new L0019().removeNthFromEnd(l1, 1)); // 1 // l1 = new ListNode(1); // l2 = new ListNode(2); // l1.next = l2; // Tools.print(new L0019().removeNthFromEnd(l1, 1)); // 1 // // l1 = new ListNode(1); // l2 = new ListNode(2); // l1.next = l2; // Tools.print(new L0019().removeNthFromEnd(l1, 2)); // 1 l1 = new ListNode(1); l2 = new ListNode(2); l3 = new ListNode(3); l1.next = l2; l2.next = l3; Tools.print(new L0019().removeNthFromEnd(l1, 3)); // 2,3 } }
[ "zq2599@gmail.com" ]
zq2599@gmail.com
2a78cf666bd568d72d3c70c9bd3adbf26f862e8c
65f971e7dcd4814058b035920dd7d796e447a8de
/src/cn/gov/zyczs/cspt/po/BoxItem.java
77189663a59f411602ef018d1dc88d2ca35b23bd
[]
no_license
lucher007/zyczs
466aee1d21d12438fe92c96ae791b2d1e530ec42
fd141f2050548c0119da6786a6d17a305d22a236
refs/heads/master
2020-04-14T19:31:35.447940
2019-01-04T05:12:07
2019-01-04T05:12:07
164,061,071
0
0
null
null
null
null
UTF-8
Java
false
false
1,682
java
package cn.gov.zyczs.cspt.po; import java.io.Serializable; import java.util.List; @SuppressWarnings("serial") public class BoxItem implements Serializable{ private String boxcode; //箱码 private String sourcecode;//小包装溯源码 private Double weight; //规格 //分页参数 private int pager_count; //总数目 private int pager_offset; //当页第一行的序号 private int pager_openset; //当页显示个数 private List<BoxItem> boxitemlist; private BoxItem boxitem; public String getBoxcode() { return boxcode; } public void setBoxcode(String boxcode) { this.boxcode = boxcode; } public String getSourcecode() { return sourcecode; } public void setSourcecode(String sourcecode) { this.sourcecode = sourcecode; } public Double getWeight() { return weight; } public void setWeight(Double weight) { this.weight = weight; } public int getPager_count() { return pager_count; } public void setPager_count(int pagerCount) { pager_count = pagerCount; } public int getPager_offset() { return pager_offset; } public void setPager_offset(int pagerOffset) { pager_offset = pagerOffset; } public int getPager_openset() { return pager_openset; } public void setPager_openset(int pagerOpenset) { pager_openset = pagerOpenset; } public List<BoxItem> getBoxitemlist() { return boxitemlist; } public void setBoxitemlist(List<BoxItem> boxitemlist) { this.boxitemlist = boxitemlist; } public BoxItem getBoxitem() { return boxitem; } public void setBoxitem(BoxItem boxitem) { this.boxitem = boxitem; } }
[ "lucher007@192.168.1.9" ]
lucher007@192.168.1.9
af31344c141c6cf1ae928c240fc7946067104d22
9a38a072fe281f176fda34f7ef46af7c26101cf2
/app/src/main/java/me/kw/mall/adapter/CitySelectAdapter.java
9bc9decfc0d48a64da90edac0b7e288681855c11
[]
no_license
gaoyuan117/Fighting
91a7c1713ed405f9723f31262b5df9976e0cf29a
3eabc5b3723738c425e6591e7caee7a614e33c32
refs/heads/master
2021-01-22T02:17:51.751170
2017-02-09T07:43:42
2017-02-09T07:43:42
81,041,856
0
1
null
null
null
null
UTF-8
Java
false
false
1,767
java
package me.kw.mall.adapter; import android.content.Context; import android.view.View; import android.view.ViewGroup; import android.widget.LinearLayout; import android.widget.TextView; import com.android.zcomponent.adapter.CommonAdapter; import com.xiangying.fighting.R; import java.util.List; import service.api.Area; import service.api.City; import service.api.Province; public class CitySelectAdapter extends CommonAdapter { private int miSelectPosition = -1; public CitySelectAdapter(Context context, List<?> list) { super(context, list); } @Override public View getView(int position, View convertView, ViewGroup parent) { if (null == convertView) { convertView = layoutInflater.inflate(R.layout.adapter_category1, null); } LinearLayout llayoutBg = findViewById(convertView, R.id.llayout_category_bg_show); TextView tvewReviewTitle = findViewById(convertView, R.id.tvew_review_title_show); if (mList.get(position) instanceof Province.Data) { Province.Data province = (Province.Data) mList.get(position); tvewReviewTitle.setText(province.province); } else if (mList.get(position) instanceof City.Data) { City.Data city = (City.Data) mList.get(position); tvewReviewTitle.setText(city.city); } else if (mList.get(position) instanceof Area.Data) { Area.Data area = (Area.Data) mList.get(position); tvewReviewTitle.setText(area.area); } if (miSelectPosition == position) { tvewReviewTitle.setTextColor(getColor(R.color.red)); llayoutBg.setBackgroundColor(getColor(R.color.gray_white)); } else { tvewReviewTitle.setTextColor(getColor(R.color.black)); llayoutBg.setBackgroundColor(getColor(R.color.white)); } return convertView; } }
[ "970725917@qq.com" ]
970725917@qq.com
42dbd10118df60ec8131972ae36d0d628c84fbae
ca9f3fa190fd037a1067d6abef237e7d1994b1eb
/src/com/facebook/buck/apple/IosLibraryDescription.java
4c127577e2632c56a2432e98609d397418d5cf8b
[ "Apache-2.0" ]
permissive
gonzojive/buck
1f2eafbc6852686e5855fa51a4d19105276eb066
49e54bd7fc1fac4d668c31863e103aae7c7f5f9a
refs/heads/master
2020-04-02T01:27:40.467222
2014-02-06T07:15:07
2014-02-15T00:45:10
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,425
java
/* * Copyright 2013-present Facebook, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. You may obtain * a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations * under the License. */ package com.facebook.buck.apple; import com.facebook.buck.rules.BuildRule; import com.facebook.buck.rules.BuildRuleParams; import com.facebook.buck.rules.BuildRuleType; import com.facebook.buck.rules.Buildable; import com.facebook.buck.rules.Description; import com.facebook.buck.rules.SourcePath; import com.facebook.buck.rules.coercer.Either; import com.facebook.buck.rules.coercer.Pair; import com.google.common.base.Optional; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSortedSet; import java.nio.file.Path; public class IosLibraryDescription implements Description<IosLibraryDescription.Arg> { public static final BuildRuleType TYPE = new BuildRuleType("ios_library"); @Override public BuildRuleType getBuildRuleType() { return TYPE; } @Override public Arg createUnpopulatedConstructorArg() { return new Arg(); } @Override public Buildable createBuildable(BuildRuleParams params, Arg args) { return new IosLibrary(args); } public class Arg { /** * @see com.facebook.buck.apple.XcodeRuleConfiguration#fromRawJsonStructure */ public ImmutableMap< String, ImmutableList<Either<Path, ImmutableMap<String, String>>>> configs; public ImmutableList<Either<SourcePath, Pair<SourcePath, String>>> srcs; public ImmutableSortedSet<SourcePath> headers; /** * List of system frameworks, may contain build settings in the path to denote its location. * * Examples: * {@code $SDKROOT/System/Library/Frameworks/UIKit.framework} * {@code $DEVELOPER_DIR/Library/Frameworks/SenTestingKit.framework} */ public ImmutableSortedSet<String> frameworks; public Optional<ImmutableSortedSet<BuildRule>> deps; } }
[ "oconnor663@gmail.com" ]
oconnor663@gmail.com
9568426c36cb7c90d01148a51e45814fc70252c4
5fdc715201aee110ce773179a474729c8066ff29
/SpringDemo4/src/main/java/com/jspiders/SpringDemo4/AppConfig.java
254bf1a477e0523aa225259bc3a0b735ceeae7b3
[]
no_license
bavinashkdp/spring_programs
47dc0a3069a80d2b4b852c6c55cd8ac1aa05dccd
f90f5eca46997251c5d3a96d441c764dd9c1b805
refs/heads/master
2020-04-08T12:36:03.018470
2018-11-27T17:21:30
2018-11-27T17:21:30
159,354,096
0
0
null
null
null
null
UTF-8
Java
false
false
466
java
package com.jspiders.SpringDemo4; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; @Configuration //@ComponentScan(basePackages="com.jspiders.SpringDemo4") public class AppConfig { @Bean public Samsung getSamsung() { return new Samsung(); } @Bean public SnapDragon getSnapDragon() { return new SnapDragon(); } }
[ "user@user-PC" ]
user@user-PC
c0a69b3c3417d9c9918e8dfde9d7bcb4b445c009
8bfee5ea3567ee70eb408d639b83d030a75ccd98
/middle-warehouse/src/main/java/com/pousheng/middle/warehouse/impl/dao/OpenShopWarehouseExtDao.java
842f2fc57fc560afa1a510ce0029597ac97ebca4
[]
no_license
wang-shun/pousheng-middle-ray
5e613d9ace51de59ba941478dbc0222ab3d23088
930152e493314acd551460700fabbe39fce1c7ee
refs/heads/master
2022-04-14T00:11:01.618490
2020-03-31T15:51:34
2020-03-31T15:51:34
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,166
java
package com.pousheng.middle.warehouse.impl.dao; import java.util.Collections; import java.util.List; import java.util.Map; import org.springframework.stereotype.Repository; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Maps; import io.terminus.common.model.Paging; import io.terminus.common.mysql.dao.MyBatisDao; import io.terminus.open.client.common.shop.model.OpenShop; /** * @author jacky.chang * @date 2019/03/29 */ @Repository public class OpenShopWarehouseExtDao extends MyBatisDao<OpenShop>{ public Paging<OpenShop> pagingWithConditions(Integer offset, Integer limit, Map<String, Object> warehouseExtra){ if (warehouseExtra == null) { warehouseExtra = Maps.newHashMap(); } Long total = (Long)sqlSession.selectOne(sqlId("countWithConditions"), warehouseExtra); if (total.longValue() <= 0L) { return new Paging<OpenShop>(Long.valueOf(0L), Collections.emptyList()); } warehouseExtra.put("offset", offset); warehouseExtra.put("limit", limit); List<OpenShop> datas = sqlSession.selectList(sqlId("pagingWithConditions"), warehouseExtra); return new Paging<OpenShop>(total, datas); } }
[ "dreamy.galaxy@gmail.com" ]
dreamy.galaxy@gmail.com
076aea68dc141a7e825fe20dfc1bb518a42ff7a9
39a1e152add64f92c1167084f1e496bec68b8c88
/src/main/java/com/mytests/spring/predestroypostconstruct/standardAnnotationsAndMethodsWithDefaultNames/MyBeanWithExplicitInitDestroy.java
9254fd73f69e0f4dd11a057a7697efb3a689d743
[]
no_license
jb-tester/springboot-predestroy-postconstruct
f52f42f88783acc3becbb7ea56785ef9e4848820
27616c32bf35f49ecc1f2a6d806d88f097573804
refs/heads/master
2023-06-04T16:47:18.386509
2021-06-18T11:43:07
2021-06-18T11:43:07
373,122,396
0
0
null
null
null
null
UTF-8
Java
false
false
486
java
package com.mytests.spring.predestroypostconstruct.standardAnnotationsAndMethodsWithDefaultNames; /** * * * <p>Created by irina on 02.06.2021.</p> * <p>Project: springboot-predestroy-postconstruct</p> * * */ public class MyBeanWithExplicitInitDestroy { public void initThisBean(){ System.out.println("myBeanWithExplicitInitDestroy initialized"); } public void destroyThisBean(){ System.out.println("myBeanWithExplicitInitDestroy destroyed"); } }
[ "irina.petrovskaya@jetbrains.com" ]
irina.petrovskaya@jetbrains.com