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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
e2eb01096e4ee9a194ddf8cda9f1fcfa6f2c8226 | 79890d6ab25e6cb31bad2f9d6c394a1cc46ada0c | /BOS/src/com/gyf/bos/domain/Subarea.java | b1e221d1138eebbfd332079453d44755642850d1 | [] | no_license | PandyYang/SSM-SSH | d748bd5fd9c3eece121091bb16276ac421e316f3 | 74d591007e6a5d13d6b88d29ab9443532f73a21e | refs/heads/master | 2020-04-23T20:06:46.525177 | 2019-04-05T00:08:34 | 2019-04-05T00:08:34 | 171,428,461 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,428 | java | package com.gyf.bos.domain;
// default package
/**
* Subarea entity. @author MyEclipse Persistence Tools
*/
public class Subarea implements java.io.Serializable {
// Fields
private String id;
private DecidedZone decidedZone;
private Region region;
private String addresskey;
private String startnum;
private String endnum;
private String single;
private String position;
public String getSubareaid(){
return id;
}
// Constructors
/** default constructor */
public Subarea() {
}
/** minimal constructor */
public Subarea(String id) {
this.id = id;
}
/** full constructor */
public Subarea(String id, DecidedZone decidedZone, Region region, String addresskey, String startnum, String endnum, String single, String position) {
this.id = id;
this.decidedZone = decidedZone;
this.region = region;
this.addresskey = addresskey;
this.startnum = startnum;
this.endnum = endnum;
this.single = single;
this.position = position;
}
// Property accessors
public String getId() {
return this.id;
}
public void setId(String id) {
this.id = id;
}
public DecidedZone getDecidedZone() {
return this.decidedZone;
}
public void setDecidedZone(DecidedZone decidedZone) {
this.decidedZone = decidedZone;
}
public Region getRegion() {
return this.region;
}
public void setRegion(Region region) {
this.region = region;
}
public String getAddresskey() {
return this.addresskey;
}
public void setAddresskey(String addresskey) {
this.addresskey = addresskey;
}
public String getStartnum() {
return this.startnum;
}
public void setStartnum(String startnum) {
this.startnum = startnum;
}
public String getEndnum() {
return this.endnum;
}
public void setEndnum(String endnum) {
this.endnum = endnum;
}
public String getSingle() {
return this.single;
}
public void setSingle(String single) {
this.single = single;
}
public String getPosition() {
return this.position;
}
public void setPosition(String position) {
this.position = position;
}
} | [
"fry227662112@gmail.com"
] | fry227662112@gmail.com |
8c8521fff1f1385d14dc015a35b0f9c1ee70e822 | ac82c09fd704b2288cef8342bde6d66f200eeb0d | /projects/OG-MasterDB/src/main/java/com/opengamma/masterdb/security/hibernate/index/EquityIndexBeanOperation.java | b0453302a293990b6a8d060b2c7aaba3b25ed5d9 | [
"Apache-2.0"
] | permissive | cobaltblueocean/OG-Platform | 88f1a6a94f76d7f589fb8fbacb3f26502835d7bb | 9b78891139503d8c6aecdeadc4d583b23a0cc0f2 | refs/heads/master | 2021-08-26T00:44:27.315546 | 2018-02-23T20:12:08 | 2018-02-23T20:12:08 | 241,467,299 | 0 | 2 | Apache-2.0 | 2021-08-02T17:20:41 | 2020-02-18T21:05:35 | Java | UTF-8 | Java | false | false | 5,314 | java | /**
* Copyright (C) 2009 - present by OpenGamma Inc. and the OpenGamma group of companies
*
* Please see distribution for license.
*/
package com.opengamma.masterdb.security.hibernate.index;
import static com.opengamma.masterdb.security.hibernate.Converters.externalIdBeanToExternalId;
import static com.opengamma.masterdb.security.hibernate.Converters.externalIdToExternalIdBean;
import static com.opengamma.masterdb.security.hibernate.Converters.indexWeightingTypeBeanToIndexWeightingType;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import com.opengamma.OpenGammaRuntimeException;
import com.opengamma.financial.security.index.EquityIndex;
import com.opengamma.financial.security.index.EquityIndexComponent;
import com.opengamma.financial.security.index.IndexWeightingType;
import com.opengamma.id.ExternalId;
import com.opengamma.id.ExternalIdBundle;
import com.opengamma.masterdb.security.hibernate.AbstractSecurityBeanOperation;
import com.opengamma.masterdb.security.hibernate.ExternalIdBean;
import com.opengamma.masterdb.security.hibernate.HibernateSecurityMasterDao;
import com.opengamma.masterdb.security.hibernate.IndexWeightingTypeBean;
import com.opengamma.masterdb.security.hibernate.OperationContext;
/**
* Hibernate bean/security conversion operations.
*/
public final class EquityIndexBeanOperation extends AbstractSecurityBeanOperation<EquityIndex, EquityIndexBean> {
/**
* Singleton instance.
*/
public static final EquityIndexBeanOperation INSTANCE = new EquityIndexBeanOperation();
private EquityIndexBeanOperation() {
super(EquityIndex.INDEX_TYPE, EquityIndex.class, EquityIndexBean.class);
}
@Override
public EquityIndexBean createBean(final OperationContext context, HibernateSecurityMasterDao secMasterSession, EquityIndex index) {
final EquityIndexBean bean = new EquityIndexBean();
bean.setDescription(index.getDescription());
List<EquityIndexComponent> equityComponents = index.getEquityComponents();
List<EquityIndexComponentBean> equityComponentBeans = new ArrayList<>();
long i = 0;
for (EquityIndexComponent equityComponent : equityComponents) {
EquityIndexComponentBean equityComponentBean = new EquityIndexComponentBean();
equityComponentBean.setWeight(equityComponent.getWeight());
Set<ExternalIdBean> idBundle = new HashSet<>();
for (ExternalId id : equityComponent.getEquityIdentifier().getExternalIds()) {
idBundle.add(externalIdToExternalIdBean(id));
}
equityComponentBean.setIdentifiers(idBundle);
equityComponentBean.setPosition(i);
i++;
equityComponentBeans.add(equityComponentBean);
}
bean.setEquityComponents(equityComponentBeans);
IndexWeightingTypeBean indexWeightingTypeBean = secMasterSession.getOrCreateIndexWeightingTypeBean(index.getWeightingType().name());
bean.setWeightingType(indexWeightingTypeBean);
if (index.getIndexFamilyId() != null) {
bean.setIndexFamilyId(externalIdToExternalIdBean(index.getIndexFamilyId()));
}
return bean;
}
@Override
public EquityIndexBean resolve(final OperationContext context,
final HibernateSecurityMasterDao secMasterSession, final Date now,
final EquityIndexBean bean) {
final List<EquityIndexComponentBean> indexComponents = secMasterSession.getEquityIndexComponentBeans(bean);
bean.setEquityComponents(new ArrayList<EquityIndexComponentBean>(indexComponents));
return bean;
}
@Override
public void postPersistBean(final OperationContext context,
final HibernateSecurityMasterDao secMasterSession, final Date now,
final EquityIndexBean bean) {
secMasterSession.persistEquityIndexComponentBeans(bean);
}
@Override
public EquityIndex createSecurity(final OperationContext context, EquityIndexBean bean) {
String description = bean.getDescription();
IndexWeightingType weightingType = indexWeightingTypeBeanToIndexWeightingType(bean.getWeightingType());
List<EquityIndexComponentBean> equityComponents = bean.getEquityComponents();
if (equityComponents == null) {
throw new OpenGammaRuntimeException("null returned by getEquityComponents, which breaks contract.");
}
List<EquityIndexComponent> components = new ArrayList<>();
for (EquityIndexComponentBean component : equityComponents) {
Set<ExternalIdBean> identifiers = component.getIdentifiers();
List<ExternalId> ids = new ArrayList<>();
for (ExternalIdBean idBean : identifiers) {
ExternalId externalId = externalIdBeanToExternalId(idBean);
ids.add(externalId);
}
ExternalIdBundle externalIdBundle = ExternalIdBundle.of(ids);
BigDecimal weight = component.getWeight().stripTrailingZeros();
EquityIndexComponent equityIndexComponent = new EquityIndexComponent(externalIdBundle, weight);
components.add(equityIndexComponent);
}
EquityIndex equityIndex = new EquityIndex("", description, components, weightingType);
if (bean.getIndexFamilyId() != null) {
equityIndex.setIndexFamilyId(externalIdBeanToExternalId(bean.getIndexFamilyId()));
}
return equityIndex;
}
}
| [
"cobaltblue.ocean@gmail.com"
] | cobaltblue.ocean@gmail.com |
df7926266210b7b8ea5f0bd3463d40f386a0bb53 | 6b23d8ae464de075ad006c204bd7e946971b0570 | /WEB-INF/plugin/reserve/src/jp/groupsession/v2/rsv/rsv020/Rsv020ParamModel.java | 20f9827fc1ad6b1cbba2b00d68e59d604a434f50 | [] | no_license | kosuke8/gsession | a259c71857ed36811bd8eeac19c456aa8f96c61e | edd22517a22d1fb2c9339fc7f2a52e4122fc1992 | refs/heads/master | 2021-08-20T05:43:09.431268 | 2017-11-28T07:10:08 | 2017-11-28T07:10:08 | 112,293,459 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,604 | java | package jp.groupsession.v2.rsv.rsv020;
import java.util.ArrayList;
import jp.groupsession.v2.rsv.GSConstReserve;
import jp.groupsession.v2.rsv.RsvSisetuModel;
import jp.groupsession.v2.rsv.rsv010.Rsv010ParamModel;
/**
* <br>[機 能] 施設予約一覧 日間画面のフォーム
* <br>[解 説]
* <br>[備 考]
*
* @author JTS
*/
public class Rsv020ParamModel extends Rsv010ParamModel {
/** タイムチャートリスト */
private ArrayList<String> rsv020TimeChartList__ = null;
/** 表示開始時間(HH) */
private String rsv020FromHour__ = null;
/** 表示終了時間(HH) */
private String rsv020ToHour__ = null;
/** 予約情報リスト */
private ArrayList<RsvSisetuModel> rsv020DaylyList__ = null;
/** colSpan値(表示する時間From-Toによりspan値が変化) */
private int rsv020ColSpan__ = 0;
/** 取消し対象施設キー */
private String rsv020ClearTargetKey__ = null;
/** 自動リロード時間 */
private int rsv020Reload__ = GSConstReserve.AUTO_RELOAD_10MIN;
/** 時間間隔 区切り数 */
private int rsv020HourDivCount__ = 0;
/**
* <p>rsv020HourDivCount を取得します。
* @return rsv020HourDivCount
*/
public int getRsv020HourDivCount() {
return rsv020HourDivCount__;
}
/**
* <p>rsv020HourDivCount をセットします。
* @param rsv020HourDivCount rsv020HourDivCount
*/
public void setRsv020HourDivCount(int rsv020HourDivCount) {
rsv020HourDivCount__ = rsv020HourDivCount;
}
/**
* <p>rsv020Reload を取得します。
* @return rsv020Reload
*/
public int getRsv020Reload() {
return rsv020Reload__;
}
/**
* <p>rsv020Reload をセットします。
* @param rsv020Reload rsv020Reload
*/
public void setRsv020Reload(int rsv020Reload) {
rsv020Reload__ = rsv020Reload;
}
/**
* <p>rsv020ClearTargetKey__ を取得します。
* @return rsv020ClearTargetKey
*/
public String getRsv020ClearTargetKey() {
return rsv020ClearTargetKey__;
}
/**
* <p>rsv020ClearTargetKey__ をセットします。
* @param rsv020ClearTargetKey rsv020ClearTargetKey__
*/
public void setRsv020ClearTargetKey(String rsv020ClearTargetKey) {
rsv020ClearTargetKey__ = rsv020ClearTargetKey;
}
/**
* <p>rsv020TimeChartList__ を取得します。
* @return rsv020TimeChartList
*/
public ArrayList<String> getRsv020TimeChartList() {
return rsv020TimeChartList__;
}
/**
* <p>rsv020TimeChartList__ をセットします。
* @param rsv020TimeChartList rsv020TimeChartList__
*/
public void setRsv020TimeChartList(ArrayList<String> rsv020TimeChartList) {
rsv020TimeChartList__ = rsv020TimeChartList;
}
/**
* <p>rsv020FromHour__ を取得します。
* @return rsv020FromHour
*/
public String getRsv020FromHour() {
return rsv020FromHour__;
}
/**
* <p>rsv020FromHour__ をセットします。
* @param rsv020FromHour rsv020FromHour__
*/
public void setRsv020FromHour(String rsv020FromHour) {
rsv020FromHour__ = rsv020FromHour;
}
/**
* <p>rsv020ToHour__ を取得します。
* @return rsv020ToHour
*/
public String getRsv020ToHour() {
return rsv020ToHour__;
}
/**
* <p>rsv020ToHour__ をセットします。
* @param rsv020ToHour rsv020ToHour__
*/
public void setRsv020ToHour(String rsv020ToHour) {
rsv020ToHour__ = rsv020ToHour;
}
/**
* <p>rsv020DaylyList__ を取得します。
* @return rsv020DaylyList
*/
public ArrayList<RsvSisetuModel> getRsv020DaylyList() {
return rsv020DaylyList__;
}
/**
* <p>rsv020DaylyList__ をセットします。
* @param rsv020DaylyList rsv020DaylyList__
*/
public void setRsv020DaylyList(ArrayList<RsvSisetuModel> rsv020DaylyList) {
rsv020DaylyList__ = rsv020DaylyList;
}
/**
* <p>rsv020ColSpan__ を取得します。
* @return rsv020ColSpan
*/
public int getRsv020ColSpan() {
return rsv020ColSpan__;
}
/**
* <p>rsv020ColSpan__ をセットします。
* @param rsv020ColSpan rsv020ColSpan__
*/
public void setRsv020ColSpan(int rsv020ColSpan) {
rsv020ColSpan__ = rsv020ColSpan;
}
} | [
"PK140601-29@PK140601-29"
] | PK140601-29@PK140601-29 |
b2c6d39e0452df3531bb547bf0a68277a7689274 | 3ebaee3a565d5e514e5d56b44ebcee249ec1c243 | /assetBank 3.77 decomplied fixed/src/java/com/bright/framework/util/NumberUtil.java | e6a41f1a6e0eb87ccf72777476dad5d095c9f4f4 | [] | no_license | webchannel-dev/Java-Digital-Bank | 89032eec70a1ef61eccbef6f775b683087bccd63 | 65d4de8f2c0ce48cb1d53130e295616772829679 | refs/heads/master | 2021-10-08T19:10:48.971587 | 2017-11-07T09:51:17 | 2017-11-07T09:51:17 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 915 | java | /* */ package com.bright.framework.util;
/* */
/* */ import com.bn2web.common.exception.Bn2Exception;
/* */ import java.util.Random;
/* */
/* */ public class NumberUtil
/* */ {
/* */ public static int getRandomInt(int a_iStart, int a_iEnd)
/* */ throws Bn2Exception
/* */ {
/* 49 */ if (a_iStart > a_iEnd)
/* */ {
/* 51 */ throw new Bn2Exception("NumberUtil.getRandomInt: Start cannot exceed End.");
/* */ }
/* */
/* 55 */ int iDiff = a_iEnd - a_iStart;
/* */
/* 58 */ Random random = new Random();
/* */
/* 61 */ int iFraction = (int)(iDiff * random.nextDouble());
/* 62 */ int iRandom = iFraction + a_iStart;
/* */
/* 64 */ return iRandom;
/* */ }
/* */ }
/* Location: C:\Users\mamatha\Desktop\com.zip
* Qualified Name: com.bright.framework.util.NumberUtil
* JD-Core Version: 0.6.0
*/ | [
"42003122+code7885@users.noreply.github.com"
] | 42003122+code7885@users.noreply.github.com |
6b036966ff4ae25793a7d3a598128ee9ac1238d1 | 5a088135a99a386e473f94f971c571864373865c | /05.HWE/02.Engineering/03.Code/01.server/branches/hwe0.1.6/02.HWE-pay/src/main/java/com/lenovohit/hwe/pay/support/alipay/service/impl/hb/TradeListener.java | 63cbcce7f28366ac52d0f30e2e8f0763ee07303b | [] | no_license | jacky-cyber/work | a7bebd2cc910da1e9e227181def880a78cc1de07 | e58558221b2a8f410b087fa2ce88017cea12efa4 | refs/heads/master | 2022-02-25T09:48:53.940782 | 2018-05-01T10:04:53 | 2018-05-01T10:04:53 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 709 | java | package com.lenovohit.hwe.pay.support.alipay.service.impl.hb;
/**
* Created by liuyangkly on 15/10/27.
*/
public interface TradeListener {
// 支付成功
public void onPayTradeSuccess(String outTradeNo, long beforeCall);
// 支付处理中
public void onPayInProgress(String outTradeNo, long beforeCall);
// 支付失败
public void onPayFailed(String outTradeNo, long beforeCall);
// 建立连接异常
public void onConnectException(String outTradeNo, long beforeCall);
// 报文上送异常
public void onSendException(String outTradeNo, long beforeCall);
// 报文接收异常
public void onReceiveException(String outTradeNo, long beforeCall);
}
| [
"liuximing2016@qq.com"
] | liuximing2016@qq.com |
d90611019478a20e73882600072e2615163d4328 | 052228ac8c5aef2e94770398268180b2f1326cff | /src/REST/esdk_ec_domain/src/main/java/com/huawei/esdk/ec/domain/model/bean/FriendChangeInfo.java | bfa6353a36f7d22dcd1850faf4bba18cbb2aa8b2 | [
"Apache-2.0"
] | permissive | Hr2013/eSDK_EC_SDK_Java | 091ee3828cd0e0f2959a3cfc6fff9d660d7999ff | 99adf0dc17add9cab47ef8e47e677340b84e746f | refs/heads/master | 2020-06-14T15:13:03.844905 | 2016-09-06T01:35:17 | 2016-09-06T01:35:17 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,084 | java | /**
* Copyright 2015 Huawei Technologies Co., Ltd. All rights reserved.
* eSDK is 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.huawei.esdk.ec.domain.model.bean;
public class FriendChangeInfo extends ChangeInfo
{
private FriendInfo friendInfo; // 好友信息
/** * @return the friendInfoBase */
public FriendInfo getFriendInfoBase()
{
return friendInfo;
}
/** * @param friendInfoBase the friendInfoBase to set */
public void setFriendInfoBase(FriendInfo friendInfo)
{
this.friendInfo = friendInfo;
}
}
| [
"13262212358@163.com"
] | 13262212358@163.com |
a05947d6acba48f8d6afbb1d4294937cace0e88f | 957852f2339da953ee98948ab04df2ef937e38d1 | /src ref/classes-dex2jar_source_from_jdcore/com/google/android/gms/internal/zzbgl.java | 48f866acfba0580f1036c757446948e21c8f7a5d | [] | no_license | nvcervantes/apc_softdev_mi151_04 | c58fdc7d9e7450654fcb3ce2da48ee62cda5394f | 1d23bd19466d2528934110878fdc930c00777636 | refs/heads/master | 2020-03-22T03:00:40.022931 | 2019-05-06T04:48:09 | 2019-05-06T04:48:09 | 139,407,767 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 176 | java | package com.google.android.gms.internal;
public abstract class zzbgl
implements zzbgp
{
public zzbgl() {}
public final int describeContents()
{
return 0;
}
}
| [
"shierenecervantes23@gmail.com"
] | shierenecervantes23@gmail.com |
e77f87cb969d45fc8eb40d194f7859ea4869179d | 8209bf1d3cd58e5fcd214bece353c977c53cfdd6 | /src/nl/knokko/rpg/entities/players/Chompo.java | 769e562eda064214573721b91d9779113d8a9f75 | [
"MIT"
] | permissive | knokko/Old-RPG | 18760a4c3374ed526f51566147aca346d60990bf | bb138f942e1d2df58a8d3bfecf707a1bcf35801a | refs/heads/master | 2020-03-28T14:48:29.693693 | 2018-09-12T17:00:09 | 2018-09-12T17:00:09 | 148,524,661 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,911 | java | package nl.knokko.rpg.entities.players;
import java.awt.Point;
import nl.knokko.rpg.entities.model.Model;
import nl.knokko.rpg.main.Game;
import nl.knokko.rpg.spells.Spells;
public class Chompo extends Player {
public Chompo(Game game, Point point) {
super(game, point);
weapon = null;
strength = 50;
currentHealth = maxHealth = 1000;
currentMana = maxMana = 300;
if(!learnedSpells.contains(Spells.powerattack()))
learnedSpells.add(Spells.powerattack());
if(!learnedSpells.contains(Spells.empower()))
learnedSpells.add(Spells.empower());
if(!learnedSpells.contains(Spells.waterslash()))
learnedSpells.add(Spells.waterslash());
}
@Override
public String getName(){
return "Chompo";
}
@Override
public int getPower(){
return 30;
}
@Override
public void loadData(){
super.loadData();
if(!learnedSpells.contains(Spells.powerattack()))
learnedSpells.add(Spells.powerattack());
if(!learnedSpells.contains(Spells.empower()))
learnedSpells.add(Spells.empower());
}
@Override
protected void addBody(){
String n = getTexture().toLowerCase();
models.add(new Model(n + "/leg.png", new Point(14, 24), new Point(3, 1), this));
models.add(new Model(n + "/arm.png", new Point(17, 12), new Point(3, 3), this));
models.add(new Model(n + "/body.png", new Point(13, 10), new Point(6, 8), this));
models.add(new Model(n + "/head.png", new Point(13, 0), new Point(4, 10), this));
models.add(new Model(n + "/arm.png", new Point(17, 12), new Point(3, 3), this));
models.add(new Model(n + "/leg.png", new Point(14, 24), new Point(3, 1), this));
}
public Model leg1(){
return models.get(0);
}
public Model arm1(){
return models.get(1);
}
public Model body(){
return models.get(2);
}
public Model head(){
return models.get(3);
}
public Model arm2(){
return models.get(4);
}
public Model leg2(){
return models.get(5);
}
}
| [
"unconfigured@null.spigotmc.org"
] | unconfigured@null.spigotmc.org |
7eb2a95e53680e97857685cc3dc1f8a9f7ac77ae | a028d7e1c59e1f6320108e5b01ce28ec960af818 | /apple-cloud-config-provider/src/main/java/com/cachexic/cloud/config/sjdbc/DruidDatasourceBase.java | f32f44c0e104bfe53aa16b87216d163eac6695a3 | [] | no_license | tangmin721/apple-cloud | ef9304284d15df80a9189118be943abe5ddfab43 | 3876f8b5129bffb1c531acc67e7d9e689a00c422 | refs/heads/master | 2021-01-23T02:40:30.319373 | 2017-12-01T16:31:30 | 2017-12-01T16:31:30 | 102,441,157 | 4 | 6 | null | null | null | null | UTF-8 | Java | false | false | 3,593 | java | package com.cachexic.cloud.config.sjdbc;
import com.alibaba.druid.pool.DruidDataSource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
import java.sql.SQLException;
/**
* 公共属性配置
*/
@Component
@Configuration
@Order(1)
public class DruidDatasourceBase {
private Logger logger = LoggerFactory.getLogger(getClass());
/**
* 获取数据源
*/
public DruidDataSource getDruidDataSource(String url, String username, String password,
String publickey,
String filters) {
DruidDataSource datasource = new DruidDataSource();
datasource.setUrl(url);
datasource.setUsername(username);
datasource.setPassword(password);
setCommonProperties(datasource, publickey);
try {
datasource.setFilters(filters);
} catch (SQLException e) {
logger.error("druid configuration initialization filter", e);
}
return datasource;
}
/**
* 设置数据公共属性
*/
private void setCommonProperties(DruidDataSource datasource, String publickey) {
datasource.setDriverClassName(driverClassName);
datasource.setInitialSize(initialSize);
datasource.setMinIdle(minIdle);
datasource.setMaxActive(maxActive);
datasource.setMaxWait(maxWait);
datasource.setTimeBetweenEvictionRunsMillis(timeBetweenEvictionRunsMillis);
datasource.setMinEvictableIdleTimeMillis(minEvictableIdleTimeMillis);
datasource.setValidationQuery(validationQuery);
datasource.setTestWhileIdle(testWhileIdle);
datasource.setTestOnBorrow(testOnBorrow);
datasource.setTestOnReturn(testOnReturn);
datasource.setPoolPreparedStatements(poolPreparedStatements);
datasource.setRemoveAbandoned(removeAbandoned);
datasource.setRemoveAbandonedTimeout(removeAbandonedTimeout);
datasource.setLogAbandoned(logAbandoned);
//配置数据库加密,慢查询
datasource.setConnectionProperties("config.decrypt=true;config.decrypt.key=" + publickey
+ ";druid.stat.slowSqlMillis=" + slowSqlMillis
);
}
/**
* 公共属性
*/
@Value("${spring.datasource.driver-class-name}")
private String driverClassName;
@Value("${spring.datasource.initialSize}")
private int initialSize;
@Value("${spring.datasource.minIdle}")
private int minIdle;
@Value("${spring.datasource.maxActive}")
private int maxActive;
@Value("${spring.datasource.maxWait}")
private int maxWait;
@Value("${spring.datasource.timeBetweenEvictionRunsMillis}")
private int timeBetweenEvictionRunsMillis;
@Value("${spring.datasource.minEvictableIdleTimeMillis}")
private int minEvictableIdleTimeMillis;
@Value("${spring.datasource.validationQuery}")
private String validationQuery;
@Value("${spring.datasource.testWhileIdle}")
private boolean testWhileIdle;
@Value("${spring.datasource.testOnBorrow}")
private boolean testOnBorrow;
@Value("${spring.datasource.testOnReturn}")
private boolean testOnReturn;
@Value("${spring.datasource.poolPreparedStatements}")
private boolean poolPreparedStatements;
@Value("${spring.datasource.removeAbandoned}")
private boolean removeAbandoned;
@Value("${spring.datasource.removeAbandonedTimeout}")
private int removeAbandonedTimeout;
@Value("${spring.datasource.logAbandoned}")
private boolean logAbandoned;
@Value("${spring.datasource.slowSqlMillis}")
private String slowSqlMillis;
} | [
"191102902@qq.com"
] | 191102902@qq.com |
554880c62cb9d1f153c809b2a026f180a095d805 | b428e51f0da4313b559571614216516656b985b6 | /Simple Search Engine/task/src/search/Main.java | 757f46617e49f4f65a01a56cd6d23fbc15e7c7b0 | [] | no_license | vall-ball/search | 021a8ca77092bde25fbc6bd54ad7ac50df4e67ab | cac55ed788eb6da6f48b4de60756f15efa4c0587 | refs/heads/master | 2023-01-08T22:51:46.918524 | 2020-11-17T15:21:38 | 2020-11-17T15:21:38 | 306,611,837 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 488 | java | package search;
import java.io.FileNotFoundException;
import java.util.List;
public class Main {
public static void main(String[] args) throws FileNotFoundException {
ArgsParser parser = new ArgsParser(args);
if (parser.fileName() != null) {
FileHandler handler = new FileHandler(parser.fileName());
List<String> listOfPeople = handler.loadPeople();
Menu menu = new Menu(listOfPeople);
menu.menu();
}
}
} | [
"vall-ball@yandex.ru"
] | vall-ball@yandex.ru |
77d381d64f2052862f4ec346035dc6fd21ee65b6 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/1/1_0d15208f650acb41aca41f8744a4e2e32e95f6c7/CreateAccountDialog/1_0d15208f650acb41aca41f8744a4e2e32e95f6c7_CreateAccountDialog_s.java | dcf7bc3d5bfedaa4cea651fca85de653e16b89b2 | [] | 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 | 4,082 | java | package org.martus.android.dialog;
import java.util.Arrays;
import org.martus.android.R;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.support.v4.app.DialogFragment;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.inputmethod.EditorInfo;
import android.widget.EditText;
import android.widget.TextView;
/**
* @author roms
* Date: 12/22/12
*/
public class CreateAccountDialog extends DialogFragment implements DialogInterface.OnClickListener, TextWatcher,
TextView.OnEditorActionListener {
public static final int MIN_PASSWORD_SIZE = 8;
private EditText newPasswordText;
private EditText confirmPasswordText;
private TextView error;
public interface CreateAccountDialogListener {
void onFinishNewAccountDialog(TextView passwordText, TextView confirmPasswordText);
void onCancelNewAccountDialog();
}
public CreateAccountDialog() {
// Empty constructor required for DialogFragment
}
public static CreateAccountDialog newInstance() {
CreateAccountDialog frag = new CreateAccountDialog();
Bundle args = new Bundle();
frag.setArguments(args);
frag.setCancelable(false);
return frag;
}
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
LayoutInflater factory = LayoutInflater.from(getActivity());
final View createAccountDialog = factory.inflate(R.layout.create_account, null);
newPasswordText = (EditText) createAccountDialog.findViewById(R.id.new_password_field);
confirmPasswordText = (EditText) createAccountDialog.findViewById(R.id.confirm_password_field);
confirmPasswordText.setOnEditorActionListener(this);
error = (TextView) createAccountDialog.findViewById(R.id.password_problem_text);
confirmPasswordText.addTextChangedListener(this);
return new AlertDialog.Builder(getActivity())
.setIcon(android.R.drawable.ic_dialog_alert)
.setTitle(R.string.create_account_dialog_title)
.setView(createAccountDialog)
.setPositiveButton(R.string.alert_dialog_ok, this)
.setNegativeButton(R.string.create_account_dialog_cancel,this)
.create();
}
public void onClick(DialogInterface dialog, int whichButton) {
switch (whichButton) {
case -1: ((CreateAccountDialogListener) getActivity()).onFinishNewAccountDialog(newPasswordText, confirmPasswordText);
break;
case -2: ((CreateAccountDialogListener) getActivity()).onCancelNewAccountDialog();
break;
}
}
@Override
public boolean onEditorAction(TextView textView, int actionId, KeyEvent keyEvent) {
if (actionId == EditorInfo.IME_ACTION_DONE) {
((CreateAccountDialogListener) getActivity()).onFinishNewAccountDialog(newPasswordText, confirmPasswordText);
this.dismiss();
return true;
}
return false;
}
public void afterTextChanged(Editable s) {
char[] password = newPasswordText.getText().toString().trim().toCharArray();
char[] confirmPassword = confirmPasswordText.getText().toString().trim().toCharArray();
if (password.length < MIN_PASSWORD_SIZE) {
error.setText(R.string.invalid_password);
return;
}
if (Arrays.equals(password, confirmPassword)) {
error.setText(R.string.settings_pwd_equal);
} else {
error.setText(R.string.settings_pwd_not_equal);
}
}
public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
public void onTextChanged(CharSequence s, int start, int before, int count) {}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
a07058fab98d4240f2d30a7c6a8911d0aea95f47 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/12/12_e80dc360a6b79fa2fed60a0b246a00b014b58c2e/References/12_e80dc360a6b79fa2fed60a0b246a00b014b58c2e_References_s.java | 2e121943317087fc0a355a3a56ffbf36f1b3ec34 | [] | 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 | 258 | java | package net.quetzi.morpheus.references;
public class References {
public static final String MODID = "Morpheus";
public static final String NAME = "Morpheus";
public static final String VERSION = "1.2";
public static final String BUILD = "20";
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
65f78555db73e69d424605b480044395c1697c3f | 7c7f86c62089741ac520f699c5efa33b46376435 | /src/main/java/com/baidu/beidou/message/service/SendMessageMain.java | 4750d4746a721a2e93dd6e00eefa448b17b2edec | [] | no_license | wang-shun/beidou-cron | 35caeceddb0cc64ebe945fa181c099d0c2f5e732 | d46cfa8c5bb838775ae30946d496edae76d0d34e | refs/heads/master | 2020-03-29T14:05:15.550899 | 2017-04-04T04:03:27 | 2017-04-04T04:03:27 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,188 | java | package com.baidu.beidou.message.service;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.context.support.ClassPathXmlApplicationContext;
public class SendMessageMain {
private final static Log log = LogFactory.getLog(SendMessageMain.class);
public static void main(String[] args) {
// String fileName = "E://download/message_for_java";
// String offSetFileName = "E:/download/offset";
String fileName = args[0];
String offSetFileName = args[1];
long starttime = System.currentTimeMillis();
ClassPathXmlApplicationContext ctx = null;
try {
String[] paths = new String[] {
"applicationContext.xml",
"classpath:/com/baidu/beidou/message/applicationContext.xml"};
ctx = new ClassPathXmlApplicationContext(paths);
MessageSend service = (MessageSend)ctx.getBean("messageSendService");
service.send(fileName, offSetFileName);
} catch(Exception e) {
log.error("SendMessageMain send message occur exception", e);
} finally {
log.info("SendMessageMain send message use " + (System.currentTimeMillis() - starttime));
if (ctx != null) {
ctx.destroy();
}
}
}
}
| [
"berryjamcoding@gmail.com"
] | berryjamcoding@gmail.com |
935f4dc1a6c80e65625fdd152c48c59801b54db6 | 9e048428ca10f604c557784f4b28c68ce9b5cccb | /bitcamp-web01/src/main/java/step12/MessageInitializerB.java | 986904d07ea99ded15d3c8f99962f0f1da6d27b1 | [] | no_license | donhee/bitcamp | 6c90ec687e00de07315f647bdb1fda0e277c3937 | 860aa16d86cbd6faeb56b1f5c70b5ea5d297aef0 | refs/heads/master | 2021-01-24T11:44:48.812897 | 2019-02-20T00:06:07 | 2019-02-20T00:06:07 | 123,054,172 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 345 | java | package step12;
import java.util.Map;
import bitcamp.mylib.MessageInitializer;
public class MessageInitializerB implements MessageInitializer {
@Override
public void onStartup(Map<String, String> msgMap) {
System.out.println("===> MessageInitializerB.onStartup() 호출");
msgMap.put("password", "1111");
}
}
| [
"231313do@gmail.com"
] | 231313do@gmail.com |
d364bf6625e31a01ed0d8502a97318070fe1116a | 3b227234b592896108c017364bee22dee1cabf01 | /_src/Chapter08/SpringDITest/src/main/java/packt/jee/eclipse/spring/SpringMain.java | 3dcf66ec08e22c7f1bd1910bd96fa38dd1eda8d8 | [
"Apache-2.0"
] | permissive | paullewallencom/eclipse--978-1-7888-3377-6 | 9a6a534bb40d1aa2a6eb69a84986c6243346fe96 | 30f0bfd7adf580bd9d29da75a5b7da3b339aaa8f | refs/heads/main | 2023-02-08T06:00:51.862266 | 2020-12-26T16:29:20 | 2020-12-26T16:29:20 | 319,149,337 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 607 | java | package packt.jee.eclipse.spring;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
public class SpringMain {
public static void main (String[] args) {
//create ApplicationContext
ApplicationContext ctx = new
ClassPathXmlApplicationContext("context.xml");
//Get bean
CourseService courseService = (CourseService)
ctx.getBean("courseService");
//Get and print CourseDAO. It should not be null
System.out.println("CourseDAO = " +
courseService.getCourseDAO());
}
} | [
"paullewallencom@users.noreply.github.com"
] | paullewallencom@users.noreply.github.com |
6cb198c991af3d6dbdce62054c708ede24329fc6 | 7f298c2bf9ff5a61eeb87e3929e072c9a04c8832 | /spring-context/src/main/java/org/springframework/scheduling/support/DelegatingErrorHandlingRunnable.java | f5075b6b01e5c182d38406af63360059bdebb053 | [
"Apache-2.0"
] | permissive | stwen/my-spring5 | 1ca1e85786ba1b5fdb90a583444a9c030fe429dd | d44be68874b8152d32403fe87c39ae2a8bebac18 | refs/heads/master | 2023-02-17T19:51:32.686701 | 2021-01-15T05:39:14 | 2021-01-15T05:39:14 | 322,756,105 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,012 | java | /*
* Copyright 2002-2012 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.scheduling.support;
import java.lang.reflect.UndeclaredThrowableException;
import org.springframework.util.Assert;
import org.springframework.util.ErrorHandler;
/**
* Runnable wrapper that catches any exception or error thrown from its
* delegate Runnable and allows an {@link ErrorHandler} to handle it.
*
* @author Juergen Hoeller
* @author Mark Fisher
* @since 3.0
*/
public class DelegatingErrorHandlingRunnable implements Runnable {
private final Runnable delegate;
private final ErrorHandler errorHandler;
/**
* Create a new DelegatingErrorHandlingRunnable.
*
* @param delegate the Runnable implementation to delegate to
* @param errorHandler the ErrorHandler for handling any exceptions
*/
public DelegatingErrorHandlingRunnable(Runnable delegate, ErrorHandler errorHandler) {
Assert.notNull(delegate, "Delegate must not be null");
Assert.notNull(errorHandler, "ErrorHandler must not be null");
this.delegate = delegate;
this.errorHandler = errorHandler;
}
@Override
public void run() {
try {
this.delegate.run();
} catch (UndeclaredThrowableException ex) {
this.errorHandler.handleError(ex.getUndeclaredThrowable());
} catch (Throwable ex) {
this.errorHandler.handleError(ex);
}
}
@Override
public String toString() {
return "DelegatingErrorHandlingRunnable for " + this.delegate;
}
}
| [
"xianhao_gan@qq.com"
] | xianhao_gan@qq.com |
af04769a4f4dfad0f97984e304800827f0753cdf | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/16/16_337840695c5d41f64a0a4c23a63b54fa3343c579/MSP430/16_337840695c5d41f64a0a4c23a63b54fa3343c579_MSP430_s.java | e9aa833c92ed63ca34206ebae5c2d6f21040108f | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 6,642 | java | /**
* Copyright (c) 2007, Swedish Institute of Computer Science.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the Institute 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 INSTITUTE 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 INSTITUTE 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.
*
* This file is part of MSPSim.
*
* $Id: MSP430.java,v 1.4 2007/10/21 22:02:22 nfi Exp $
*
* -----------------------------------------------------------------
*
* MSP430
*
* Author : Joakim Eriksson
* Created : Sun Oct 21 22:00:00 2007
* Updated : $Date: 2007/10/21 22:02:22 $
* $Revision: 1.4 $
*/
package se.sics.mspsim.core;
import se.sics.mspsim.util.*;
public class MSP430 extends MSP430Core {
public static final int RETURN = 0x4130;
private int[] execCounter;
private boolean debug = false;
private boolean running = false;
// Debug time - measure cycles
private long lastCycles = 0;
private long lastCpuCycles = 0;
private long time;
private long nextSleep = 0;
private long nextOut = 0;
private double lastCPUPercent = 0d;
private long instCtr = 0;
private DisAsm disAsm;
private MapTable map;
private Profiler profiler;
/**
* Creates a new <code>MSP430</code> instance.
*
*/
public MSP430(int type) {
super(type);
disAsm = new DisAsm();
}
public double getCPUPercent() {
return lastCPUPercent;
}
public DisAsm getDisAsm() {
return disAsm;
}
public void cpuloop() {
if (running) {
throw new IllegalStateException("already running");
}
running = true;
// ??? - power-up reset should be executed?!
time = System.currentTimeMillis();
run();
}
private void run() {
while (running) {
// -------------------------------------------------------------------
// Debug information
// -------------------------------------------------------------------
if (debug) {
if (servicedInterrupt >= 0) {
disAsm.disassemble(reg[PC], memory, reg, servicedInterrupt);
} else {
disAsm.disassemble(reg[PC], memory, reg);
}
}
if (cycles > nextOut && !debug) {
printCPUSpeed(reg[PC]);
nextOut = cycles + 20000007;
}
if (emulateOP()) {
instCtr++;
if (execCounter != null) {
execCounter[reg[PC]]++;
}
if (profiler != null) {
if ((instruction & 0xff80) == CALL) {
/* The profiling should only be made on actual cpuCycles */
String function = map.getFunction(reg[PC]);
if (function == null) {
function = "fkn at $" + Utils.hex16(reg[PC]);
}
profiler.profileCall(function, cpuCycles);
} else if (instruction == RETURN) {
profiler.profileReturn(cpuCycles);
}
}
}
/* Just a test to see if it gets down to a reasonable speed */
if (cycles > nextSleep) {
try {
Thread.sleep(10);
} catch (Exception e) {
}
nextSleep = cycles + 50000;
}
// if ((instruction & 0xff80) == CALL) {
// System.out.println("Call to PC = " + reg[PC]);
// }
}
}
public long step() {
if (running) {
throw new IllegalStateException("step not possible when CPU is running");
}
// -------------------------------------------------------------------
// Debug information
// -------------------------------------------------------------------
if (debug) {
if (servicedInterrupt >= 0) {
disAsm.disassemble(reg[PC], memory, reg, servicedInterrupt);
} else {
disAsm.disassemble(reg[PC], memory, reg);
}
}
instCtr++;
if ((instCtr % 10000007) == 0 && !debug) {
printCPUSpeed(reg[PC]);
}
if (execCounter != null) {
execCounter[reg[PC]]++;
}
emulateOP();
return cycles;
}
public void stop() {
running = false;
}
public int getExecCount(int address) {
if (execCounter != null) {
return execCounter[address];
}
return 0;
}
public void setMonitorExec(boolean mon) {
if (mon) {
if (execCounter == null) {
execCounter = new int[MAX_MEM];
}
} else {
execCounter = null;
}
}
private void printCPUSpeed(int pc) {
int td = (int)(System.currentTimeMillis() - time);
int cd = (int) (cycles - lastCycles);
int cpud = (int) (cpuCycles - lastCpuCycles);
if (td == 0 || cd == 0) return;
if (DEBUGGING_LEVEL > 0) {
System.out.println("Elapsed: " + td
+ " cycDiff: " + cd + " => " + 1000 * (cd / td )
+ " cyc/s cpuDiff:" + cpud + " => "
+ 1000 * (cpud / td ) + " cyc/s "
+ (10000 * cpud / cd)/100.0 + "%");
}
lastCPUPercent = (10000 * cpud / cd)/100.0;
time = System.currentTimeMillis();
lastCycles = cycles;
lastCpuCycles = cpuCycles;
disAsm.disassemble(pc, memory, reg);
}
public boolean getDebug() {
return debug;
}
public void setDebug(boolean db) {
debug = db;
}
public Profiler getProfiler() {
return profiler;
}
public void setMap(MapTable map) {
this.map = map;
/* When we got the map table we can also profile! */
if (profiler == null) {
this.profiler = new SimpleProfiler();
}
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
8adddb7a07c13d65cebd13c342fd9c82f0edcff8 | 4f4f84152b04246be5c323d20083ea3d00319ffc | /app/neuralnet/neural/som/training/clustercopy/SOMClusterCopyTraining.java | b320bbd8fa30faebfcb241064225f63a636cb354 | [
"Apache-2.0"
] | permissive | GeorgeIwu/breast-cancer-prognosis | 0d2f1d63b02c23e9afec1176d4bfe6e3e4feab58 | 98ef64dbe049bc2866386a8f8eebdff473ef9f9c | refs/heads/master | 2021-08-11T05:01:49.585167 | 2017-11-13T06:16:30 | 2017-11-13T06:16:30 | 110,506,755 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,783 | java | /*
* Encog(tm) Core v3.3 - Java Version
* http://www.heatonresearch.com/encog/
* https://github.com/encog/encog-java-core
* Copyright 2008-2014 Heaton Research, 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.
*
* For more information on Heaton Research copyrights, licenses
* and trademarks visit:
* http://www.heatonresearch.com/copyright
*/
package neuralnet.neural.som.training.clustercopy;
import neuralnet.ml.MLMethod;
import neuralnet.ml.TrainingImplementationType;
import neuralnet.ml.data.MLData;
import neuralnet.ml.data.MLDataPair;
import neuralnet.ml.data.MLDataSet;
import neuralnet.ml.train.BasicTraining;
import neuralnet.neural.NeuralNetworkError;
import neuralnet.neural.networks.training.propagation.TrainingContinuation;
import neuralnet.neural.som.SOM;
/**
* SOM cluster copy is a very simple trainer for SOM's. Using this trainer all of
* the training data is copied to the SOM weights. This can provide a functional
* SOM, or can be used as a starting point for training.
*
* For now, this trainer will only work if you have equal or fewer training elements
* to the number of output neurons. Eventually I hope to expand this by using
* KMeans clustering.
*
*/
public class SOMClusterCopyTraining extends BasicTraining {
/**
* The SOM to train.
*/
private final SOM network;
/**
* Is training done.
*/
private boolean done;
/**
* Construct the object.
* @param network The network to train.
* @param training The training data.
*/
public SOMClusterCopyTraining(final SOM network, final MLDataSet training) {
super(TrainingImplementationType.OnePass);
this.network = network;
if (this.network.getOutputCount() < training.getRecordCount()) {
throw new NeuralNetworkError(
"To use cluster copy training you must have at least as many output neurons as training elements.");
}
setTraining(training);
}
/**
* {@inheritDoc}
*/
@Override
public final boolean canContinue() {
return false;
}
/**
* @return True if training can progress no further.
*/
public boolean isTrainingDone() {
if (super.isTrainingDone())
return true;
else
return done;
}
/**
* Copy the specified input pattern to the weight matrix. This causes an
* output neuron to learn this pattern "exactly". This is useful when a
* winner is to be forced.
*
* @param outputNeuron
* The output neuron to set.
* @param input
* The input pattern to copy.
*/
private void copyInputPattern(final int outputNeuron, final MLData input) {
for (int inputNeuron = 0; inputNeuron < this.network.getInputCount(); inputNeuron++) {
this.network.getWeights().set(outputNeuron, inputNeuron,
input.getData(inputNeuron));
}
}
/**
* {@inheritDoc}
*/
@Override
public final MLMethod getMethod() {
return this.network;
}
/**
* {@inheritDoc}
*/
@Override
public void iteration() {
int outputNeuron = 0;
for (final MLDataPair pair : getTraining()) {
copyInputPattern(outputNeuron++, pair.getInput());
}
this.done = true;
}
/**
* {@inheritDoc}
*/
@Override
public TrainingContinuation pause() {
return null;
}
/**
* {@inheritDoc}
*/
@Override
public void resume(final TrainingContinuation state) {
}
}
| [
"c.georgeiwu@gmail.com"
] | c.georgeiwu@gmail.com |
d9ed21c12fea2b20cefd1c8688bfb778b3c2cbc7 | 6303e3e7b90d5799654d1450c24984cae9f43eb1 | /cc.recommenders.evaluation/src/main/java/cc/recommenders/evaluation/optimization/EvaluationOptions.java | 9f7f088995403d588276c0246fedd85b8175c5e6 | [] | no_license | stg-tud/artifacts-proksch-pbn | de1a16158a4cc72db84e69eb5a9c27283f411c22 | ef89b019e9ed703d6f93ef332b89c50b64303591 | refs/heads/master | 2021-01-13T01:35:52.797770 | 2017-06-12T17:50:47 | 2017-06-12T17:50:47 | 28,149,154 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,096 | java | package cc.recommenders.evaluation.optimization;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import cc.recommenders.mining.calls.MiningOptions;
import cc.recommenders.mining.calls.QueryOptions;
public class EvaluationOptions {
public MiningOptions miningOptions;
public QueryOptions queryOptions;
public EvaluationOptions(MiningOptions miningOptions, QueryOptions queryOptions) {
this.miningOptions = miningOptions;
this.queryOptions = queryOptions;
}
@Override
public int hashCode() {
return HashCodeBuilder.reflectionHashCode(this);
}
@Override
public boolean equals(Object other) {
return EqualsBuilder.reflectionEquals(this, other);
}
@Override
public String toString() {
return String.format("%s%s", miningOptions, queryOptions);
}
public static EvaluationOptions copy(EvaluationOptions other) {
MiningOptions mOpts = new MiningOptions().setFrom(other.miningOptions);
QueryOptions qOpts = new QueryOptions().setFrom(other.queryOptions);
return new EvaluationOptions(mOpts, qOpts);
}
} | [
"proksch@st.informatik.tu-darmstadt.de"
] | proksch@st.informatik.tu-darmstadt.de |
96aa6bbfbdb9e17482cfa0630d90760d16d290b3 | dd66f580d332e4fbfc69f9c828c5dab7ddaa8d63 | /substance/src/main/java/org/pushingpixels/substance/api/combo/WidestComboPopupPrototype.java | 8a3e3db44115796ace42a25ac8c41ab45bcda1ca | [
"BSD-3-Clause"
] | permissive | spslinger/radiance | 44f06d939afc3e27c0d4997b2fd89a27aff39fdf | 7cf51ee22014df1368c04f5f9f6ecbea93695231 | refs/heads/master | 2020-03-31T18:00:48.170702 | 2018-10-11T12:49:29 | 2018-10-11T12:49:29 | 152,442,895 | 0 | 0 | BSD-3-Clause | 2018-10-11T12:49:31 | 2018-10-10T15:04:46 | Java | UTF-8 | Java | false | false | 2,695 | java | /*
* Copyright (c) 2005-2018 Substance Kirill Grouchnikov. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* o Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* o 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.
*
* o Neither the name of Substance Kirill Grouchnikov nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package org.pushingpixels.substance.api.combo;
import org.pushingpixels.substance.internal.ui.SubstanceComboBoxUI;
import javax.swing.*;
import java.awt.*;
/**
* Sample core implementation of {@link ComboPopupPrototypeCallback} interface
* that returns the widest combo entry. This class is part of officially
* supported API.
*
* @author Kirill Grouchnikov
*/
public class WidestComboPopupPrototype implements ComboPopupPrototypeCallback {
@Override
public Object getPopupPrototypeDisplayValue(JComboBox jc) {
int maxWidth = -1;
Object prototype = null;
JList list = ((SubstanceComboBoxUI) jc.getUI()).getPopup().getList();
for (int i = 0; i < jc.getModel().getSize(); i++) {
Object elem = jc.getModel().getElementAt(i);
Component renderer = jc.getRenderer().getListCellRendererComponent(
list, elem, i, false, false);
if (renderer != null) {
int rWidth = renderer.getPreferredSize().width;
if (rWidth > maxWidth) {
maxWidth = rWidth;
prototype = elem;
}
}
}
return prototype;
}
}
| [
"kirill.grouchnikov@gmail.com"
] | kirill.grouchnikov@gmail.com |
9b1d89c5221d6e2940f91162196e42449de8a5f1 | 17be167566130b3a48f6832a7ae6446dd5d5085b | /src/main/java/com/example/blog/controller/admin/PhotoCategoryController.java | 5125355733425fe475c65b521621e5e47c4d42f7 | [] | no_license | Vowkin/SSMBlogPlus | 77359e4d52667d723f7266dfec9272dfa5707e91 | f79e69373e9b73a249b9debc5ce02c436bac1008 | refs/heads/master | 2023-04-30T20:02:09.015754 | 2021-05-09T10:12:58 | 2021-05-09T10:12:58 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,709 | java | package com.example.blog.controller.admin;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.blog.controller.common.BaseController;
import com.example.blog.dto.JsonResult;
import com.example.blog.dto.QueryCondition;
import com.example.blog.entity.PhotoCategory;
import com.example.blog.enums.ResultCodeEnum;
import com.example.blog.service.PhotoCategoryService;
import com.example.blog.service.PhotoService;
import com.example.blog.util.PageUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Objects;
/**
* 相册管理控制器
*
* @author liuyanzhao
*/
@Slf4j
@Controller
@RequestMapping(value = "/admin/photoCategory")
public class PhotoCategoryController extends BaseController {
@Autowired
private PhotoCategoryService categoryService;
@Autowired
private PhotoService photoService;
/**
* 查询所有相册并渲染category页面
*
* @return 模板路径admin/admin_category
*/
@RequestMapping(method = RequestMethod.GET)
public String categories(@RequestParam(value = "page", defaultValue = "0") Integer pageNumber,
@RequestParam(value = "size", defaultValue = "24") Integer pageSize,
@RequestParam(value = "sort", defaultValue = "cateSort") String sort,
@RequestParam(value = "order", defaultValue = "desc") String order, Model model) {
Page page = PageUtil.initMpPage(pageNumber, pageSize, sort, order);
QueryCondition queryCondition = new QueryCondition();
PhotoCategory condition = new PhotoCategory();
condition.setUserId(getLoginUserId());
queryCondition.setData(condition);
Page<PhotoCategory> categoryPage = categoryService.findAll(page, queryCondition);
model.addAttribute("categories", categoryPage.getRecords());
model.addAttribute("pageInfo", PageUtil.convertPageVo(page));
return "admin/admin_photo_category";
}
/**
* 新增/修改相册目录
*
* @param category category对象
* @return JsonResult
*/
@RequestMapping(value = "/save", method = RequestMethod.POST)
@ResponseBody
public JsonResult saveCategory(@ModelAttribute PhotoCategory category) {
category.setUserId(getLoginUserId());
categoryService.insertOrUpdate(category);
return JsonResult.success("保存成功");
}
/**
* 删除相册
*
* @param cateId 相册Id
* @return JsonResult
*/
@RequestMapping(value = "/delete", method = RequestMethod.DELETE)
@ResponseBody
public JsonResult delete(@RequestParam("id") Long cateId) {
//1.判断这个相册有照片
Integer count = photoService.countByCategoryId(cateId);
if (count != 0) {
return JsonResult.error("该相册已经有了图片,无法删除");
}
categoryService.delete(cateId);
return JsonResult.success("删除成功");
}
/**
* 批量删除
*
* @param ids 回复ID列表
* @return
*/
@RequestMapping(value = "/batchDelete", method = RequestMethod.POST)
@ResponseBody
public JsonResult batchDelete(@RequestParam("ids") List<Long> ids) {
Long userId = getLoginUserId();
//批量操作
//1、防止恶意操作
if (ids == null || ids.size() == 0 || ids.size() >= 100) {
return new JsonResult(ResultCodeEnum.FAIL.getCode(), "参数不合法!");
}
//2、检查用户权限
List<PhotoCategory> photoCategoryList = categoryService.findByBatchIds(ids);
for (PhotoCategory category : photoCategoryList) {
if (!Objects.equals(category.getUserId(), userId)) {
return new JsonResult(ResultCodeEnum.FAIL.getCode(), "没有权限删除!");
}
}
//3、删除
categoryService.batchDelete(ids);
return JsonResult.success("删除成功");
}
/**
* 详情
*
* @param cateId 相册Id
* @return JsonResult
*/
@RequestMapping(value = "/detail", method = RequestMethod.GET)
@ResponseBody
public JsonResult detail(@RequestParam("id") Long cateId) {
PhotoCategory photoCategory = categoryService.get(cateId);
if (photoCategory == null) {
return JsonResult.error("相册不存在");
}
return JsonResult.success("查询成功", photoCategory);
}
}
| [
"847064370@qq.com"
] | 847064370@qq.com |
f64f0da2f7d1ede76b2dd7f195a8bde9eab8f2ac | 06d632eae57e4404f763d1d903dc08417d9394f6 | /src/fr/k2i/adbeback/service/FindGameService.java | 860f5c1ff212d530af7960353833132004fba876 | [] | no_license | icudroid/AdBeBack-Mobile | adc5d6c261c027ca70581878fc220bf445f9554f | 0e840ae146ba55025a6f51a2948d9f56f1350218 | refs/heads/master | 2021-01-12T08:56:00.700385 | 2016-12-17T12:39:19 | 2016-12-17T12:39:19 | 76,724,200 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,554 | java | package fr.k2i.adbeback.service;
import java.io.IOException;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Timer;
import java.util.TimerTask;
import org.apache.http.client.ClientProtocolException;
import org.json.JSONException;
import org.json.JSONObject;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.app.Service;
import android.content.Intent;
import android.os.Bundle;
import android.os.IBinder;
import fr.k2i.adbeback.R;
import fr.k2i.adbeback.activity.EmptyActivity;
import fr.k2i.adbeback.business.blindtest.BlindTestBean;
import fr.k2i.adbeback.connexion.ServerConnexion;
import fr.k2i.adbeback.exception.LoginException;
public class FindGameService extends Service implements IBackgroundService{
private Timer timer ;
private BackgroundServiceBinder binder ;
private List<IBackgroundServiceListener> listeners = null;
private Long idChanel;
@Override
public void onCreate() {
timer = new Timer();
binder = new BackgroundServiceBinder(this);
_onStart();
}
@Override
public IBinder onBind(Intent intent) {
Bundle objetbunble =intent.getExtras();
idChanel = objetbunble .getLong("chanelId");
return binder;
}
public void _onStart(){
timer.scheduleAtFixedRate(new TimerTask() {
public void run() {
BlindTestBean res = getNextBlindTest();
if(listeners != null && res !=null){
showNotification();
fireDataChanged(res);
FindGameService.this.stopSelf();
this.cancel();
}
}}, 0, 10000);
}
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
Bundle objetbunble =intent.getExtras();
idChanel = objetbunble .getLong("chanelId");
_onStart();
return START_NOT_STICKY;
}
// Ajout d'un listener
public void addListener(IBackgroundServiceListener listener) {
if(listeners == null){
listeners = new ArrayList<IBackgroundServiceListener>();
}
listeners.add(listener);
}
// Suppression d'un listener
public void removeListener(IBackgroundServiceListener listener) {
if(listeners != null){
listeners.remove(listener);
}
}
// Notification des listeners
private void fireDataChanged(Object data){
if(listeners != null){
for(IBackgroundServiceListener listener: listeners){
listener.dataChanged(data);
}
}
}
@Override
public void onDestroy() {
this.listeners.clear();
this.timer.cancel();
}
private BlindTestBean getNextBlindTest(){
Map<String, String>params = new HashMap<String, String>();
params.put("idChanel", idChanel.toString());
BlindTestBean res = null;
try {
JSONObject obj = ServerConnexion.sendRequest("Android/TVJackPot/inscriptionUser", params);
if(obj != null){
res = new BlindTestBean(obj);
}
} catch (ClientProtocolException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (URISyntaxException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (JSONException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (LoginException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return res;
}
private void showNotification() {
NotificationManager mNM =(NotificationManager)getSystemService(NOTIFICATION_SERVICE);
// In this sample, we'll use the same text for the ticker and the expanded notification
CharSequence text = getText(R.string.local_service_started);
// Set the icon, scrolling text and timestamp
Notification notification = new Notification(R.drawable.logo, text,System.currentTimeMillis());
// The PendingIntent to launch our activity if the user selects this notification
Intent intent = new Intent(getApplicationContext(), EmptyActivity.class);
// Long idChanel = getIntent().getExtras().getLong("chanelId");
// intent.putExtra("chanelId", idChanel);
// intent.putExtra("direct", true);
PendingIntent contentIntent = PendingIntent.getActivity(FindGameService.this, 0,intent, 0);
// Set the info for the views that show in the notification panel.
notification.setLatestEventInfo(this, getText(R.string.local_service_label),text, contentIntent);
notification.defaults |= Notification.DEFAULT_LIGHTS;
notification.ledOnMS = 600;
notification.ledOffMS = 1000;
notification.flags |= Notification.FLAG_SHOW_LIGHTS;
notification.defaults |= Notification.DEFAULT_VIBRATE;
long[] vibrate = {0,100,200,300};
notification.vibrate = vibrate;
notification.defaults |= Notification.DEFAULT_SOUND;
// Send the notification.
// We use a layout id because it is a unique number. We use it later to cancel.
mNM.notify(R.string.local_service_started, notification);
}
}
| [
"dimitri@d-kahn.net"
] | dimitri@d-kahn.net |
4ee87bedbc6a72433e7368b9a4d527eca49236d5 | 13ea5da0b7b8d4ba87d622a5f733dcf6b4c5f1e3 | /crash-reproduction-new-fitness/results/LANG-27b-1-22-Single_Objective_GGA-IntegrationSingleObjective-BasicBlockCoverage-opt/org/apache/commons/lang3/math/NumberUtils_ESTest.java | 967519408ac25379dd95900bd4874b76cd216269 | [
"MIT",
"CC-BY-4.0"
] | permissive | STAMP-project/Botsing-basic-block-coverage-application | 6c1095c6be945adc0be2b63bbec44f0014972793 | 80ea9e7a740bf4b1f9d2d06fe3dcc72323b848da | refs/heads/master | 2022-07-28T23:05:55.253779 | 2022-04-20T13:54:11 | 2022-04-20T13:54:11 | 285,771,370 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 849 | java | /*
* This file was automatically generated by EvoSuite
* Fri Oct 29 04:20:21 UTC 2021
*/
package org.apache.commons.lang3.math;
import org.junit.Test;
import static org.junit.Assert.*;
import static org.evosuite.runtime.EvoAssertions.*;
import org.apache.commons.lang3.math.NumberUtils;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.junit.runner.RunWith;
@RunWith(EvoRunner.class) @EvoRunnerParameters(useVFS = true, useJEE = true)
public class NumberUtils_ESTest extends NumberUtils_ESTest_scaffolding {
@Test(timeout = 4000)
public void test0() throws Throwable {
byte[] byteArray0 = new byte[6];
String string0 = "The Array must not be null";
String string1 = "`@RS(R;tEe|d";
// Undeclared exception!
NumberUtils.createNumber("`@RS(R;tEe|d");
}
}
| [
"pderakhshanfar@serg2.ewi.tudelft.nl"
] | pderakhshanfar@serg2.ewi.tudelft.nl |
d89529583e2e4f07e7fc7084bb3b0ab1e851c801 | ce4a660d8a7ba0ab6bc58a64c3486417e7cd611a | /serenity-junit/src/main/java/net/thucydides/junit/listeners/TestCountListener.java | dd180a431ad4acdf2a0aaa383b2e7a14b071913b | [
"Apache-2.0",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | jakimcho/serenity-core | abfe7fab196974025b3e2dd81d852b1271504bfa | 641aa64ef305089fa9e470ce593f24c322cd3211 | refs/heads/master | 2022-12-07T22:16:47.931277 | 2020-08-19T16:20:41 | 2020-08-19T16:20:41 | 262,763,334 | 0 | 0 | NOASSERTION | 2020-08-20T20:52:45 | 2020-05-10T10:34:55 | null | UTF-8 | Java | false | false | 3,483 | java | package net.thucydides.junit.listeners;
import net.serenitybdd.core.Serenity;
import net.thucydides.core.ThucydidesSystemProperty;
import net.thucydides.core.logging.LoggingLevel;
import net.thucydides.core.model.DataTable;
import net.thucydides.core.model.Story;
import net.thucydides.core.model.TestOutcome;
import net.thucydides.core.statistics.TestCount;
import net.thucydides.core.steps.ExecutedStepDescription;
import net.thucydides.core.steps.StepFailure;
import net.thucydides.core.steps.StepListener;
import net.thucydides.core.util.EnvironmentVariables;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Map;
import static net.thucydides.core.ThucydidesSystemProperty.SERENITY_DISPLAY_TEST_NUMBERS;
import static net.thucydides.core.ThucydidesSystemProperty.SERENITY_LOGGING;
public class TestCountListener implements StepListener {
private final Logger logger;
private final EnvironmentVariables environmentVariables;
private final TestCount testCount;
private final boolean reportTestCount;
protected TestCountListener(EnvironmentVariables environmentVariables, Logger logger, TestCount testCount) {
this.logger = logger;
this.environmentVariables = environmentVariables;
this.testCount = testCount;
this.reportTestCount = SERENITY_DISPLAY_TEST_NUMBERS.booleanFrom(environmentVariables,false);
}
public TestCountListener(EnvironmentVariables environmentVariables, TestCount testCount) {
this(environmentVariables, LoggerFactory.getLogger(""), testCount);
}
protected Logger getLogger() {
return logger;
}
public void testSuiteStarted(Class<?> storyClass) {
}
public void testSuiteStarted(Story storyOrFeature) {
}
public void testSuiteFinished() {
}
public void testStarted(String description) {
int currentTestCount = testCount.getNextTest();
if (reportTestCount && LoggingLevel.definedIn(environmentVariables).isAtLeast(LoggingLevel.VERBOSE)) {
getLogger().info("TEST NUMBER: {}", currentTestCount);
}
}
@Override
public void testStarted(String description, String id) {
testStarted(description);
}
public void testFinished(TestOutcome result) {
}
public void testRetried() {
}
public void stepStarted(ExecutedStepDescription description) {
}
public void skippedStepStarted(ExecutedStepDescription description) {
}
public void stepFailed(StepFailure failure) {
}
public void lastStepFailed(StepFailure failure) {
}
public void stepIgnored() {
}
public void stepPending() {
}
public void stepPending(String message) {
}
public void stepFinished() {
}
public void testFailed(TestOutcome testOutcome, Throwable cause) {
}
public void testIgnored() {
}
@Override
public void testSkipped() {
}
@Override
public void testPending() {
}
@Override
public void testIsManual() {
}
public void notifyScreenChange() {
}
public void useExamplesFrom(DataTable table) {
}
@Override
public void addNewExamplesFrom(DataTable table) {
}
public void exampleStarted(Map<String, String> data) {
}
public void exampleFinished() {
}
@Override
public void assumptionViolated(String message) {
}
@Override
public void testRunFinished() {
}
}
| [
"john.smart@wakaleo.com"
] | john.smart@wakaleo.com |
7e4878fced75aadcd0caf020949b4813dbafae99 | ae6eb4f13009181eb1a701761a07b4532bf6770f | /DOCRecord/A_SSMDEMO_Test_html/src/com/ssm/webrest/ErrorCode.java | 52a6ef98303ecce64cab4f187647ce7e7ecb59a0 | [] | no_license | chrgu000/DOCRecord | ae5ef8a65442cdc7486a08695d08b6114d13d0aa | 33f23bf7226e24ada3b4fe2c00da5fdc66617336 | refs/heads/master | 2020-05-24T15:34:57.089413 | 2018-11-16T06:44:34 | 2018-11-16T06:44:34 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,071 | java | package com.ssm.webrest;
/**
* 错误代码错误定义表
* @author zkl
* @date 2014-7-17 下午3:47:07
* @version 1.0
*/
public class ErrorCode {
/**
* 输入输出异常!
*/
public final static long ISCHOOL_REQJSON_IO_EXCEPTION = -10001;
/**
* 输入输出异常!
*/
public final static long ISCHOOL_REQJSON_CHARACTERCODING_EXCEPTION = -10002;
/**
* 输入输出异常,协议体结构错误!
*/
public final static long ISCHOOL_REQJSON_PARSEMSG_EXCEPTION = -10003;
/**
* 输入输出异常!
*/
public final static long ISCHOOL_REQJSON_C2SBASEMSG_ISNULL = -10004;
/**
* 参数错误,不合理的请求协议类型!
*/
public final static long ISCHOOL_REQBODY_INVALID_MSGTYPE = -10005;
/**
* 自定义服务相关异常!
*/
public final static long ISCHOOL_SERVICE_EXCEPTION = -10006;
/**
* 未查询出内容!
*/
public final static long ISCHOOL_SEARCH_ISNULL_EXCEPTION = -10007;
/**
* 角色名称不能为空
*/
public final static long ISCHOOL_ECEPTIONCODE_ROLENAME_ISNULL = 3008;
}
| [
"982338665@qq.com"
] | 982338665@qq.com |
e437382b012b0c143d3cfaa6f53ed914a22878ad | 1328928854e6d003ba9422d4bebdb184717defe6 | /integration-tests/src/main/java/de/captaingoldfish/scim/sdk/client/tests/projectsetup/X509SecurityConfig.java | fafdb1b6f62688d751a5adc866ed76d5b76cf1b9 | [] | permissive | csbrogi/SCIM-SDK | b741360dbc3eb4be97add6e39959aa7c198d1274 | 81ebef997e5583a06e8ccd73f4425fa39f58feae | refs/heads/master | 2023-03-17T11:33:11.885944 | 2022-06-15T08:49:59 | 2022-06-15T08:49:59 | 242,993,953 | 0 | 0 | BSD-3-Clause | 2023-03-02T15:06:23 | 2020-02-25T12:26:04 | Java | UTF-8 | Java | false | false | 2,725 | java | package de.captaingoldfish.scim.sdk.client.tests.projectsetup;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
import org.springframework.core.annotation.Order;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.core.authority.AuthorityUtils;
import org.springframework.security.core.userdetails.User;
import org.springframework.security.core.userdetails.UserDetailsService;
import de.captaingoldfish.scim.sdk.client.tests.constants.Profiles;
import de.captaingoldfish.scim.sdk.client.tests.constants.TestConstants;
/**
* author Pascal Knueppel <br>
* created at: 11.12.2019 - 12:53 <br>
* <br>
* spring security configuration for this test that will enable mutual client authentication to test the http
* tls client authentication
*/
@Profile(Profiles.X509_PROFILE)
@Order(X509SecurityConfig.RANDOM_ORDER_NUMBER)
@Configuration
@EnableWebSecurity
public class X509SecurityConfig extends WebSecurityConfigurerAdapter
{
/**
* a order number that is given to this configuration that should not have any conflicts with other
* spring-security configurations
*/
public static final int RANDOM_ORDER_NUMBER = 499;
/**
* configure the endpoints that require mutual client authentication and add the regular expression to match
* the username within the certificates distinguished name
*/
@Override
protected void configure(HttpSecurity http) throws Exception
{
http.csrf()
.disable()
.antMatcher("/**")
.authorizeRequests()
.anyRequest()
.authenticated()
.and()
.x509()
.subjectPrincipalRegex("CN=(.*)"); // the regular expression to parse the username from the DN
}
/**
* will do the authentication if a request comes in. The CN of the certificate must match "test" to
* successfully authenticate
*/
@Bean
public UserDetailsService userDetailsService()
{
return username -> {
if (TestConstants.AUTHORIZED_USERNAME.equals(username))
{
return new User(username, "", AuthorityUtils.commaSeparatedStringToAuthorityList(TestConstants.ADMIN_ROLE));
}
else if (TestConstants.UNAUTHORIZED_USERNAME.equals(username))
{
return new User(username, "", AuthorityUtils.createAuthorityList(TestConstants.USER_ROLE));
}
else
{
return null;
}
};
}
}
| [
"captain.p.goldfish@gmx.de"
] | captain.p.goldfish@gmx.de |
3f4221347e02586a1dc26203e8df92260f60d02b | 894927bf0fc36549955be6fb781974c12bb449eb | /etudes-util/etudes-util-api/api/src/java/org/etudes/util/api/AccessAdvisor.java | 7e4d0451b28173eb780c43953458a57524100524 | [
"LicenseRef-scancode-generic-cla",
"ECL-2.0",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | sadupally/Dev | cd32fa3b753e8d20dd80e794618a8e97d1ff1c79 | ead9de3993b7a805199ac254c6fa99d3dda48adf | refs/heads/master | 2020-03-24T08:15:12.732481 | 2018-07-27T12:54:29 | 2018-07-27T12:54:29 | 142,589,852 | 0 | 0 | ECL-2.0 | 2018-07-27T14:49:51 | 2018-07-27T14:49:50 | null | UTF-8 | Java | false | false | 2,678 | java | /**********************************************************************************
* $URL: https://source.sakaiproject.org/contrib/etudes/etudes-util/tags/1.0.17/etudes-util-api/api/src/java/org/etudes/util/api/AccessAdvisor.java $
* $Id: AccessAdvisor.java 75291 2011-07-04 18:20:53Z ggolden@etudes.org $
***********************************************************************************
*
* Copyright (c) 2010 Etudes, 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 org.etudes.util.api;
/**
* Provide additional access advice (based on some other set of information).
*/
public interface AccessAdvisor
{
/**
* See if the user should be denied access to the item
*
* @param toolId
* The tool id for the application (such as "sakai.mneme").
* @param context
* The context in which the object lives.
* @param id
* The object's id.
* @param userId
* The user id.
* @return TRUE if the advisor denies access, FALSE if not.
*/
Boolean denyAccess(String toolId, String context, String id, String userId);
/**
* If the user should be denied access to the item, provide a message describing why (item title).
*
* @param toolId
* The tool id for the application (such as "sakai.mneme").
* @param context
* The context in which the object lives.
* @param id
* The object's id.
* @param userId
* The user id.
* @return The message string, or null if not denied access.
*/
String message(String toolId, String context, String id, String userId);
/**
* If the user should be denied access to the item, provide a message describing why (item completion details).
*
* @param toolId
* The tool id for the application (such as "sakai.mneme").
* @param context
* The context in which the object lives.
* @param id
* The object's id.
* @param userId
* The user id.
* @return The message string, or null if not denied access.
*/
String details(String toolId, String context, String id, String userId);
}
| [
"UdcsWeb@unisa.ac.za"
] | UdcsWeb@unisa.ac.za |
67fc6bdd1c1d1f800151aaab0362327dc9a509fd | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/1/1_cd7857c80195787948491d392bdd1cdbca12dddb/GenerateEEFEditorAction/1_cd7857c80195787948491d392bdd1cdbca12dddb_GenerateEEFEditorAction_s.java | af4bde44bb05fb5697c51c4b5ee5162b70160d93 | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 5,754 | java | /*******************************************************************************
* Copyright (c) 2011 Obeo.
* 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:
* Obeo - initial API and implementation
*******************************************************************************/
package org.eclipse.emf.eef.codegen.extended.ui.launcher;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl;
import org.eclipse.emf.eef.EEFGen.EEFGenModel;
import org.eclipse.emf.eef.codegen.EEFCodegenPlugin;
import org.eclipse.emf.eef.codegen.extended.flow.OverrideEMFEditorCode;
import org.eclipse.emf.eef.codegen.flow.Workflow;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.dialogs.ProgressMonitorDialog;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IActionDelegate;
import org.eclipse.ui.IObjectActionDelegate;
import org.eclipse.ui.IWorkbenchPart;
public class GenerateEEFEditorAction implements IObjectActionDelegate {
private static final String GENERATE_EEF_EDITOR = "Generate EEF Editor for ";
private Shell shell;
protected Set<IFile> selectedFiles;
protected List<EEFGenModel> eefGenModels;
/**
* Constructor for Action1.
*/
public GenerateEEFEditorAction() {
selectedFiles = new LinkedHashSet<IFile>();
eefGenModels = new ArrayList<EEFGenModel>();
}
/**
* @see IObjectActionDelegate#setActivePart(IAction, IWorkbenchPart)
*/
public void setActivePart(IAction action, IWorkbenchPart targetPart) {
shell = targetPart.getSite().getShell();
}
/**
* @see IActionDelegate#run(IAction)
*/
public void run(IAction action) {
try {
if (selectedFiles != null) {
eefGenModels = initEEFGenModel();
if (eefGenModels != null) {
final Workflow flow = new Workflow("Generate EEF Editors", shell);
for (final EEFGenModel eefGenModel : eefGenModels) {
String key = GENERATE_EEF_EDITOR + eefGenModel.eResource().getURI().toString();
OverrideEMFEditorCode eefEditorCode = new OverrideEMFEditorCode(key, eefGenModel);
flow.addStep(key, eefEditorCode);
}
flow.prepare();
IRunnableWithProgress runnable = new IRunnableWithProgress() {
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
flow.execute(monitor);
monitor.done();
selectedFiles.clear();
eefGenModels.clear();
}
};
new ProgressMonitorDialog(shell).run(true, true, runnable);
}
}
} catch (InvocationTargetException e) {
EEFCodegenPlugin.getDefault().logError(e);
} catch (InterruptedException e) {
EEFCodegenPlugin.getDefault().logWarning(e);
} catch (IOException e) {
EEFCodegenPlugin.getDefault().logError(e);
}
}
/**
* @see IActionDelegate#selectionChanged(IAction, ISelection)
*/
public void selectionChanged(IAction action, ISelection selection) {
if (selection instanceof StructuredSelection) {
StructuredSelection sSelection = (StructuredSelection)selection;
this.selectedFiles.clear();
for (Object selectedElement : sSelection.toList()) {
if (selectedElement instanceof IFile) {
this.selectedFiles.add((IFile)selectedElement);
}
}
}
}
/**
* {@inheritDoc}
*
* @see org.eclipse.emf.eef.codegen.ui.generators.actions.AbstractGenerateEEFAction#inutEEFGenModel()
*/
protected List<EEFGenModel> initEEFGenModel() throws IOException {
if (!selectedFiles.isEmpty()) {
ResourceSet resourceSet = new ResourceSetImpl();
for (IFile selectedFile : selectedFiles) {
URI modelURI = URI.createPlatformResourceURI(selectedFile.getFullPath().toString(), true);
String fileExtension = modelURI.fileExtension();
if (fileExtension == null || fileExtension.length() == 0) {
fileExtension = Resource.Factory.Registry.DEFAULT_EXTENSION;
}
final Resource.Factory.Registry registry = Resource.Factory.Registry.INSTANCE;
final Object resourceFactory = registry.getExtensionToFactoryMap().get(fileExtension);
if (resourceFactory != null) {
resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put(fileExtension,
resourceFactory);
} else {
resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put(fileExtension,
new XMIResourceFactoryImpl());
}
Resource res = resourceSet.createResource(modelURI);
res.load(Collections.EMPTY_MAP);
EcoreUtil.resolveAll(resourceSet);
if (res.getContents().size() > 0) {
EObject object = res.getContents().get(0);
if (object instanceof EEFGenModel) {
eefGenModels.add((EEFGenModel)object);
}
}
}
}
return eefGenModels;
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
20ded55e02cf47e03389942dfee0b5b80d0afce1 | f94e57ebae4a643e021babd96c0f577f11e08512 | /network/src/main/java/com/yuyang/network/volley/VolleyTrainFragment4.java | 93920d3d3b8259c7d4605e1c0c6e47887c5aa9c5 | [] | no_license | yuyang272999712/NewFeaturesTest | e23b8d465f4e972c0b7d96e8b29c7948c95a78e9 | 49bafbf8c252482ee1061670028ec1033719359c | refs/heads/master | 2021-08-02T19:16:10.656631 | 2021-07-26T07:55:06 | 2021-07-26T07:55:06 | 55,760,556 | 3 | 3 | null | null | null | null | UTF-8 | Java | false | false | 1,850 | java | package com.yuyang.network.volley;
import android.graphics.Color;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.TextView;
import com.yuyang.network.R;
import com.yuyang.volley_packaging.base.PeonyError;
import com.yuyang.network.volley.baseView.BaseFragment;
import com.yuyang.volley_packaging.listener.OnReceivedDataListener;
import com.yuyang.volley_packaging.listener.OnReceivedErrorListener;
import com.yuyang.volley_packaging.utils.PeonyErrorUtil;
/**
* Created by yuyang on 2017/4/6.
*/
public class VolleyTrainFragment4 extends BaseFragment {
private VolleyTrainPresenter presenter;
private TextView textView;
private Button button;
public static VolleyTrainFragment4 getInstance(){
return new VolleyTrainFragment4();
}
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_main, null);
view.setBackgroundColor(Color.parseColor("#FFB082"));
textView = (TextView) view.findViewById(R.id.result);
button = (Button) view.findViewById(R.id.button);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
presenter.loadUserInfo();
}
});
presenter = new VolleyTrainPresenter(this);
return view;
}
@Override
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
}
public void showUserInfo(User user) {
textView.setText(user.toString());
}
}
| [
"272999712@qq.com"
] | 272999712@qq.com |
f804c79d1183509b60780b047f6c421eb1d3f18f | 6dbae30c806f661bcdcbc5f5f6a366ad702b1eea | /Corpus/eclipse.pde.ui/54.java | 4e7fea6fd6f6d999dd29efe364dc6f9e0706deec | [
"MIT"
] | permissive | SurfGitHub/BLIZZARD-Replication-Package-ESEC-FSE2018 | d3fd21745dfddb2979e8ac262588cfdfe471899f | 0f8f4affd0ce1ecaa8ff8f487426f8edd6ad02c0 | refs/heads/master | 2020-03-31T15:52:01.005505 | 2018-10-01T23:38:50 | 2018-10-01T23:38:50 | 152,354,327 | 1 | 0 | MIT | 2018-10-10T02:57:02 | 2018-10-10T02:57:02 | null | UTF-8 | Java | false | false | 7,543 | java | /*******************************************************************************
* Copyright (c) 2005, 2013 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.pde.internal.core.builders;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.IProgressMonitor;
import org.w3c.dom.*;
public class UpdateSiteErrorReporter extends ManifestErrorReporter {
private IProgressMonitor fMonitor;
public UpdateSiteErrorReporter(IFile file) {
super(file);
}
@Override
public void validateContent(IProgressMonitor monitor) {
fMonitor = monitor;
Element root = getDocumentRoot();
if (root == null)
return;
String elementName = root.getNodeName();
if (//$NON-NLS-1$
!"site".equals(elementName)) {
reportIllegalElement(root, CompilerFlags.ERROR);
} else {
NamedNodeMap attributes = root.getAttributes();
for (int i = 0; i < attributes.getLength(); i++) {
Attr attr = (Attr) attributes.item(i);
String name = attr.getName();
if (//$NON-NLS-1$
!name.equals("type") && //$NON-NLS-1$
!name.equals("url") && !//$NON-NLS-1$
name.equals(//$NON-NLS-1$
"mirrorsURL") && !//$NON-NLS-1$
name.equals(//$NON-NLS-1$
"digestURL") && !//$NON-NLS-1$
name.equals(//$NON-NLS-1$
"pack200") && !//$NON-NLS-1$
name.equals(//$NON-NLS-1$
"availableLocales") && !name.equals("associateSitesURL")) {
reportUnknownAttribute(root, name, CompilerFlags.ERROR);
}
}
validateDescription(root);
validateFeatures(root);
validateCategoryDefinitions(root);
validateArchives(root);
}
}
/**
* @param root
*/
private void validateArchives(Element root) {
//$NON-NLS-1$
NodeList list = getChildrenByName(root, "archive");
for (int i = 0; i < list.getLength(); i++) {
if (fMonitor.isCanceled())
return;
Element element = (Element) list.item(i);
//$NON-NLS-1$
assertAttributeDefined(element, "path", CompilerFlags.ERROR);
//$NON-NLS-1$
assertAttributeDefined(element, "url", CompilerFlags.ERROR);
NamedNodeMap attributes = element.getAttributes();
for (int j = 0; j < attributes.getLength(); j++) {
Attr attr = (Attr) attributes.item(j);
String name = attr.getName();
if (//$NON-NLS-1$
name.equals("url")) {
validateURL(//$NON-NLS-1$
element, //$NON-NLS-1$
"url");
} else if (//$NON-NLS-1$
!name.equals("path")) {
reportUnknownAttribute(element, name, CompilerFlags.ERROR);
}
}
}
}
/**
* @param root
*/
private void validateCategoryDefinitions(Element root) {
//$NON-NLS-1$
NodeList list = getChildrenByName(root, "category-def");
for (int i = 0; i < list.getLength(); i++) {
if (fMonitor.isCanceled())
return;
Element element = (Element) list.item(i);
//$NON-NLS-1$
assertAttributeDefined(element, "name", CompilerFlags.ERROR);
//$NON-NLS-1$
assertAttributeDefined(element, "label", CompilerFlags.ERROR);
NamedNodeMap attributes = element.getAttributes();
for (int j = 0; j < attributes.getLength(); j++) {
Attr attr = (Attr) attributes.item(j);
String name = attr.getName();
if (//$NON-NLS-1$ //$NON-NLS-2$
!name.equals("name") && !name.equals("label")) {
reportUnknownAttribute(element, name, CompilerFlags.ERROR);
}
}
validateDescription(element);
}
}
/**
* @param root
*/
private void validateCategories(Element root) {
//$NON-NLS-1$
NodeList list = getChildrenByName(root, "category");
for (int i = 0; i < list.getLength(); i++) {
if (fMonitor.isCanceled())
return;
Element element = (Element) list.item(i);
//$NON-NLS-1$
assertAttributeDefined(element, "name", CompilerFlags.ERROR);
NamedNodeMap attributes = element.getAttributes();
for (int j = 0; j < attributes.getLength(); j++) {
Attr attr = (Attr) attributes.item(j);
String name = attr.getName();
if (//$NON-NLS-1$
!name.equals("name")) {
reportUnknownAttribute(element, name, CompilerFlags.ERROR);
}
}
}
}
private void validateFeatures(Element parent) {
//$NON-NLS-1$
NodeList list = getChildrenByName(parent, "feature");
for (int i = 0; i < list.getLength(); i++) {
Element element = (Element) list.item(i);
//$NON-NLS-1$
assertAttributeDefined(element, "url", CompilerFlags.ERROR);
NamedNodeMap attributes = element.getAttributes();
for (int j = 0; j < attributes.getLength(); j++) {
Attr attr = (Attr) attributes.item(j);
String name = attr.getName();
if (//$NON-NLS-1$
name.equals("url")) {
validateURL(//$NON-NLS-1$
element, //$NON-NLS-1$
"url");
} else if (//$NON-NLS-1$
name.equals("patch")) {
validateBoolean(element, attr);
} else if (//$NON-NLS-1$
name.equals("version")) {
validateVersionAttribute(element, attr);
} else if (//$NON-NLS-1$ //$NON-NLS-2$
!name.equals("type") && !name.equals("id") && !name.equals("os") && //$NON-NLS-1$ //$NON-NLS-2$
!name.equals("ws") && !name.equals("nl") && //$NON-NLS-1$ //$NON-NLS-2$
!name.equals("arch")) {
reportUnknownAttribute(element, name, CompilerFlags.ERROR);
}
}
validateCategories(element);
}
}
/**
* @param parent
*/
private void validateDescription(Element parent) {
//$NON-NLS-1$
NodeList list = getChildrenByName(parent, "description");
if (list.getLength() > 0) {
if (fMonitor.isCanceled())
return;
Element element = (Element) list.item(0);
validateElementWithContent((Element) list.item(0), true);
if (//$NON-NLS-1$
element.getAttributeNode("url") != null)
validateURL(//$NON-NLS-1$
element, //$NON-NLS-1$
"url");
reportExtraneousElements(list, 1);
}
}
}
| [
"masudcseku@gmail.com"
] | masudcseku@gmail.com |
5c0e8d6204cb648448262db2f6740509c6771df3 | 2a72051fa30bbf3017f60a5c1024f74307ccdef2 | /opensrp-core/src/test/java/org/opensrp/MultimediaServiceTest.java | c432b8d0dc96319663564a156a10d5323a77c47f | [] | no_license | proshantokuet/rebase | b6b0fd4c579eed1db10763373d75cc27be557d7d | 6f9bb090bcb9c1631bb2e20ddc8b428326970c07 | refs/heads/master | 2021-01-01T15:39:57.682784 | 2017-07-20T12:38:57 | 2017-07-20T12:38:57 | 97,671,632 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,562 | java | package org.opensrp;
import static org.mockito.MockitoAnnotations.initMocks;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.Ignore;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.opensrp.domain.Multimedia;
import org.opensrp.dto.form.MultimediaDTO;
import org.opensrp.repository.MultimediaRepository;
import org.opensrp.service.MultimediaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.mock.web.MockMultipartFile;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.web.multipart.MultipartFile;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("classpath:test-applicationContext-opensrp.xml")
public class MultimediaServiceTest {
@Mock
private MultimediaService multimediaService;
@Autowired
private MultimediaRepository multimediaRepository;
@Autowired
@Value("#{opensrp['multimedia.directory.name']}")
private String multimediaDirPath;
@Before
public void setUp() throws Exception
{
initMocks(this);
multimediaService = new MultimediaService(multimediaRepository);
}
@Ignore @Test
public void shouldSaveMultimediaFile() throws FileNotFoundException
{
MultimediaDTO multimedia = new MultimediaDTO("1234567891", "opensrp","image/jpeg","","nid");
String baseDirPath = System.getProperty("user.home");
FileInputStream fis = new FileInputStream(baseDirPath + File.separator +".OpenSRP/multimedia/image.jpeg");
MultipartFile multipartFile = null;
try {
multipartFile = new MockMultipartFile("file", fis);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
String status = multimediaService.saveMultimediaFile(multimedia,multipartFile);
Assert.assertEquals("success", status);
}
@Ignore @Test
public void shouldGetMultimediaFiles() throws FileNotFoundException
{
MultimediaDTO multimediaDTO = new MultimediaDTO("1234567890", "opensrp","image/jpeg","","profile");
Multimedia expectedMultimedia = new Multimedia()
.withCaseId(multimediaDTO.caseId())
.withProviderId(multimediaDTO.providerId())
.withContentType(multimediaDTO.contentType())
.withFilePath(multimediaDTO.filePath())
.withFileCategory(multimediaDTO.fileCategory());
String baseDirPath = System.getProperty("user.home");
FileInputStream fis = new FileInputStream(baseDirPath + File.separator +".OpenSRP/multimedia/image.jpeg");
MultipartFile multipartFile = null;
try {
multipartFile = new MockMultipartFile("file", fis);
} catch (IOException e) {
e.printStackTrace();
}
boolean status = multimediaService.uploadFile(multimediaDTO, multipartFile);
if(status)
multimediaRepository.add(expectedMultimedia);
List<Multimedia> multimediaFiles = multimediaService.getMultimediaFiles("opensrp");
for(Multimedia actualMultimedia : multimediaFiles)
{
if(actualMultimedia.getCaseId().equals(multimediaDTO.caseId()))
Assert.assertEquals(expectedMultimedia.getFilePath(),actualMultimedia.getFilePath());
}
}
}
| [
"proshanto@mpower-social.com"
] | proshanto@mpower-social.com |
52fcfa83639b59c2373ee4624f25939e493d9c47 | d13e8df26024722058fb7b8a8e7bf3725242b0a7 | /modules/lwjgl/vulkan/src/generated/java/org/lwjgl/vulkan/MVKMacosSurface.java | 8e453fdd4c4574c69a4ba6178dd6407ae562e108 | [
"LGPL-2.0-or-later",
"BSD-3-Clause",
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-free-unknown",
"LicenseRef-scancode-public-domain",
"BSD-2-Clause",
"LicenseRef-scancode-khronos"
] | permissive | creeper-0910/lwjgl3 | 5e0790825d140797e6ae74d19511f052bb68e22e | 164fcdff248f9497d9e4a3fb9200f382949e5ad4 | refs/heads/master | 2022-04-29T13:12:14.325399 | 2022-03-03T16:53:15 | 2022-03-03T18:52:31 | 222,029,372 | 0 | 0 | BSD-3-Clause | 2019-11-16T01:23:03 | 2019-11-16T01:23:03 | null | UTF-8 | Java | false | false | 7,364 | java | /*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.vulkan;
import javax.annotation.*;
import java.nio.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.Checks.*;
import static org.lwjgl.system.JNI.*;
import static org.lwjgl.system.MemoryUtil.*;
/**
* The {@code VK_MVK_macos_surface} extension is an instance extension. It provides a mechanism to create a {@code VkSurfaceKHR} object (defined by the {@link KHRSurface VK_KHR_surface} extension) based on an {@code NSView}, the native surface type of macOS, which is underpinned by a {@code CAMetalLayer}, to support rendering to the surface using Apple’s Metal framework.
*
* <h5>Deprecation by {@code VK_EXT_metal_surface}</h5>
*
* <p>The {@code VK_MVK_macos_surface} extension is considered deprecated and has been superseded by the {@link EXTMetalSurface VK_EXT_metal_surface} extension.</p>
*
* <h5>VK_MVK_macos_surface</h5>
*
* <dl>
* <dt><b>Name String</b></dt>
* <dd>{@code VK_MVK_macos_surface}</dd>
* <dt><b>Extension Type</b></dt>
* <dd>Instance extension</dd>
* <dt><b>Registered Extension Number</b></dt>
* <dd>124</dd>
* <dt><b>Revision</b></dt>
* <dd>3</dd>
* <dt><b>Extension and Version Dependencies</b></dt>
* <dd><ul>
* <li>Requires Vulkan 1.0</li>
* <li>Requires {@link KHRSurface VK_KHR_surface}</li>
* </ul></dd>
* <dt><b>Deprecation state</b></dt>
* <dd><ul>
* <li><em>Deprecated</em> by {@link EXTMetalSurface VK_EXT_metal_surface} extension</li>
* </ul></dd>
* <dt><b>Contact</b></dt>
* <dd><ul>
* <li>Bill Hollings <a target="_blank" href="https://github.com/KhronosGroup/Vulkan-Docs/issues/new?body=[VK_MVK_macos_surface]%20@billhollings%250A%3C%3CHere%20describe%20the%20issue%20or%20question%20you%20have%20about%20the%20VK_MVK_macos_surface%20extension%3E%3E">billhollings</a></li>
* </ul></dd>
* </dl>
*
* <h5>Other Extension Metadata</h5>
*
* <dl>
* <dt><b>Last Modified Date</b></dt>
* <dd>2020-07-31</dd>
* <dt><b>IP Status</b></dt>
* <dd>No known IP claims.</dd>
* <dt><b>Contributors</b></dt>
* <dd><ul>
* <li>Bill Hollings, The Brenwill Workshop Ltd.</li>
* </ul></dd>
* </dl>
*/
public class MVKMacosSurface {
/** The extension specification version. */
public static final int VK_MVK_MACOS_SURFACE_SPEC_VERSION = 3;
/** The extension name. */
public static final String VK_MVK_MACOS_SURFACE_EXTENSION_NAME = "VK_MVK_macos_surface";
/** Extends {@code VkStructureType}. */
public static final int VK_STRUCTURE_TYPE_MACOS_SURFACE_CREATE_INFO_MVK = 1000123000;
protected MVKMacosSurface() {
throw new UnsupportedOperationException();
}
// --- [ vkCreateMacOSSurfaceMVK ] ---
/** Unsafe version of: {@link #vkCreateMacOSSurfaceMVK CreateMacOSSurfaceMVK} */
public static int nvkCreateMacOSSurfaceMVK(VkInstance instance, long pCreateInfo, long pAllocator, long pSurface) {
long __functionAddress = instance.getCapabilities().vkCreateMacOSSurfaceMVK;
if (CHECKS) {
check(__functionAddress);
}
return callPPPPI(instance.address(), pCreateInfo, pAllocator, pSurface, __functionAddress);
}
/**
* Create a VkSurfaceKHR object for a macOS NSView.
*
* <h5>C Specification</h5>
*
* <p>To create a {@code VkSurfaceKHR} object for a macOS {@code NSView} or {@code CAMetalLayer}, call:</p>
*
* <pre><code>
* VkResult vkCreateMacOSSurfaceMVK(
* VkInstance instance,
* const VkMacOSSurfaceCreateInfoMVK* pCreateInfo,
* const VkAllocationCallbacks* pAllocator,
* VkSurfaceKHR* pSurface);</code></pre>
*
* <h5>Description</h5>
*
* <div style="margin-left: 26px; border-left: 1px solid gray; padding-left: 14px;"><h5>Note</h5>
*
* <p>The {@code vkCreateMacOSSurfaceMVK} function is considered deprecated and has been superseded by {@link EXTMetalSurface#vkCreateMetalSurfaceEXT CreateMetalSurfaceEXT} from the {@link EXTMetalSurface VK_EXT_metal_surface} extension.</p>
* </div>
*
* <h5>Valid Usage (Implicit)</h5>
*
* <ul>
* <li>{@code instance} <b>must</b> be a valid {@code VkInstance} handle</li>
* <li>{@code pCreateInfo} <b>must</b> be a valid pointer to a valid {@link VkMacOSSurfaceCreateInfoMVK} structure</li>
* <li>If {@code pAllocator} is not {@code NULL}, {@code pAllocator} <b>must</b> be a valid pointer to a valid {@link VkAllocationCallbacks} structure</li>
* <li>{@code pSurface} <b>must</b> be a valid pointer to a {@code VkSurfaceKHR} handle</li>
* </ul>
*
* <h5>Return Codes</h5>
*
* <dl>
* <dt>On success, this command returns</dt>
* <dd><ul>
* <li>{@link VK10#VK_SUCCESS SUCCESS}</li>
* </ul></dd>
* <dt>On failure, this command returns</dt>
* <dd><ul>
* <li>{@link VK10#VK_ERROR_OUT_OF_HOST_MEMORY ERROR_OUT_OF_HOST_MEMORY}</li>
* <li>{@link VK10#VK_ERROR_OUT_OF_DEVICE_MEMORY ERROR_OUT_OF_DEVICE_MEMORY}</li>
* <li>{@link KHRSurface#VK_ERROR_NATIVE_WINDOW_IN_USE_KHR ERROR_NATIVE_WINDOW_IN_USE_KHR}</li>
* </ul></dd>
* </dl>
*
* <h5>See Also</h5>
*
* <p>{@link VkAllocationCallbacks}, {@link VkMacOSSurfaceCreateInfoMVK}</p>
*
* @param instance the instance with which to associate the surface.
* @param pCreateInfo a pointer to a {@link VkMacOSSurfaceCreateInfoMVK} structure containing parameters affecting the creation of the surface object.
* @param pAllocator the allocator used for host memory allocated for the surface object when there is no more specific allocator available (see <a target="_blank" href="https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#memory-allocation">Memory Allocation</a>).
* @param pSurface a pointer to a {@code VkSurfaceKHR} handle in which the created surface object is returned.
*/
@NativeType("VkResult")
public static int vkCreateMacOSSurfaceMVK(VkInstance instance, @NativeType("VkMacOSSurfaceCreateInfoMVK const *") VkMacOSSurfaceCreateInfoMVK pCreateInfo, @Nullable @NativeType("VkAllocationCallbacks const *") VkAllocationCallbacks pAllocator, @NativeType("VkSurfaceKHR *") LongBuffer pSurface) {
if (CHECKS) {
check(pSurface, 1);
}
return nvkCreateMacOSSurfaceMVK(instance, pCreateInfo.address(), memAddressSafe(pAllocator), memAddress(pSurface));
}
/** Array version of: {@link #vkCreateMacOSSurfaceMVK CreateMacOSSurfaceMVK} */
@NativeType("VkResult")
public static int vkCreateMacOSSurfaceMVK(VkInstance instance, @NativeType("VkMacOSSurfaceCreateInfoMVK const *") VkMacOSSurfaceCreateInfoMVK pCreateInfo, @Nullable @NativeType("VkAllocationCallbacks const *") VkAllocationCallbacks pAllocator, @NativeType("VkSurfaceKHR *") long[] pSurface) {
long __functionAddress = instance.getCapabilities().vkCreateMacOSSurfaceMVK;
if (CHECKS) {
check(__functionAddress);
check(pSurface, 1);
}
return callPPPPI(instance.address(), pCreateInfo.address(), memAddressSafe(pAllocator), pSurface, __functionAddress);
}
} | [
"iotsakp@gmail.com"
] | iotsakp@gmail.com |
be9ba2119bcef7dbbfa2d03ebd5243d9a8427f65 | e11d3e6ad13b5466e86e52ea13a912513dc5c9e6 | /ml-jobs/ml-topic-differential/src/main/java/com/github/chen0040/ml/services/MLDataServiceImpl.java | 160e78d1d6d74f84eb52f9d3b2f1019c93f2f7d0 | [
"MIT"
] | permissive | zyq11223/java-machine-learning-web-api | c0dbcad09878e3eb37c3caecec5db10b075d0de4 | 562c861997392b8e50f4ce8405e9a04c340ecb14 | refs/heads/master | 2020-04-22T09:10:33.619398 | 2017-11-24T04:18:55 | 2017-11-24T04:18:55 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,020 | java | package com.github.chen0040.ml.services;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.TypeReference;
import com.github.chen0040.ml.models.AlgorithmModule;
import com.github.chen0040.ml.models.PredictedValue;
import com.google.common.util.concurrent.*;
import com.github.chen0040.ml.enums.AlgorithmType;
import com.github.chen0040.ml.models.Feature;
import com.github.chen0040.ml.models.TopicModel;
import com.github.chen0040.ml.models.spark.SparkDataSeries;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.inject.Inject;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.concurrent.Executors;
/**
* Created by root on 11/11/15.
*/
public class MLDataServiceImpl implements MLDataService {
private static final Logger logger = LoggerFactory.getLogger(MLDataServiceImpl.class);
private ListeningExecutorService service;
private int intervalInMinutes = 20;
@Inject
private MLSparkService sparkService;
@Inject
private AlgorithmModuleService moduleService;
@Inject
private TopicModelService topicModelService;
public MLDataServiceImpl(){
service = MoreExecutors.listeningDecorator(Executors.newFixedThreadPool(10));
}
@Override
public List<PredictedValue> createData(AlgorithmModule module) {
Date date = new Date();
long currentTime = date.getTime();
return sparkService.tryGetAlgorithmModuleDataView(module, currentTime);
}
@Override
public void startScheduler() {
stepAsync();
}
private void stepAsync(){
Futures.addCallback(step(), new FutureCallback<List<AlgorithmModule>>() {
@Override
public void onSuccess(List<AlgorithmModule> algorithmModules) {
try {
Thread.sleep(intervalInMinutes * 60 * 1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
stepAsync();
}
@Override
public void onFailure(Throwable throwable) {
}
});
}
private ListenableFuture<List<AlgorithmModule>> step(){
ListenableFuture<List<AlgorithmModule>> future_me = service.submit(()->{
List<AlgorithmModule> modules = moduleService.findAll();
for(int i=0; i < modules.size(); ++i) {
AlgorithmModule module = modules.get(i);
step(module);
}
return modules;
});
return future_me;
}
private void step(AlgorithmModule module){
AlgorithmType algorithmType = module.getAlgorithmType();
if (algorithmType == AlgorithmType.MLTopics_LDA) {
List<PredictedValue> values = createData(module);
if(values == null || values.isEmpty()) {
logger.warn("Spark@"+sparkService.getUrl()+" does not return data");
return;
}
TopicModel model = new TopicModel();
model.getModelKey().setModuleId(module.getId());
Date date = new Date();
model.getModelKey().setCaptureTime(date.getTime());
model.setRateOfChangeInTopic(0);
model.setRateOfChangeInTopWords(0);
model.setCompanyId(module.getCompanyId());
for(int i=0; i < values.size(); ++i){
PredictedValue pv = values.get(i);
Map<Feature, String> features = pv.getFeatureValuesMap();
for(Map.Entry<Feature, String> entry : features.entrySet()){
Feature feature = entry.getKey();
String name = feature.getName().toLowerCase();
if(name.equals("topic-summary")){
String content = entry.getValue();
List<String> topics = JSON.parseObject(content, new TypeReference<List<String>>() {
}.getType());
model.getTopics().addAll(topics);
} else if(name.equals("word-rank-specificity")){
String content = entry.getValue();
SparkDataSeries ts = JSON.parseObject(content, SparkDataSeries.class);
for(int k=0; k < ts.size(); ++k){
model.getWordTopicSpecificities().put(ts.get(k).label, ts.get(k).value);
}
} else if(name.equals("word-rank-count")){
String content = entry.getValue();
SparkDataSeries ts = JSON.parseObject(content, SparkDataSeries.class);
for(int k=0; k < ts.size(); ++k){
model.getWordCounts().put(ts.get(k).label, ts.get(k).value);
}
}
}
}
logger.info("Topic capture @"+date);
topicModelService.save(model);
}
}
}
| [
"xs0040@gmail.com"
] | xs0040@gmail.com |
022d1f3342a121858b72afa80262881a1a2f4f71 | 22b9c697e549de334ac354dfc1d14223eff99121 | /PaaS-SaaS_HealthCareApp/DoctorPatientCRMExtension/HealthCare/HealthCareWSProxyClient/src/com/oracle/ptsdemo/healthcare/wsclient/osc/salesparty/generated/GetSalesAccountResponse.java | e5fbbd7588b48bd78a797515d9e057e7f5bb77e8 | [
"BSD-3-Clause"
] | permissive | digideskio/oracle-cloud | 50e0d24e937b3afc991ad9cb418aa2bb263a4372 | 80420e9516290e5d5bfd6c0fa2eaacbc11762ec7 | refs/heads/master | 2021-01-22T13:57:21.947497 | 2016-05-13T06:26:16 | 2016-05-13T06:26:16 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,590 | java |
package com.oracle.ptsdemo.healthcare.wsclient.osc.salesparty.generated;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for anonymous complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="result" type="{http://xmlns.oracle.com/apps/crmCommon/salesParties/salesPartiesService/}SalesAccount"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"result"
})
@XmlRootElement(name = "getSalesAccountResponse")
public class GetSalesAccountResponse {
@XmlElement(required = true)
protected SalesAccount result;
/**
* Gets the value of the result property.
*
* @return
* possible object is
* {@link SalesAccount }
*
*/
public SalesAccount getResult() {
return result;
}
/**
* Sets the value of the result property.
*
* @param value
* allowed object is
* {@link SalesAccount }
*
*/
public void setResult(SalesAccount value) {
this.result = value;
}
}
| [
"shailendrapradhan@Shailendras-MacBook-Pro.local"
] | shailendrapradhan@Shailendras-MacBook-Pro.local |
f39414d23e8531f226a4c7f11a960f634b716392 | ba71698819d9f2304d43d0c777a66b4460788d14 | /connecteur-maven-jrecord/JRecord_Version_0.90.2/Source/OtherSource/JRecord_CodeGen/src/net/sf/JRecord/cg/schema/classDefinitions/DateFormatStr.java | 49dcd886c2258c442899d31b0722ba2ec7e4a424 | [
"LicenseRef-scancode-warranty-disclaimer"
] | no_license | helidrissi/connect | 2a85c31e3cc8c70ecd532072d09e70220d270bb8 | 5bbf5f8869d427bd612960ec127bf83ca038fefb | refs/heads/main | 2023-03-12T23:21:49.930397 | 2021-02-26T15:01:36 | 2021-02-26T15:01:36 | 342,275,745 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,270 | java | package net.sf.JRecord.cg.schema.classDefinitions;
public class DateFormatStr {
public final String dateFormat, name, codeDateFormat, sep;
public final boolean hasYYYY, startsWithYY, hasSep;
public DateFormatStr(String dateFormat, String name, String sep) {
super();
this.dateFormat = dateFormat;
this.name = name;
this.sep = sep;
this.hasYYYY = dateFormat.indexOf("yyyy") >= 0;
this.startsWithYY = dateFormat.startsWith("yy");
this.hasSep = sep != null && sep.length() > 0;
String cdf = dateFormat;
if (sep != null && sep.length() > 0) {
int length = dateFormat.length();
StringBuilder b = new StringBuilder(length);
int dCount = 0, mCount = 0;
for (int i = 0; i < length; i++) {
char charAt = dateFormat.charAt(i);
switch (charAt) {
case 'd':
if (dCount++ == 0) {
b.append(charAt);
}
break;
case 'M':
switch (mCount++) {
case 0 : b.append(charAt); break;
case 2 : b.append("MM"); break;
}
break;
default:
b.append(charAt);
}
}
cdf = b.toString();
} else if (dateFormat.startsWith("dd") || (dateFormat.startsWith("MM") && ! dateFormat.startsWith("MMM"))) {
cdf = dateFormat.substring(1);
}
codeDateFormat = cdf;
}
}
| [
"hamza.elidrissi@mistral.fr"
] | hamza.elidrissi@mistral.fr |
c66965a3ce461e6e9e1668fdf0c85229311a2e1c | 8df3759e699c44301ae31ee7f35b1968e553770a | /src/main/java/yichenliang/leetcode/all/LongestIncreasingPathInAMatrix.java | 2f7a6ce3ee4b30bebbcb0a7a41d977eb87616bd6 | [] | no_license | yichenliang/LeetCode-Programming | ae73fe1f9e5b49c71585ac1363085d9cd03e64d5 | 65bffcf8a01efe0a2bb3c9b58d76ba9f347d18a0 | refs/heads/master | 2020-03-22T03:02:36.341876 | 2019-08-15T15:46:41 | 2019-08-15T15:46:41 | 139,409,771 | 1 | 1 | null | 2019-02-22T16:00:56 | 2018-07-02T07:54:21 | Java | UTF-8 | Java | false | false | 1,364 | java | package yichenliang.leetcode.all;
/**
* 329. Longest Increasing Path in a Matrix
*
* dp + dfs
*
* time complexity: O(m*n)
* space complexity: O(m*n)
*
*/
public class LongestIncreasingPathInAMatrix {
public int longestIncreasingPath(int[][] matrix) {
if(matrix == null || matrix.length == 0|| matrix[0].length == 0) return 0;
int row = matrix.length;
int col = matrix[0].length;
int[][] dp = new int[row][col];
int ans = 0;
for(int i = 0; i < row; i++){
for(int j = 0; j < col; j++){
int current = dfs(matrix, i, j, dp);
ans = Math.max(ans, current);
}
}
return ans;
}
private int dfs(int[][] matrix, int i, int j, int[][] dp){
if(dp[i][j] != 0){
return dp[i][j];
}
int[] dir = {0, -1, 0, 1, 0};
dp[i][j] = 1;
for(int n = 0; n < 4; n++){
int ti = i + dir[n];
int tj = j + dir[n + 1];
if(ti < 0 || tj < 0 || ti >= matrix.length ||tj >= matrix[0].length || matrix[ti][tj] <= matrix[i][j]){
continue;
}
dp[i][j] = Math.max(dp[i][j], 1 + dfs(matrix, ti, tj, dp));
}
return dp[i][j];
}
}
| [
"yichenliang@ufl.edu"
] | yichenliang@ufl.edu |
5e7aa8b9215056590dce0684ae22bb5425ff8c82 | c8664fc194971e6e39ba8674b20d88ccfa7663b1 | /com/google/android/gms/wearable/internal/au.java | 2574e9cc5b1bda199afb17738acf1a1ad7f1a7f9 | [] | no_license | raochuan/wexin1120 | b926bc8d4143c4b523ed43e265cd20ef0c89ad40 | 1eaa71e1e3e7c9f9b9f96db8de56db3dfc4fb4d3 | refs/heads/master | 2020-05-17T23:57:00.000696 | 2017-11-03T02:33:27 | 2017-11-03T02:33:27 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 342 | java | package com.google.android.gms.wearable.internal;
import com.google.android.gms.wearable.r;
public final class au
implements r
{}
/* Location: /Users/xianghongyan/decompile/dex2jar/classes2-dex2jar.jar!/com/google/android/gms/wearable/internal/au.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/ | [
"15223790237@139.com"
] | 15223790237@139.com |
b70af62b38ee2f07c23e9734dcb79968a59353b2 | 24fd3a436567e2ca7dec46a56da4a0ac4600ae21 | /eshop/src/test/java/com/lj/eshop/service/impl/ProductRuleServiceImplTest.java | 13b7af63fbbff9c6ba75b52b6eab51330b10ff2b | [] | no_license | wo510751575/eshop | a5e2074edb1b1a0b4536c2b8c28b5a04df7dba39 | e396a1676625121ff58587687721ff2ea95c2603 | refs/heads/master | 2020-07-09T13:30:01.772234 | 2019-08-28T03:19:07 | 2019-08-28T03:19:07 | 203,496,762 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,131 | java | package com.lj.eshop.service.impl;
/**
* Copyright © 2017-2020 All rights reserved.
*
* Licensed under the 深圳市深圳扬恩科技 License, Version 1.0 (the "License");
*
*/
import javax.annotation.Resource;
import org.junit.Assert;
import org.junit.Test;
import com.lj.base.core.pagination.Page;
import com.lj.base.exception.TsfaServiceException;
import com.lj.base.mvc.web.test.SpringTestCase;
import java.util.List;
import com.lj.eshop.dto.ProductRuleDto;
import com.lj.eshop.dto.FindProductRulePage;
import com.lj.eshop.service.IProductRuleService;
/**
* 类说明:测试类
*
*
* <p>
* 详细描述:.
*
* @author lhy
*
*
* CreateDate: 2017-08-22
*/
public class ProductRuleServiceImplTest extends SpringTestCase{
@Resource
IProductRuleService productRuleService;
/**
*
*
* 方法说明:添加商品规格分类信息
*
* @throws TsfaServiceException
*
* @author lhy CreateDate: 2017-08-22
*
*/
@Test
public void addProductRule() throws TsfaServiceException{
ProductRuleDto productRuleDto = new ProductRuleDto();
//add数据录入
productRuleDto.setCode("Code");
productRuleDto.setName("Name");
productRuleDto.setProductCode("ProductCode");
productRuleDto.setRemarks("Remarks");
productRuleDto.setOrderNo(1);
productRuleService.addProductRule(productRuleDto);
}
/**
*
*
* 方法说明:修改商品规格分类信息
*
* @throws TsfaServiceException
*
* @author lhy CreateDate: 2017-08-22
*
*/
@Test
public void updateProductRule() throws TsfaServiceException{
ProductRuleDto productRuleDto = new ProductRuleDto();
//update数据录入
productRuleDto.setCode("Code");
productRuleDto.setName("Name");
productRuleDto.setProductCode("ProductCode");
productRuleDto.setRemarks("Remarks");
productRuleDto.setOrderNo(2);
productRuleService.updateProductRule(productRuleDto);
}
/**
*
*
* 方法说明:查找商品规格分类信息
*
* @throws TsfaServiceException
*
* @author lhy CreateDate: 2017-08-22
*
*/
@Test
public void findProductRule() throws TsfaServiceException{
ProductRuleDto findProductRule = new ProductRuleDto();
findProductRule.setCode("111");
productRuleService.findProductRule(findProductRule);
}
/**
*
*
* 方法说明:查找商品规格分类信息
*
* @throws TsfaServiceException
*
* @author lhy CreateDate: 2017-08-22
*
*/
@Test
public void findProductRulePage() throws TsfaServiceException{
FindProductRulePage findProductRulePage = new FindProductRulePage();
Page<ProductRuleDto> page = productRuleService.findProductRulePage(findProductRulePage);
Assert.assertNotNull(page);
}
/**
*
*
* 方法说明:查找商品规格分类信息
*
* @throws TsfaServiceException
*
* @author lhy CreateDate: 2017-08-22
*
*/
@Test
public void findProductRules() throws TsfaServiceException{
FindProductRulePage findProductRulePage = new FindProductRulePage();
List<ProductRuleDto> page = productRuleService.findProductRules(findProductRulePage);
Assert.assertNotNull(page);
}
}
| [
"37724558+wo510751575@users.noreply.github.com"
] | 37724558+wo510751575@users.noreply.github.com |
fe38ead41a15709d8720b0b54337ebc670875951 | 66581bc32744f3a30be77c7638a534f024daddb6 | /sakai-mini/2.8.0/jsf/jsf-widgets/src/java/org/sakaiproject/jsf/component/ToolBarComponent.java | 1e3525bc1a92eab019a52d7c8a706bc8ca3d0a10 | [
"ECL-2.0"
] | permissive | lijiangt/sakai | 087be33a4f20fe199458fe6a4404f37c613f3fa2 | 2647ef7e93617e33d53b1756918e64502522636b | refs/heads/master | 2021-01-10T08:44:39.756518 | 2012-03-05T14:40:08 | 2012-03-05T14:40:08 | 36,716,620 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,523 | java | /**********************************************************************************
* $URL: https://source.sakaiproject.org/svn/jsf/tags/jsf-2.8.1/jsf-widgets/src/java/org/sakaiproject/jsf/component/ToolBarComponent.java $
* $Id: ToolBarComponent.java 68846 2009-11-13 12:27:32Z arwhyte@umich.edu $
**********************************************************************************
*
* Copyright (c) 2003, 2004, 2005, 2006, 2008 The Sakai Foundation
*
* Licensed under the Educational Community License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.osedu.org/licenses/ECL-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.sakaiproject.jsf.component;
import javax.faces.component.UIComponentBase;
public class ToolBarComponent extends UIComponentBase
{
public ToolBarComponent()
{
super();
this.setRendererType("org.sakaiproject.ToolBar");
}
/**
* {@inheritDoc}
*/
public String getFamily()
{
return "org.sakaiproject.ToolBar";
}
}
| [
"lijiangt@gmail.com"
] | lijiangt@gmail.com |
e2b9b38cf2784cbcc33773a12b86c37577513a1e | c885ef92397be9d54b87741f01557f61d3f794f3 | /tests-without-trycatch/Cli-33/org.apache.commons.cli.HelpFormatter/BBC-F0-opt-60/2/org/apache/commons/cli/HelpFormatter_ESTest_scaffolding.java | 4a97f613b5ae79038188947cdeca67dc0938cdc5 | [
"CC-BY-4.0",
"MIT"
] | permissive | pderakhshanfar/EMSE-BBC-experiment | f60ac5f7664dd9a85f755a00a57ec12c7551e8c6 | fea1a92c2e7ba7080b8529e2052259c9b697bbda | refs/heads/main | 2022-11-25T00:39:58.983828 | 2022-04-12T16:04:26 | 2022-04-12T16:04:26 | 309,335,889 | 0 | 1 | null | 2021-11-05T11:18:43 | 2020-11-02T10:30:38 | null | UTF-8 | Java | false | false | 4,751 | java | /**
* Scaffolding file used to store all the setups needed to run
* tests automatically generated by EvoSuite
* Wed Oct 13 14:46:20 GMT 2021
*/
package org.apache.commons.cli;
import org.evosuite.runtime.annotation.EvoSuiteClassExclude;
import org.junit.BeforeClass;
import org.junit.Before;
import org.junit.After;
import org.junit.AfterClass;
import org.evosuite.runtime.sandbox.Sandbox;
import org.evosuite.runtime.sandbox.Sandbox.SandboxMode;
import static org.evosuite.shaded.org.mockito.Mockito.*;
@EvoSuiteClassExclude
public class HelpFormatter_ESTest_scaffolding {
@org.junit.Rule
public org.evosuite.runtime.vnet.NonFunctionalRequirementRule nfr = new org.evosuite.runtime.vnet.NonFunctionalRequirementRule();
private static final java.util.Properties defaultProperties = (java.util.Properties) java.lang.System.getProperties().clone();
private org.evosuite.runtime.thread.ThreadStopper threadStopper = new org.evosuite.runtime.thread.ThreadStopper (org.evosuite.runtime.thread.KillSwitchHandler.getInstance(), 3000);
@BeforeClass
public static void initEvoSuiteFramework() {
org.evosuite.runtime.RuntimeSettings.className = "org.apache.commons.cli.HelpFormatter";
org.evosuite.runtime.GuiSupport.initialize();
org.evosuite.runtime.RuntimeSettings.maxNumberOfThreads = 100;
org.evosuite.runtime.RuntimeSettings.maxNumberOfIterationsPerLoop = 10000;
org.evosuite.runtime.RuntimeSettings.mockSystemIn = true;
org.evosuite.runtime.RuntimeSettings.sandboxMode = org.evosuite.runtime.sandbox.Sandbox.SandboxMode.RECOMMENDED;
org.evosuite.runtime.sandbox.Sandbox.initializeSecurityManagerForSUT();
org.evosuite.runtime.classhandling.JDKClassResetter.init();
setSystemProperties();
initializeClasses();
org.evosuite.runtime.Runtime.getInstance().resetRuntime();
try { initMocksToAvoidTimeoutsInTheTests(); } catch(ClassNotFoundException e) {}
}
@AfterClass
public static void clearEvoSuiteFramework(){
Sandbox.resetDefaultSecurityManager();
java.lang.System.setProperties((java.util.Properties) defaultProperties.clone());
}
@Before
public void initTestCase(){
threadStopper.storeCurrentThreads();
threadStopper.startRecordingTime();
org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().initHandler();
org.evosuite.runtime.sandbox.Sandbox.goingToExecuteSUTCode();
setSystemProperties();
org.evosuite.runtime.GuiSupport.setHeadless();
org.evosuite.runtime.Runtime.getInstance().resetRuntime();
org.evosuite.runtime.agent.InstrumentingAgent.activate();
}
@After
public void doneWithTestCase(){
threadStopper.killAndJoinClientThreads();
org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().safeExecuteAddedHooks();
org.evosuite.runtime.classhandling.JDKClassResetter.reset();
resetClasses();
org.evosuite.runtime.sandbox.Sandbox.doneWithExecutingSUTCode();
org.evosuite.runtime.agent.InstrumentingAgent.deactivate();
org.evosuite.runtime.GuiSupport.restoreHeadlessMode();
}
public static void setSystemProperties() {
java.lang.System.setProperties((java.util.Properties) defaultProperties.clone());
java.lang.System.setProperty("user.dir", "/experiment");
java.lang.System.setProperty("java.io.tmpdir", "/tmp");
}
private static void initializeClasses() {
org.evosuite.runtime.classhandling.ClassStateSupport.initializeClasses(HelpFormatter_ESTest_scaffolding.class.getClassLoader() ,
"org.apache.commons.cli.HelpFormatter$OptionComparator",
"org.apache.commons.cli.AlreadySelectedException",
"org.apache.commons.cli.ParseException",
"org.apache.commons.cli.OptionValidator",
"org.apache.commons.cli.Options",
"org.apache.commons.cli.OptionGroup",
"org.apache.commons.cli.HelpFormatter",
"org.apache.commons.cli.Option",
"org.apache.commons.cli.Util"
);
}
private static void initMocksToAvoidTimeoutsInTheTests() throws ClassNotFoundException {
mock(Class.forName("java.util.Comparator", false, HelpFormatter_ESTest_scaffolding.class.getClassLoader()));
}
private static void resetClasses() {
org.evosuite.runtime.classhandling.ClassResetter.getInstance().setClassLoader(HelpFormatter_ESTest_scaffolding.class.getClassLoader());
org.evosuite.runtime.classhandling.ClassStateSupport.resetClasses(
"org.apache.commons.cli.HelpFormatter",
"org.apache.commons.cli.HelpFormatter$OptionComparator",
"org.apache.commons.cli.Options",
"org.apache.commons.cli.Util",
"org.apache.commons.cli.Option",
"org.apache.commons.cli.OptionValidator",
"org.apache.commons.cli.OptionGroup"
);
}
}
| [
"pouria.derakhshanfar@gmail.com"
] | pouria.derakhshanfar@gmail.com |
8197fb07fbc0a316bc2b4ab746dc65a67a97ffb2 | 1061f06e7a159d85d31ee96f8325602e7c01545d | /src/main/java/br/com/anteros/bean/validation/constraints/validators/SizeValidator.java | 5aee741d410d293b2eb616cb48b7adfdfe0d4a62 | [] | no_license | anterostecnologia/anterosbeanvalidation | 33c99f092f5182975f8da28e78fb14b89ce0431f | ba02df4423cee48d825d72267facf45b88798537 | refs/heads/master | 2022-09-11T09:12:53.956354 | 2021-03-26T18:51:31 | 2021-03-26T18:51:31 | 56,145,708 | 0 | 0 | null | 2022-09-01T22:51:58 | 2016-04-13T11:22:44 | Java | UTF-8 | Java | false | false | 1,637 | java | /*******************************************************************************
* Copyright 2012 Anteros Tecnologia
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*******************************************************************************/
package br.com.anteros.bean.validation.constraints.validators;
import br.com.anteros.validation.api.ValidationException;
import br.com.anteros.validation.api.constraints.Size;
/**
* Description: Abstract validator impl. for @Size annotation<br/>
*/
public abstract class SizeValidator {
protected int min;
protected int max;
/**
* Configure the constraint validator based on the elements
* specified at the time it was defined.
*
* @param constraint the constraint definition
*/
public void initialize(Size constraint) {
min = constraint.min();
max = constraint.max();
if (min < 0) throw new ValidationException("Min cannot be negative");
if (max < 0) throw new ValidationException("Max cannot be negative");
if (max < min) throw new ValidationException("Max cannot be less than Min");
}
} | [
"edsonmartins2005@gmail.com"
] | edsonmartins2005@gmail.com |
794c376434b2cbf8c269d39dd419941ed598039b | f08256664e46e5ac1466f5c67dadce9e19b4e173 | /sources/com/bamtech/shadow/gson/internal/bind/C2194b.java | 756d9f83281dd65c1e66130832bcf5bd598332a7 | [] | no_license | IOIIIO/DisneyPlusSource | 5f981420df36bfbc3313756ffc7872d84246488d | 658947960bd71c0582324f045a400ae6c3147cc3 | refs/heads/master | 2020-09-30T22:33:43.011489 | 2019-12-11T22:27:58 | 2019-12-11T22:27:58 | 227,382,471 | 6 | 3 | null | null | null | null | UTF-8 | Java | false | false | 6,223 | java | package com.bamtech.shadow.gson.internal.bind;
import com.bamtech.shadow.gson.C2131g;
import com.bamtech.shadow.gson.C2233j;
import com.bamtech.shadow.gson.C2235l;
import com.bamtech.shadow.gson.JsonElement;
import com.bamtech.shadow.gson.JsonObject;
import com.bamtech.shadow.gson.p051s.C2252c;
import java.io.IOException;
import java.io.Writer;
import java.util.ArrayList;
import java.util.List;
/* renamed from: com.bamtech.shadow.gson.internal.bind.b */
/* compiled from: JsonTreeWriter */
public final class C2194b extends C2252c {
/* renamed from: h0 */
private static final Writer f6283h0 = new C2195a();
/* renamed from: i0 */
private static final C2235l f6284i0 = new C2235l("closed");
/* renamed from: e0 */
private final List<JsonElement> f6285e0 = new ArrayList();
/* renamed from: f0 */
private String f6286f0;
/* renamed from: g0 */
private JsonElement f6287g0 = C2233j.f6335a;
/* renamed from: com.bamtech.shadow.gson.internal.bind.b$a */
/* compiled from: JsonTreeWriter */
static class C2195a extends Writer {
C2195a() {
}
public void close() throws IOException {
throw new AssertionError();
}
public void flush() throws IOException {
throw new AssertionError();
}
public void write(char[] cArr, int i, int i2) {
throw new AssertionError();
}
}
public C2194b() {
super(f6283h0);
}
/* renamed from: a */
private void m8516a(JsonElement jsonElement) {
if (this.f6286f0 != null) {
if (!jsonElement.mo11076g() || mo11292e()) {
((JsonObject) peek()).mo11081a(this.f6286f0, jsonElement);
}
this.f6286f0 = null;
} else if (this.f6285e0.isEmpty()) {
this.f6287g0 = jsonElement;
} else {
JsonElement peek = peek();
if (peek instanceof C2131g) {
((C2131g) peek).mo11094a(jsonElement);
return;
}
throw new IllegalStateException();
}
}
private JsonElement peek() {
List<JsonElement> list = this.f6285e0;
return (JsonElement) list.get(list.size() - 1);
}
/* renamed from: b */
public C2252c mo11185b() throws IOException {
JsonObject jsonObject = new JsonObject();
m8516a((JsonElement) jsonObject);
this.f6285e0.add(jsonObject);
return this;
}
/* renamed from: c */
public C2252c mo11186c() throws IOException {
if (this.f6285e0.isEmpty() || this.f6286f0 != null) {
throw new IllegalStateException();
} else if (peek() instanceof C2131g) {
List<JsonElement> list = this.f6285e0;
list.remove(list.size() - 1);
return this;
} else {
throw new IllegalStateException();
}
}
public void close() throws IOException {
if (this.f6285e0.isEmpty()) {
this.f6285e0.add(f6284i0);
return;
}
throw new IOException("Incomplete document");
}
/* renamed from: d */
public C2252c mo11188d() throws IOException {
if (this.f6285e0.isEmpty() || this.f6286f0 != null) {
throw new IllegalStateException();
} else if (peek() instanceof JsonObject) {
List<JsonElement> list = this.f6285e0;
list.remove(list.size() - 1);
return this;
} else {
throw new IllegalStateException();
}
}
/* renamed from: e */
public C2252c mo11190e(String str) throws IOException {
if (this.f6285e0.isEmpty() || this.f6286f0 != null) {
throw new IllegalStateException();
} else if (peek() instanceof JsonObject) {
this.f6286f0 = str;
return this;
} else {
throw new IllegalStateException();
}
}
public void flush() throws IOException {
}
/* renamed from: g */
public C2252c mo11192g(String str) throws IOException {
if (str == null) {
mo11193h();
return this;
}
m8516a((JsonElement) new C2235l(str));
return this;
}
/* renamed from: h */
public C2252c mo11193h() throws IOException {
m8516a((JsonElement) C2233j.f6335a);
return this;
}
/* renamed from: i */
public JsonElement mo11194i() {
if (this.f6285e0.isEmpty()) {
return this.f6287g0;
}
StringBuilder sb = new StringBuilder();
sb.append("Expected one JSON element but was ");
sb.append(this.f6285e0);
throw new IllegalStateException(sb.toString());
}
/* renamed from: d */
public C2252c mo11189d(boolean z) throws IOException {
m8516a((JsonElement) new C2235l(Boolean.valueOf(z)));
return this;
}
/* renamed from: a */
public C2252c mo11181a() throws IOException {
C2131g gVar = new C2131g();
m8516a((JsonElement) gVar);
this.f6285e0.add(gVar);
return this;
}
/* renamed from: a */
public C2252c mo11183a(Boolean bool) throws IOException {
if (bool == null) {
mo11193h();
return this;
}
m8516a((JsonElement) new C2235l(bool));
return this;
}
/* renamed from: a */
public C2252c mo11182a(long j) throws IOException {
m8516a((JsonElement) new C2235l((Number) Long.valueOf(j)));
return this;
}
/* renamed from: a */
public C2252c mo11184a(Number number) throws IOException {
if (number == null) {
mo11193h();
return this;
}
if (!mo11295g()) {
double doubleValue = number.doubleValue();
if (Double.isNaN(doubleValue) || Double.isInfinite(doubleValue)) {
StringBuilder sb = new StringBuilder();
sb.append("JSON forbids NaN and infinities: ");
sb.append(number);
throw new IllegalArgumentException(sb.toString());
}
}
m8516a((JsonElement) new C2235l(number));
return this;
}
}
| [
"101110@vivaldi.net"
] | 101110@vivaldi.net |
0e461fb9e20be457aa3ceccdc215fc06e6b353f1 | 5786b8c28f069ae9b9b7f850edf4d4c1b5cf976c | /languages/CSharp/source_gen/CSharp/editor/All_member_modifier_15_Editor.java | 74d5776e8ea4c339e7e74abc20fbe24021ad997c | [
"Apache-2.0"
] | permissive | vaclav/MPS_CSharp | 681ea277dae2e7503cd0f2d21cb3bb7084f6dffc | deea11bfe3711dd241d9ca3f007b810d574bae76 | refs/heads/master | 2021-01-13T14:36:41.949662 | 2019-12-03T15:26:21 | 2019-12-03T15:26:21 | 72,849,927 | 19 | 5 | null | null | null | null | UTF-8 | Java | false | false | 1,258 | java | package CSharp.editor;
/*Generated by MPS */
import jetbrains.mps.nodeEditor.DefaultNodeEditor;
import jetbrains.mps.openapi.editor.cells.EditorCell;
import jetbrains.mps.openapi.editor.EditorContext;
import org.jetbrains.mps.openapi.model.SNode;
import jetbrains.mps.nodeEditor.cells.EditorCell_Collection;
import jetbrains.mps.nodeEditor.cells.EditorCell_Constant;
public class All_member_modifier_15_Editor extends DefaultNodeEditor {
public EditorCell createEditorCell(EditorContext editorContext, SNode node) {
return this.createCollection_mmhfgz_a(editorContext, node);
}
private EditorCell createCollection_mmhfgz_a(EditorContext editorContext, SNode node) {
EditorCell_Collection editorCell = EditorCell_Collection.createIndent2(editorContext, node);
editorCell.setCellId("Collection_mmhfgz_a");
editorCell.setBig(true);
editorCell.addEditorCell(this.createConstant_mmhfgz_a0(editorContext, node));
return editorCell;
}
private EditorCell createConstant_mmhfgz_a0(EditorContext editorContext, SNode node) {
EditorCell_Constant editorCell = new EditorCell_Constant(editorContext, node, "partial");
editorCell.setCellId("Constant_mmhfgz_a0");
editorCell.setDefaultText("");
return editorCell;
}
}
| [
"vaclav.pech@gmail.com"
] | vaclav.pech@gmail.com |
54196a47234577191822f74174ff0bdc4395b85a | 2c323d32e20dad051fb11ee5d465e16ca643ea25 | /aliyun-java-sdk-dnsknocker/src/main/java/com/aliyuncs/dnsknocker/model/v20190910/DeleteDomainResponse.java | 49c111bcc36dc1a40db1ee2a6d8a21241c31d8cb | [
"Apache-2.0"
] | permissive | liumihust/aliyun-openapi-java-sdk | ee71255642d6b68fd40d316213d923fea2d0109c | 2609e81d064ac86516fc4742a012e5f907985821 | refs/heads/master | 2020-09-25T13:42:56.267005 | 2019-12-05T04:05:58 | 2019-12-05T04:05:58 | 195,759,197 | 0 | 0 | NOASSERTION | 2019-07-08T09:56:44 | 2019-07-08T07:29:35 | Java | UTF-8 | Java | false | false | 2,068 | java | /*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.aliyuncs.dnsknocker.model.v20190910;
import com.aliyuncs.AcsResponse;
import com.aliyuncs.dnsknocker.transform.v20190910.DeleteDomainResponseUnmarshaller;
import com.aliyuncs.transform.UnmarshallerContext;
/**
* @author auto create
* @version
*/
public class DeleteDomainResponse extends AcsResponse {
private String resultCode;
private String resultMessage;
private Boolean success;
private String transactionId;
private String requestId;
public String getResultCode() {
return this.resultCode;
}
public void setResultCode(String resultCode) {
this.resultCode = resultCode;
}
public String getResultMessage() {
return this.resultMessage;
}
public void setResultMessage(String resultMessage) {
this.resultMessage = resultMessage;
}
public Boolean getSuccess() {
return this.success;
}
public void setSuccess(Boolean success) {
this.success = success;
}
public String getTransactionId() {
return this.transactionId;
}
public void setTransactionId(String transactionId) {
this.transactionId = transactionId;
}
public String getRequestId() {
return this.requestId;
}
public void setRequestId(String requestId) {
this.requestId = requestId;
}
@Override
public DeleteDomainResponse getInstance(UnmarshallerContext context) {
return DeleteDomainResponseUnmarshaller.unmarshall(this, context);
}
@Override
public boolean checkShowJsonItemName() {
return false;
}
}
| [
"sdk-team@alibabacloud.com"
] | sdk-team@alibabacloud.com |
6a491407d9d2b111ca03ac6d21e18bac3c52baa3 | 35b73f8d584ddef1f4854d795e0030829d226166 | /swm/swm-services/src/main/java/org/egov/swm/web/contract/IdResponse.java | ccc78cd705d0819326ff5e75d1b83dae6fb33caa | [] | no_license | kiranmai-tarento/test | d8920e0c4e218d2b1747915bac50e331ec6736c6 | 0b54413e44fdd873ce0bc07efad24b6dcec25628 | refs/heads/master | 2021-09-04T08:18:31.937168 | 2018-01-17T07:25:44 | 2018-01-17T07:25:44 | 110,786,458 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 287 | java | package org.egov.swm.web.contract;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
@Getter
@Setter
@ToString
@AllArgsConstructor
@NoArgsConstructor
public class IdResponse {
private String id;
}
| [
"venki@egovernments.org"
] | venki@egovernments.org |
896acd1100b3cf347df859fc4140b07ebd95b804 | c6ed09339ff21fa70f154f34328e869f0dd8e394 | /blog/20110206/spring_data_mongo_repository/src/main/java/fits/sample/MongoRepositorySampleService.java | 0c57416f40a28140f03cf96b1d481dbd52fd015e | [] | no_license | fits/try_samples | f9b15b309a67f7274b505669db4486b17bd1678b | 0986e22d78f35d57fe1dd94673b68a4723cb3177 | refs/heads/master | 2023-08-22T14:35:40.838419 | 2023-08-07T12:25:07 | 2023-08-07T12:25:07 | 642,078 | 30 | 19 | null | 2022-12-28T06:31:24 | 2010-05-02T02:23:55 | Java | UTF-8 | Java | false | false | 677 | java | package fits.sample;
import java.util.List;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
@Service
public class MongoRepositorySampleService implements SampleService {
@Autowired
private DataRepository rep;
//Data を追加する
public void addData(List<Data> list) {
rep.save(list);
}
//指定名の Data を取得する
public List<Data> getData(String name) {
return rep.findByName(name);
}
//指定名を含み、指定ポイントより大きい Data を取得する
public List<Data> findData(String name, int point) {
return rep.findByNameLikeAndPointGreaterThan(name, point);
}
}
| [
"wadays_wozx@nifty.com"
] | wadays_wozx@nifty.com |
42924bc6570ee463b83a1586dea9d8992aaf626a | 2937e29ae02d953807d924d27fd832a11c7ac6ee | /java-basic/src/main/java/ch17/e/QuickSort.java | 3b7905aef0fa162d2eb49795aa34258da903886b | [] | no_license | jeonjinwook/bitcamp-java-2018-12 | ebbcc5732bd42fa3547b74d6591e415aac4c63de | d6bd2e2721bb18ce7be7bdc24f30cdd6f0073dfc | refs/heads/master | 2021-08-06T18:46:42.587398 | 2019-10-23T14:00:25 | 2019-10-23T14:00:25 | 163,650,666 | 0 | 0 | null | 2020-04-30T12:44:13 | 2018-12-31T08:00:39 | Java | UTF-8 | Java | false | false | 1,177 | java | package ch17.e;
public class QuickSort extends Sorter {
@Override
public void sort(int[] values) {
start(values, 0, values.length - 1);
}
private int partition(int[] arr, int low, int high)
{
int pivot = arr[high];
int i = (low-1); // index of smaller element
for (int j=low; j<high; j++)
{
// If current element is smaller than or
// equal to pivot
if (arr[j] <= pivot)
{
i++;
// swap arr[i] and arr[j]
int temp = arr[i];
arr[i] = arr[j];
arr[j] = temp;
}
}
// swap arr[i+1] and arr[high] (or pivot)
int temp = arr[i+1];
arr[i+1] = arr[high];
arr[high] = temp;
return i+1;
}
private void start(int[] arr, int low, int high) {
if (low < high)
{
/* pi is partitioning index, arr[pi] is
now at right place */
int pi = partition(arr, low, high);
// Recursively sort elements before
// partition and after partition
start(arr, low, pi-1);
start(arr, pi+1, high);
}
}
}
| [
"sambosoft@naver.com"
] | sambosoft@naver.com |
560374f50a09cbdb3a5c5e8ef7dff525d246cb62 | 15f8390b55d3bfc4e9551857f90705b37f0d74a9 | /management/src/main/java/org/ehcache/management/providers/CacheBindingManagementProvider.java | 08f71cf1358e884da29f82225c5cd6640809803f | [
"Apache-2.0"
] | permissive | hotbain/ehcache3 | aad0e98020e444052cc35ef39a3e826c821e481f | db6c1207ccf1bc450b031e1aed1bc9749ea3590e | refs/heads/master | 2021-01-10T22:15:31.537983 | 2016-10-07T13:04:36 | 2016-10-07T13:04:36 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,743 | java | /*
* Copyright Terracotta, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.ehcache.management.providers;
import org.ehcache.management.ManagementRegistryServiceConfiguration;
import org.terracotta.management.model.capabilities.descriptors.Descriptor;
import org.terracotta.management.registry.AbstractManagementProvider;
import org.terracotta.management.registry.action.ExposedObject;
import java.util.Collection;
import java.util.LinkedHashSet;
public abstract class CacheBindingManagementProvider extends AbstractManagementProvider<CacheBinding> {
protected final ManagementRegistryServiceConfiguration registryConfiguration;
public CacheBindingManagementProvider(ManagementRegistryServiceConfiguration registryConfiguration) {
super(CacheBinding.class);
this.registryConfiguration = registryConfiguration;
}
@Override
protected abstract ExposedCacheBinding wrap(CacheBinding managedObject);
@Override
public Collection<Descriptor> getDescriptors() {
Collection<Descriptor> capabilities = new LinkedHashSet<Descriptor>();
for (ExposedObject o : managedObjects) {
capabilities.addAll(((ExposedCacheBinding) o).getDescriptors());
}
return capabilities;
}
}
| [
"mathieu.carbou@gmail.com"
] | mathieu.carbou@gmail.com |
cd8bce59119f88cf0de28088d2cf02da0511a660 | 514355bb8a1bb1e4cc9091a2e2d63326bafe0ba4 | /sellergoods-service/src/main/java/com/jx/sellergoods/service/impl/TypeTemplateServiceImpl.java | 723ca8ecf3ffd49b6923e5590bca73bc6f62e18e | [] | no_license | XIAOguojia/jx | 1b002914bba082684250b88abb6f5a9ec10a2843 | 6b8b9dfbb70dc01cf9a4e201a36297fea3528295 | refs/heads/master | 2020-04-14T15:42:26.875893 | 2019-05-13T10:36:55 | 2019-05-13T10:36:55 | 163,935,299 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,366 | java | package com.jx.sellergoods.service.impl;
import java.util.List;
import java.util.Map;
import com.alibaba.fastjson.JSON;
import com.jx.mapper.TbSpecificationOptionMapper;
import com.jx.pojo.*;
import org.springframework.beans.factory.annotation.Autowired;
import com.alibaba.dubbo.config.annotation.Service;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.jx.mapper.TbTypeTemplateMapper;
import com.jx.sellergoods.service.TypeTemplateService;
import entity.PageResult;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.transaction.annotation.Transactional;
/**
* 服务实现层
*
* @author Administrator
*/
@Service
@Transactional(rollbackFor = Exception.class)
public class TypeTemplateServiceImpl implements TypeTemplateService {
@Autowired
private TbTypeTemplateMapper typeTemplateMapper;
/**
* 查询全部
*/
@Override
public List<TbTypeTemplate> findAll() {
return typeTemplateMapper.selectByExample(null);
}
/**
* 按分页查询
*/
@Override
public PageResult findPage(int pageNum, int pageSize) {
PageHelper.startPage(pageNum, pageSize);
Page<TbTypeTemplate> page = (Page<TbTypeTemplate>) typeTemplateMapper.selectByExample(null);
return new PageResult(page.getTotal(), page.getResult());
}
/**
* 增加
*/
@Override
public void add(TbTypeTemplate typeTemplate) {
typeTemplateMapper.insert(typeTemplate);
}
/**
* 修改
*/
@Override
public void update(TbTypeTemplate typeTemplate) {
typeTemplateMapper.updateByPrimaryKey(typeTemplate);
}
/**
* 根据ID获取实体
*
* @param id
* @return
*/
@Override
public TbTypeTemplate findOne(Long id) {
return typeTemplateMapper.selectByPrimaryKey(id);
}
/**
* 批量删除
*/
@Override
public void delete(Long[] ids) {
for (Long id : ids) {
typeTemplateMapper.deleteByPrimaryKey(id);
}
}
@Autowired
private RedisTemplate redisTemplate;
@Override
public PageResult findPage(TbTypeTemplate typeTemplate, int pageNum, int pageSize) {
PageHelper.startPage(pageNum, pageSize);
TbTypeTemplateExample example = new TbTypeTemplateExample();
TbTypeTemplateExample.Criteria criteria = example.createCriteria();
if (typeTemplate != null) {
if (typeTemplate.getName() != null && typeTemplate.getName().length() > 0) {
criteria.andNameLike("%" + typeTemplate.getName() + "%");
}
if (typeTemplate.getSpecIds() != null && typeTemplate.getSpecIds().length() > 0) {
criteria.andSpecIdsLike("%" + typeTemplate.getSpecIds() + "%");
}
if (typeTemplate.getBrandIds() != null && typeTemplate.getBrandIds().length() > 0) {
criteria.andBrandIdsLike("%" + typeTemplate.getBrandIds() + "%");
}
if (typeTemplate.getCustomAttributeItems() != null && typeTemplate.getCustomAttributeItems().length() > 0) {
criteria.andCustomAttributeItemsLike("%" + typeTemplate.getCustomAttributeItems() + "%");
}
}
Page<TbTypeTemplate> page = (Page<TbTypeTemplate>) typeTemplateMapper.selectByExample(example);
//存入数据到缓存
saveToRedis();
return new PageResult(page.getTotal(), page.getResult());
}
/**
* 将品牌和规格列表进行缓存
*/
private void saveToRedis() {
List<TbTypeTemplate> templates = findAll();
for (TbTypeTemplate typeTemplate : templates) {
//存储品牌列表
List<Map> brandList = JSON.parseArray(typeTemplate.getBrandIds(), Map.class);
redisTemplate.boundHashOps("brandList").put(typeTemplate.getId(), brandList);
//存储规格列表
//根据模板ID查询规格列表
List<Map> specList = findSpecList(typeTemplate.getId());
redisTemplate.boundHashOps("specList").put(typeTemplate.getId(), specList);
}
System.out.println("更新缓存:商品品牌和规格表");
}
/**
* 列表数据
*
* @return
*/
@Override
public List<Map> selectOptionList() {
return typeTemplateMapper.selectOptionList();
}
@Autowired
private TbSpecificationOptionMapper specificationOptionMapper;
/**
* 返回规格列表
*
* @param id 模板id
* @return
*/
@Override
public List<Map> findSpecList(Long id) {
//查询模板
TbTypeTemplate tbTypeTemplate = typeTemplateMapper.selectByPrimaryKey(id);
List<Map> list = JSON.parseArray(tbTypeTemplate.getSpecIds(), Map.class);
for (Map map : list) {
//查询规格选项列表
TbSpecificationOptionExample example = new TbSpecificationOptionExample();
TbSpecificationOptionExample.Criteria criteria = example.createCriteria();
criteria.andSpecIdEqualTo(new Long((Integer) map.get("id")));
List<TbSpecificationOption> options = specificationOptionMapper.selectByExample(example);
map.put("options", options);
}
return list;
}
}
| [
"gjnerevmoresf@gmail.com"
] | gjnerevmoresf@gmail.com |
ad78c2e5f6574b585bad08426f6f28c17cdeba6b | c2e54a5daba36f667ef92272a859f6e910135d98 | /src/main/java/zk/lock/WriteLock.java | f096b73e374ff9c2d4aa796e06f16cef397335e5 | [] | no_license | redburning/zk-learn | 4977483abfc1f41c8ed8d94dfad272c333a1a55a | bc42a93bb3c47fe9330b2b5916df4f6c84479fa0 | refs/heads/master | 2023-01-24T08:17:43.872173 | 2020-12-06T07:55:09 | 2020-12-06T07:55:09 | 318,813,399 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,938 | java | package zk.lock;
import java.util.List;
import java.util.SortedSet;
import java.util.TreeSet;
import static org.apache.zookeeper.CreateMode.EPHEMERAL_SEQUENTIAL;
//import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import org.apache.zookeeper.KeeperException;
import org.apache.zookeeper.WatchedEvent;
import org.apache.zookeeper.Watcher;
import org.apache.zookeeper.ZooKeeper;
import org.apache.zookeeper.data.ACL;
import org.apache.zookeeper.data.Stat;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* A <a href="package.html">protocol to implement an exclusive write lock or to
* elect a leader</a>.
*
* <p>
* You invoke {@link #lock()} to start the process of grabbing the lock; you may
* get the lock then or it may be some time later.
*
* <p>
* You can register a listener so that you are invoked when you get the lock;
* otherwise you can ask if you have the lock by calling {@link #isOwner()}.
*
*/
public class WriteLock extends ProtocolSupport {
private static final Logger LOG = LoggerFactory.getLogger(WriteLock.class);
private final String dir;
private String id;
private ZNodeName idName;
private String ownerId;
private String lastChildId;
private byte[] data = { 0x12, 0x34 };
private LockListener callback;
private LockZooKeeperOperation zop;
/**
* zookeeper contructor for writelock.
*
* @param zookeeper zookeeper client instance
* @param dir the parent path you want to use for locking
* @param acl the acls that you want to use for all the paths, if null
* world read/write is used.
*/
public WriteLock(ZooKeeper zookeeper, String dir, List<ACL> acl) {
super(zookeeper);
this.dir = dir;
if (acl != null) {
setAcl(acl);
}
this.zop = new LockZooKeeperOperation();
}
/**
* zookeeper contructor for writelock with callback.
*
* @param zookeeper the zookeeper client instance
* @param dir the parent path you want to use for locking
* @param acl the acls that you want to use for all the paths
* @param callback the call back instance
*/
public WriteLock(ZooKeeper zookeeper, String dir, List<ACL> acl, LockListener callback) {
this(zookeeper, dir, acl);
this.callback = callback;
}
/**
* return the current locklistener.
*
* @return the locklistener
*/
public synchronized LockListener getLockListener() {
return this.callback;
}
/**
* register a different call back listener.
*
* @param callback the call back instance
*/
public synchronized void setLockListener(LockListener callback) {
this.callback = callback;
}
/**
* Attempts to acquire the exclusive write lock returning whether or not it was
* acquired. Note that the exclusive lock may be acquired some time later after
* this method has been invoked due to the current lock owner going away.
*/
public synchronized boolean lock() throws KeeperException, InterruptedException {
if (isClosed()) {
return false;
}
ensurePathExists(dir);
return (Boolean) retryOperation(zop);
}
/**
* Removes the lock or associated znode if you no longer require the lock. this
* also removes your request in the queue for locking in case you do not already
* hold the lock.
*
* @throws RuntimeException throws a runtime exception if it cannot connect to
* zookeeper.
*/
public synchronized void unlock() throws RuntimeException {
if (!isClosed() && id != null) {
// we don't need to retry this operation in the case of failure
// as ZK will remove ephemeral files and we don't wanna hang
// this process when closing if we cannot reconnect to ZK
try {
ZooKeeperOperation zopdel = () -> {
zookeeper.delete(id, -1);
return Boolean.TRUE;
};
zopdel.execute();
} catch (InterruptedException e) {
LOG.warn("Unexpected exception", e);
// set that we have been interrupted.
Thread.currentThread().interrupt();
} catch (KeeperException.NoNodeException e) {
// do nothing
} catch (KeeperException e) {
LOG.warn("Unexpected exception", e);
throw new RuntimeException(e.getMessage(), e);
} finally {
LockListener lockListener = getLockListener();
if (lockListener != null) {
lockListener.lockReleased();
}
id = null;
}
}
}
/**
* the watcher called on getting watch while watching my predecessor.
*/
private class LockWatcher implements Watcher {
@Override
public void process(WatchedEvent event) {
// lets either become the leader or watch the new/updated node
LOG.debug("Watcher fired: {}", event);
try {
lock();
} catch (Exception e) {
LOG.warn("Failed to acquire lock", e);
}
}
}
/**
* a zookeeper operation that is mainly responsible for all the magic required
* for locking.
*/
private class LockZooKeeperOperation implements ZooKeeperOperation {
/**
* find if we have been created earlier if not create our node.
*
* @param prefix the prefix node
* @param zookeeper the zookeeper client
* @param dir the dir path
* @throws KeeperException
* @throws InterruptedException
*/
private void findPrefixInChildren(String prefix, ZooKeeper zookeeper, String dir)
throws KeeperException, InterruptedException {
List<String> names = zookeeper.getChildren(dir, false);
for (String name : names) {
if (name.startsWith(prefix)) {
id = name;
LOG.debug("Found id created last time: {}", id);
break;
}
}
if (id == null) {
id = zookeeper.create(dir + "/" + prefix, data, getAcl(), EPHEMERAL_SEQUENTIAL);
LOG.debug("Created id: {}", id);
}
}
/**
* the command that is run and retried for actually obtaining the lock.
*
* @return if the command was successful or not
*/
@Override
public boolean execute() throws KeeperException, InterruptedException {
do {
if (id == null) {
long sessionId = zookeeper.getSessionId();
String prefix = "x-" + sessionId + "-";
// lets try look up the current ID if we failed
// in the middle of creating the znode
findPrefixInChildren(prefix, zookeeper, dir);
idName = new ZNodeName(id);
}
List<String> names = zookeeper.getChildren(dir, false);
if (names.isEmpty()) {
LOG.warn("No children in: {} when we've just created one! Lets recreate it...", dir);
// lets force the recreation of the id
id = null;
} else {
// lets sort them explicitly (though they do seem to come back in order ususally
// :)
SortedSet<ZNodeName> sortedNames = new TreeSet<>();
for (String name : names) {
sortedNames.add(new ZNodeName(dir + "/" + name));
}
ownerId = sortedNames.first().getName();
SortedSet<ZNodeName> lessThanMe = sortedNames.headSet(idName);
if (!lessThanMe.isEmpty()) {
ZNodeName lastChildName = lessThanMe.last();
lastChildId = lastChildName.getName();
LOG.debug("Watching less than me node: {}", lastChildId);
Stat stat = zookeeper.exists(lastChildId, new LockWatcher());
if (stat != null) {
return Boolean.FALSE;
} else {
LOG.warn("Could not find the stats for less than me: {}", lastChildName.getName());
}
} else {
if (isOwner()) {
LockListener lockListener = getLockListener();
if (lockListener != null) {
lockListener.lockAcquired();
}
return Boolean.TRUE;
}
}
}
} while (id == null);
return Boolean.FALSE;
}
}
/**
* return the parent dir for lock.
*
* @return the parent dir used for locks.
*/
public String getDir() {
return dir;
}
/**
* Returns true if this node is the owner of the lock (or the leader).
*/
public boolean isOwner() {
return id != null && id.equals(ownerId);
}
/**
* return the id for this lock.
*
* @return the id for this lock
*/
public String getId() {
return this.id;
}
} | [
"e"
] | e |
2d2f8529fdc752b54dcc5dda80ab615fa827cb80 | b218169eb27975819fe771b226430ac0759af53c | /src/com/ignite/mm/ticketing/callcenter/ThreeDaySalesActivity.java | 73a62fca633cb26269809f56de10d604d607d393 | [] | no_license | ignitemyanmar/starticketandroid | 23b40ba44040d1ea6bf238f980fc6261a3c666fa | 69c8e2ed3172f9d08489bf68cc998ffcafb2d5f9 | refs/heads/master | 2021-06-12T18:39:09.390898 | 2017-02-27T10:32:05 | 2017-02-27T10:32:05 | 37,309,842 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,792 | java | package com.ignite.mm.ticketing.callcenter;
import java.util.List;
import retrofit.Callback;
import retrofit.RetrofitError;
import retrofit.client.Response;
import android.app.ProgressDialog;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageButton;
import android.widget.ListView;
import android.widget.TextView;
import com.actionbarsherlock.app.ActionBar;
import com.google.gson.reflect.TypeToken;
import com.ignite.mm.ticketing.application.BaseSherlockActivity;
import com.ignite.mm.ticketing.application.DecompressGZIP;
import com.ignite.mm.ticketing.callcenter.R;
import com.ignite.mm.ticketing.clientapi.NetworkEngine;
import com.ignite.mm.ticketing.custom.listview.adapter.BusOperatorGridAdapter;
import com.ignite.mm.ticketing.custom.listview.adapter.ThreeDaySalesLvAdapter;
import com.ignite.mm.ticketing.sqlite.database.model.Operator;
import com.ignite.mm.ticketing.sqlite.database.model.ThreeDaySale;
import com.smk.skconnectiondetector.SKConnectionDetector;
public class ThreeDaySalesActivity extends BaseSherlockActivity{
private String intents = "";
private ActionBar actionBar;
private TextView actionBarTitle;
private TextView actionBarTitle2;
private ImageButton actionBarBack;
private ListView lv_threeday_sales;
private ProgressDialog dialog;
private List<ThreeDaySale> lst_threeday_sale;
private SKConnectionDetector skDetector;
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_threeday_sales);
actionBar = getSupportActionBar();
actionBar.setCustomView(R.layout.action_bar);
actionBarTitle = (TextView) actionBar.getCustomView().findViewById(
R.id.action_bar_title);
//actionBarTitle.setTextSize(TypedValue.COMPLEX_UNIT_SP, 14);
actionBarTitle2 = (TextView) actionBar.getCustomView().findViewById(
R.id.action_bar_title2);
actionBarTitle2.setVisibility(View.GONE);
//actionBarTitle2.setTextSize(TypedValue.COMPLEX_UNIT_SP, 14);
actionBarBack = (ImageButton) actionBar.getCustomView().findViewById(
R.id.action_bar_back);
actionBarBack.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
// TODO Auto-generated method stub
finish();
}
});
actionBarTitle.setText("3 Days Sales");
actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);
lv_threeday_sales = (ListView)findViewById(R.id.lst_threeday_sales);
skDetector = SKConnectionDetector.getInstance(this);
skDetector.setMessageStyle(SKConnectionDetector.VERTICAL_TOASH);
if(skDetector.isConnectingToInternet()){
getThreeDaySales();
}else{
skDetector.showErrorMessage();
}
}
/**
* Get Sales Reports for 3 days
*/
private void getThreeDaySales() {
// TODO Auto-generated method stub
dialog = ProgressDialog.show(ThreeDaySalesActivity.this, "", "Please wait ...", true);
dialog.setCancelable(true);
Log.i("", "Access Token: "+AppLoginUser.getAccessToken()+"Code No: "+AppLoginUser.getCodeNo());
NetworkEngine.setIP("starticketmyanmar.com");
NetworkEngine.getInstance().getThreeDaySales(AppLoginUser.getAccessToken(), AppLoginUser.getCodeNo(),
new Callback<List<ThreeDaySale>>() {
public void failure(RetrofitError arg0) {
// TODO Auto-generated method stub
if (arg0.getResponse() != null) {
Log.e("",
"Item Request Error : Response Code = "
+ arg0.getResponse()
.getStatus());
Log.e("", "Error URL: "+arg0.getUrl());
showAlert("Something's Wrong in Server!");
}
dialog.dismiss();
}
public void success(List<ThreeDaySale> arg0, Response arg1) {
// TODO Auto-generated method stub
Log.i("", "Success Three Day sales");
if (arg0 != null) {
Log.i("", "not null "+arg0.toString());
//lst_threeday_sale = DecompressGZIP.fromBody(arg0.getBody(), new TypeToken<List<ThreeDaySale>>(){}.getType());
lst_threeday_sale = arg0;
if (lst_threeday_sale != null && lst_threeday_sale.size() > 0) {
Log.i("", "Three Day Sale List: "+lst_threeday_sale.toString());
for (int i = 0; i < lst_threeday_sale.size(); i++) {
ThreeDaySale sale = (ThreeDaySale)lst_threeday_sale.get(i);
sale.setDepartureDate(changeDate(lst_threeday_sale.get(i).getDepartureDate()));
}
lv_threeday_sales.setAdapter(new ThreeDaySalesLvAdapter(ThreeDaySalesActivity.this, lst_threeday_sale));
lv_threeday_sales.setDividerHeight(0);
}else {
showAlert("No Sale during 3 days!");
}
}else {
showAlert("No Sale during 3 days!");
}
dialog.dismiss();
}
});
}
}
| [
"suwaiphyo1985@gmail.com"
] | suwaiphyo1985@gmail.com |
2567b5e0b376b2f3a6d0b5594c9d88fd30ff71ae | 781f1608d6c2381f9b5eeecfbcb2e2e6e9702fee | /intermediate-package/writing-integ-tests-for-spring-web-apps/normal-controllers/spring/src/integration-test/java/com/testwithspring/intermediate/task/FindAllTasksWhenTwoTasksAreFoundTest.java | a21fb043557297c862ce5d1094cad77a2479fa9e | [
"Apache-2.0"
] | permissive | pkainulainen/test-with-spring | 30033cbd4e50c6cdb0802d617d148d64777d0717 | 34ff510322734bb1c2ac13b732591a2bc88644d0 | refs/heads/master | 2022-12-07T04:16:28.523592 | 2021-01-13T17:29:27 | 2021-01-13T17:29:27 | 56,919,961 | 63 | 79 | NOASSERTION | 2022-11-24T07:39:04 | 2016-04-23T13:14:17 | Java | UTF-8 | Java | false | false | 3,112 | java | package com.testwithspring.intermediate.task;
import com.github.springtestdbunit.DbUnitTestExecutionListener;
import com.github.springtestdbunit.annotation.DatabaseSetup;
import com.github.springtestdbunit.annotation.DbUnitConfiguration;
import com.testwithspring.intermediate.IntegrationTest;
import com.testwithspring.intermediate.IntegrationTestContext;
import com.testwithspring.intermediate.ReplacementDataSetLoader;
import com.testwithspring.intermediate.Tasks;
import com.testwithspring.intermediate.config.Profiles;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.TestExecutionListeners;
import org.springframework.test.context.TestPropertySource;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.support.DependencyInjectionTestExecutionListener;
import org.springframework.test.context.transaction.TransactionalTestExecutionListener;
import org.springframework.test.context.web.ServletTestExecutionListener;
import org.springframework.test.context.web.WebAppConfiguration;
import java.util.List;
import static org.assertj.core.api.Assertions.assertThat;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = {IntegrationTestContext.class})
//@ContextConfiguration(locations = {"classpath:integration-test-context.xml"})
@WebAppConfiguration
@TestExecutionListeners({
DependencyInjectionTestExecutionListener.class,
TransactionalTestExecutionListener.class,
DbUnitTestExecutionListener.class,
ServletTestExecutionListener.class
})
@DatabaseSetup({
"/com/testwithspring/intermediate/users.xml",
"/com/testwithspring/intermediate/tasks.xml"
})
@DbUnitConfiguration(dataSetLoader = ReplacementDataSetLoader.class)
@Category(IntegrationTest.class)
@ActiveProfiles(Profiles.INTEGRATION_TEST)
public class FindAllTasksWhenTwoTasksAreFoundTest {
@Autowired
private TaskRepository repository;
@Test
public void shouldReturnTwoTasks() {
List<TaskListDTO> tasks = repository.findAll();
assertThat(tasks).hasSize(2);
}
@Test
public void shouldReturnCorrectInformationOfFirstTask() {
TaskListDTO first = repository.findAll().get(0);
assertThat(first.getId()).isEqualByComparingTo(Tasks.WriteExampleApp.ID);
assertThat(first.getStatus()).isEqualTo(Tasks.WriteExampleApp.STATUS);
assertThat(first.getTitle()).isEqualTo(Tasks.WriteExampleApp.TITLE);
}
@Test
public void shouldReturnCorrectInformationOfSecondTask() {
TaskListDTO second = repository.findAll().get(1);
assertThat(second.getId()).isEqualByComparingTo(Tasks.WriteLesson.ID);
assertThat(second.getStatus()).isEqualTo(Tasks.WriteLesson.STATUS);
assertThat(second.getTitle()).isEqualTo(Tasks.WriteLesson.TITLE);
}
}
| [
"petri.kainulainen@gmail.com"
] | petri.kainulainen@gmail.com |
9c39668b4cb67bcb26d235b9240f83c18f7d7fd9 | 02219c56cd31319c512f8ad68b1d1742b631a271 | /org.eclipse.skalli.model.core.test/src/main/java/org/eclipse/skalli/model/ext/people/PeopleRestAPITest.java | 1fa8e43722f4183c4e2c7f772bbbeaadb69067f8 | [] | no_license | hannic/skalli | 4d0afd8e35555430b1e138bd9d72880efa93f469 | 2c0ef354437555635949f9f92158936334915f54 | refs/heads/master | 2021-01-20T23:54:09.312768 | 2011-10-26T09:50:55 | 2011-11-04T12:58:59 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,401 | java | /*******************************************************************************
* Copyright (c) 2010, 2011 SAP AG 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:
* SAP AG - initial API and implementation
*******************************************************************************/
package org.eclipse.skalli.model.ext.people;
import java.util.List;
import org.eclipse.skalli.api.java.ProjectService;
import org.eclipse.skalli.model.core.Project;
import org.eclipse.skalli.testutil.ProjectServiceUtils;
import org.eclipse.skalli.testutil.RestUtils;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
@SuppressWarnings("nls")
public class PeopleRestAPITest {
private List<Project> projects;
private ProjectService projectService;
@Before
public void setup() throws Exception {
projectService = ProjectServiceUtils.getProjectService();
projects = projectService.getAll();
Assert.assertTrue("projects.size() > 0", projects.size() > 0);
}
@Test
public void testValidate() throws Exception {
RestUtils.validate(projects, PeopleProjectExt.class, "extension-people.xsd");
}
}
| [
"michael.ochmann@sap.com"
] | michael.ochmann@sap.com |
89dca32b106328db65a341ba32fc098a59e4e713 | 29c5c5d7225abe3ce068d4cc819803747c47b3e7 | /test/regression/src/org/jacorb/test/notification/filter/GarbageCollectTest.java | 492631203b07b9269b2a27497911d31ddfaa6631 | [] | no_license | wolfc/jacorb | 308a770016586ce3e8f902507ba1bde295df78c1 | 40e0ec34c36fdcfe67b67a9ceba729e1d4581899 | refs/heads/master | 2020-05-02T12:50:56.097066 | 2010-05-25T22:23:05 | 2010-05-25T22:23:05 | 686,203 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 5,434 | java | /*
* JacORB - a free Java ORB
*
* Copyright (C) 1999-2004 Gerald Brose
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
*/
package org.jacorb.test.notification.filter;
import java.util.Collections;
import junit.framework.Test;
import org.slf4j.Logger;
import org.easymock.MockControl;
import org.jacorb.config.Configuration;
import org.jacorb.notification.IContainer;
import org.jacorb.notification.conf.Attributes;
import org.jacorb.notification.conf.Default;
import org.jacorb.notification.filter.DefaultFilterFactoryDelegate;
import org.jacorb.notification.filter.FilterFactoryImpl;
import org.jacorb.notification.util.WeakCacheWildcardMap;
import org.jacorb.test.notification.common.NotificationTestCase;
import org.jacorb.test.notification.common.NotificationTestCaseSetup;
import org.omg.CORBA.Any;
import org.omg.CORBA.OBJECT_NOT_EXIST;
import org.omg.CosNotifyFilter.Filter;
import org.omg.CosNotifyFilter.FilterFactory;
import org.omg.CosNotifyFilter.FilterFactoryHelper;
import org.picocontainer.MutablePicoContainer;
/**
* @author Alphonse Bendt
* @version $Id: GarbageCollectTest.java,v 1.7 2009-05-03 21:45:33 andre.spiegel Exp $
*/
public class GarbageCollectTest extends NotificationTestCase
{
private MockControl controlConfiguration_;
private Configuration mockConfiguration_;
private IContainer iContainerForTest_;
public GarbageCollectTest(String name, NotificationTestCaseSetup setup)
{
super(name, setup);
}
protected void setUpTest() throws Exception
{
controlConfiguration_ = MockControl.createControl(Configuration.class);
iContainerForTest_ = new IContainer()
{
public MutablePicoContainer getContainer()
{
return getPicoContainer();
}
public void destroy()
{
// no operation
}
};
mockConfiguration_ = (Configuration) controlConfiguration_.getMock();
// configuration options that setup code depends on.
mockConfiguration_.getAttributeNamesWithPrefix(null);
controlConfiguration_.setMatcher(MockControl.ALWAYS_MATCHER);
controlConfiguration_.setReturnValue(Collections.EMPTY_LIST);
mockConfiguration_.getAttribute(Attributes.WILDCARDMAP_CLASS, WeakCacheWildcardMap.class
.getName());
controlConfiguration_.setReturnValue(WeakCacheWildcardMap.class.getName());
}
public void testGCFilter() throws Exception
{
MockControl loggerControl = MockControl.createNiceControl(Logger.class);
mockConfiguration_.getLogger(null);
controlConfiguration_.setMatcher(MockControl.ALWAYS_MATCHER);
controlConfiguration_.setReturnValue(loggerControl.getMock(), MockControl.ZERO_OR_MORE);
// enable gc
mockConfiguration_.getAttributeAsBoolean(Attributes.USE_GC, Default.DEFAULT_USE_GC);
controlConfiguration_.setReturnValue(true);
// set timeout
mockConfiguration_.getAttributeAsLong(Attributes.DEAD_FILTER_INTERVAL,
Default.DEFAULT_DEAD_FILTER_INTERVAL);
controlConfiguration_.setReturnValue(100);
controlConfiguration_.expectAndReturn(mockConfiguration_.getAttribute(Attributes.RUN_SYSTEM_GC, Default.DEFAULT_RUN_SYSTEM_GC), "off");
controlConfiguration_.expectAndReturn(mockConfiguration_.getAttribute(Attributes.RUN_SYSTEM_GC, Default.DEFAULT_RUN_SYSTEM_GC), "off");
// another picocontainer is necessary so that registered
// Configuration can be overridden locally to configure
// garbage collection.
getPicoContainer().registerComponentInstance(Configuration.class, mockConfiguration_);
controlConfiguration_.replay();
// will use our mocked configuration.
FilterFactoryImpl factoryServant_ = new FilterFactoryImpl(getORB(), getPOA(),
mockConfiguration_, new DefaultFilterFactoryDelegate(iContainerForTest_, mockConfiguration_));
String _factoryRef = getORB().object_to_string(factoryServant_.activate());
FilterFactory _factory = FilterFactoryHelper.narrow(getClientORB().string_to_object(_factoryRef));
Filter _filter = _factory.create_filter("EXTENDED_TCL");
assertFalse(_filter._non_existent());
// wait some time. give gc thread chance to clean up filter.
Thread.sleep(10000);
try
{
Any any = toAny(5);
_filter.match(any);
} catch (OBJECT_NOT_EXIST e)
{
// expected
}
}
public static Test suite() throws Exception
{
return NotificationTestCase.suite(GarbageCollectTest.class);
}
}
| [
"cdewolf@redhat.com"
] | cdewolf@redhat.com |
beca0a2ca7cbf63825e6530e23c7890222e314a1 | 30cf6f107c15305beb14cb6967f10d613065a4a4 | /PatientManagementSystem/src/com/hospital/patient/Record.java | 4c36867d8143fab2cd2310a78cc79c2ed22f270f | [] | no_license | Ramyatalluri/Hospital-Management-System | d68df20fe43ef70470914b97b5c247683559ab3b | bb100fa6e001b96caf8765ba6c7ef366529b499f | refs/heads/master | 2020-03-28T13:05:31.338283 | 2018-09-13T17:11:07 | 2018-09-13T17:11:07 | 148,365,016 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 650 | java | package com.hospital.patient;
import java.text.SimpleDateFormat;
import java.util.Date;
public class Record {
private final Date DATE;
private final Partoftheday PART_OF_THE_DAY;
private final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("dd/MM/yyyy");
public Record(Date date, Partoftheday partoftheday) {
this.DATE = date;
this.PART_OF_THE_DAY = partoftheday;
}
public Record(Partoftheday partoftheday) {
this.DATE = new Date();
this.PART_OF_THE_DAY = partoftheday;
}
public String getRecord() {
String record = DATE_FORMAT.format(DATE) + "|" + PART_OF_THE_DAY;
return record;
}
} | [
"admin@admin-PC"
] | admin@admin-PC |
c8be6f769d1eec68ccf82933299c7774c89ad6e1 | 129f58086770fc74c171e9c1edfd63b4257210f3 | /src/testcases/CWE470_Unsafe_Reflection/CWE470_Unsafe_Reflection__getCookies_Servlet_81_goodG2B.java | bc751d3802814f49da36acde98ac1d13e313d8a3 | [] | no_license | glopezGitHub/Android23 | 1bd0b6a6c7ce3c7439a74f1e4dcef2c4c0fac4ba | 6215d0684c4fbdc7217ccfbedfccfca69824cc5e | refs/heads/master | 2023-03-07T15:14:59.447795 | 2023-02-06T13:59:49 | 2023-02-06T13:59:49 | 6,856,387 | 0 | 3 | null | 2023-02-06T18:38:17 | 2012-11-25T22:04:23 | Java | UTF-8 | Java | false | false | 1,309 | java | /* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE470_Unsafe_Reflection__getCookies_Servlet_81_goodG2B.java
Label Definition File: CWE470_Unsafe_Reflection.label.xml
Template File: sources-sink-81_goodG2B.tmpl.java
*/
/*
* @description
* CWE: 470 Use of Externally-Controlled Input to Select Classes or Code ('Unsafe Reflection')
* BadSource: getCookies_Servlet Read data from the first cookie using getCookies()
* GoodSource: Set data to a hardcoded class name
* Sinks:
* BadSink : Instantiate class named in data
* Flow Variant: 81 Data flow: data passed in a parameter to an abstract method
*
* */
package testcases.CWE470_Unsafe_Reflection;
import testcasesupport.*;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.servlet.http.*;
public class CWE470_Unsafe_Reflection__getCookies_Servlet_81_goodG2B extends CWE470_Unsafe_Reflection__getCookies_Servlet_81_base
{
public void action(String data , HttpServletRequest request, HttpServletResponse response) throws Throwable
{
/* POTENTIAL FLAW: Instantiate object of class named in data (which may be from external input) */
Class<?> c = Class.forName(data);
Object instance = c.newInstance();
IO.writeLine(instance.toString()); /* Use instance in some way */
}
}
| [
"guillermo.pando@gmail.com"
] | guillermo.pando@gmail.com |
c76d09a8fdd4b0f5247167fe2232a409eceeefaf | 8bba923942604359185cfceffc680b006efb9306 | /Spring/a_SpringEssentials/carDealer/src/main/java/com/softuni/carDealer/services/apis/UserService.java | 0068f53e986d5eec9c81958f9fa6af483c8e7893 | [] | no_license | KaPrimov/JavaCoursesSoftUni | d8a48ab30421d7a847f35d970535ddc3da595597 | 9676ec4c9bc1ece13d64880ff47a3728227bf4c9 | refs/heads/master | 2022-12-04T13:27:47.249203 | 2022-07-14T14:44:10 | 2022-07-14T14:44:10 | 97,306,295 | 1 | 2 | null | 2022-11-24T09:28:28 | 2017-07-15T09:39:47 | Java | UTF-8 | Java | false | false | 264 | java |
package com.softuni.carDealer.services.apis;
import com.softuni.carDealer.dtos.binding.add.RegisterUser;
import com.softuni.carDealer.entities.User;
public interface UserService {
User findByUsername(String username);
void saveUser(RegisterUser userDTO);
}
| [
"k.primov92@gmail.com"
] | k.primov92@gmail.com |
e3b788f26dca8d674f173aae7d8260ab41576a31 | 75950d61f2e7517f3fe4c32f0109b203d41466bf | /modules/tags/fabric3-modules-parent-pom-1.7/kernel/impl/fabric3-contribution/src/main/java/org/fabric3/contribution/UnsupportedContentTypeException.java | 0e324a1de636311621443d9963f9005d72fd9160 | [] | no_license | codehaus/fabric3 | 3677d558dca066fb58845db5b0ad73d951acf880 | 491ff9ddaff6cb47cbb4452e4ddbf715314cd340 | refs/heads/master | 2023-07-20T00:34:33.992727 | 2012-10-31T16:32:19 | 2012-10-31T16:32:19 | 36,338,853 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,454 | java | /*
* Fabric3
* Copyright (c) 2009-2011 Metaform Systems
*
* Fabric3 is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of
* the License, or (at your option) any later version, with the
* following exception:
*
* Linking this software statically or dynamically with other
* modules is making a combined work based on this software.
* Thus, the terms and conditions of the GNU General Public
* License cover the whole combination.
*
* As a special exception, the copyright holders of this software
* give you permission to link this software with independent
* modules to produce an executable, regardless of the license
* terms of these independent modules, and to copy and distribute
* the resulting executable under terms of your choice, provided
* that you also meet, for each linked independent module, the
* terms and conditions of the license of that module. An
* independent module is a module which is not derived from or
* based on this software. If you modify this software, you may
* extend this exception to your version of the software, but
* you are not obligated to do so. If you do not wish to do so,
* delete this exception statement from your version.
*
* Fabric3 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the
* GNU General Public License along with Fabric3.
* If not, see <http://www.gnu.org/licenses/>.
*/
package org.fabric3.contribution;
import org.fabric3.host.contribution.InstallException;
/**
* Exception thrown to indicate that a Content-Type is not supported by this SCA Domain. The Content-Type value supplied will be returned as the
* message text for this exception.
*
* @version $Rev$ $Date$
*/
public class UnsupportedContentTypeException extends InstallException {
private static final long serialVersionUID = -1831797280021355672L;
/**
* Constructor specifying the Content-Type value that is not supported and an identifier to use with this exception (typically the resource being
* processed).
*
* @param message the error message
*/
public UnsupportedContentTypeException(String message) {
super(message);
}
}
| [
"jmarino@83866bfc-822f-0410-aa35-bd5043b85eaf"
] | jmarino@83866bfc-822f-0410-aa35-bd5043b85eaf |
e764bf12dcf7425db9a1098b31504bc24cfdae72 | 7b4914bf95af54caa07050e3cf23ebf47b590af9 | /WEB-INF/src/com/bureaueye/beacon/action/standard/ListAddresscontactSearchAction.java | 57e8edd2b669919527ab8db96e44b4e146ae18a9 | [
"Apache-2.0"
] | permissive | avesus/beacon | fd1874799f91c7b84e5244eb9b3e8e243a81c3c8 | d6626f97153acc8c1eb0f0c5d51f5693c9815a06 | refs/heads/master | 2022-01-08T11:52:49.468174 | 2019-07-08T08:02:03 | 2019-07-08T08:02:03 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,755 | java | package com.bureaueye.beacon.action.standard;
import javax.servlet.http.HttpSession;
import org.apache.struts.action.ActionMessages;
import com.bureaueye.beacon.action.PopupListAction;
import com.bureaueye.beacon.exception.ApplicationException;
import com.bureaueye.beacon.form.ListForm;
import com.bureaueye.beacon.model.standard.bd.AddresscontactBD;
public final class ListAddresscontactSearchAction extends PopupListAction {
public void setTotalResults(ListForm listForm) throws ApplicationException {
// Set the default ordering
if (listForm.getOrderBy() == null) {
listForm.setOrderBy("Name");
}
listForm.setOrderByDesc("");
if (listForm.getSearchString1() == null) {
listForm.setSearchString1("");
}
if (listForm.getSearchString2() == null) {
listForm.setSearchString2("");
}
if (listForm.getSearchString3() == null) {
listForm.setSearchString3("1");
}
/**
AddresscontactPK pk = new AddresscontactPK(
listForm.getHeaderInfo1(), // contactkey
listForm.getHeaderInfo2() // addrkey
);
Addresscontact dto = new AddresscontactBD(this.getSessionFactoryClusterMap()).read(pk);
listForm.setStartPage();
if (dto == null) {
} else {
Address addressdto = new AddressBD(this.getSessionFactoryClusterMap()).read(pk.getAddrkey());
String companyName = "";
if (addressdto != null) companyName = addressdto.getName();
log.debug("["+this.getClass().getName()+"] "+new java.util.Date()+" Populating listForm from " + dto.getClass().getName());
listForm.setSearchString1(dto.getName());
listForm.setSearchString2(companyName);
listForm.setSearchString3(dto.getAddress1());
listForm.setSearchString4(dto.getAddress2());
listForm.setSearchString5(dto.getAddress3());
listForm.setSearchString6("");
listForm.setSearchString7(dto.getPostalCode());
listForm.setSearchString8(dto.getCity());
listForm.setSearchString9(dto.getState());
listForm.setSearchString10(dto.getCountry());
listForm.setSearchString11(dto.getPhone());
listForm.setSearchString12(dto.getFax());
listForm.setSearchString13(dto.getEmail());
listForm.setSearchString14(null);
}
**/
}
public void setTotalResults(ListForm listForm, HttpSession session) throws ApplicationException {
}
public ActionMessages setLineItems(ListForm listForm)
throws ApplicationException {
/***THIS WORKS BUT NEED TO PURCHASE A LICENSE FOR com.moyosoft.connector.com.* SOFTWARE
try
{
// Outlook application
Outlook outlookApplication = new Outlook();
// Get the default contacts folder
OutlookFolder folder = outlookApplication.getDefaultFolder(FolderType.CONTACTS);
// Get the folder's items collection
ItemsCollection items = folder.getItems();
// Display info for all contacts in the folder
for(ItemsIterator it = items.iterator(); it.hasNext();)
{
OutlookItem item = it.nextItem();
// Check the item is a contact
if(item != null && item.getType().isContact())
{
OutlookContact contact = (OutlookContact) item;
Addresscontact addresscontactdao = new Addresscontact();
addresscontactdao.setName(contact.getLastName()+", "+contact.getFirstName());
addresscontactdao.setEmail(contact.getEmail1Address());
addresscontactdaos.add(addresscontactdao);
}
}
// Dispose the library
outlookApplication.dispose();
}
catch(ComponentObjectModelException ex)
{
ex.printStackTrace();
}
catch(LibraryNotFoundException ex)
{
// If this error occurs, verify the file 'moyocore.dll' is present
// in java.library.path
ex.printStackTrace();
}
listForm.setLineItems(addresscontactdaos);
**/
/* try {
// To provide hostname and credentials information, use:
Exchange exchange = new Exchange("ITT01", "Administrator", "track$boats");
//Exchange exchange = ExchangeConnectionDialog.display();
if(exchange != null)
{
// Get the default Contacts folder
ExchangeFolder folder = exchange.getContactsFolder();
// Display all the contacts in the folder:
for(ExchangeItem item : folder.getItems())
{
if(item instanceof ExchangeContact)
{
ExchangeContact contact = (ExchangeContact) item;
}
}
}
} catch (ExchangeServiceException ese) {
} catch (Exception e) {
}*/
listForm.setLineItems(new AddresscontactBD(this.getSessionFactoryClusterMap())
.findAddresscontactsSearch(
listForm.getSearchString1(),
listForm.getSearchString2(),
listForm.getSearchString3(),
listForm.getSearchString4(),
listForm.getSearchString5(),
listForm.getSearchString6(),
listForm.getSearchString7(),
listForm.getSearchString8(),
listForm.getSearchString9(),
listForm.getSearchString10(),
listForm.getSearchString11(),
listForm.getSearchString12(),
listForm.getSearchString13(),
listForm.getSearchString14(),
listForm.getGotoPage(),
listForm.getMaxResults(),
listForm.getOrderBy(),
listForm.getHeaderInfo1()));
/* if (listForm.getSearchString3().equals("1")) {
if (!listForm.getSearchString1().equals("")) {
listForm.setLineItems(new AddressBD().findAddresssForContactSearch(listForm));
}
}*/
/* if (listForm.getSearchString3().equals("2")) {
listForm.setLineItems(new MisuserBD().findMisusersForContactSearch(listForm));
}*/
log.debug("["+this.getClass().getName()+"] "+new java.util.Date()+
" ListForm Parameters: "+listForm.toString()
);
return null;
}
} | [
"nicktankard@gmail.com"
] | nicktankard@gmail.com |
ac5b0e400370c158ac74d71f6ed3658f3a043799 | 3f7a5d7c700199625ed2ab3250b939342abee9f1 | /src/gcom/spcserasa/FiltroNegativacaoImoveis.java | 9cf5c61df982a81b9c3c541311be922cea6a0178 | [] | no_license | prodigasistemas/gsan-caema | 490cecbd2a784693de422d3a2033967d8063204d | 87a472e07e608c557e471d555563d71c76a56ec5 | refs/heads/master | 2021-01-01T06:05:09.920120 | 2014-10-08T20:10:40 | 2014-10-08T20:10:40 | 24,958,220 | 1 | 0 | null | null | null | null | ISO-8859-1 | Java | false | false | 4,237 | 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
* Thiago Silva Toscano de Brito
* 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.spcserasa;
import gcom.util.filtro.Filtro;
import java.io.Serializable;
/**
* FiltroNegativador
*
* @author Thiago Toscano
* @date 26/12/2007
*/
public class FiltroNegativacaoImoveis extends Filtro implements Serializable {
private static final long serialVersionUID = 1L;
/**
* Constructor for the FiltroNegativador object
*/
public FiltroNegativacaoImoveis() {
}
/**
* Constructor for the FiltroNegativador object
*
* @param campoOrderBy
* Description of the Parameter
*/
public FiltroNegativacaoImoveis(String campoOrderBy) {
this.campoOrderBy = campoOrderBy;
}
public final static String ID = "id";
public final static String IMOVEL_ID = "imovel.id";
public final static String NEGATIVACAO_COMANDO_ID = "negativacaoComando.id";
public final static String NEGATIVADOR_ID = "negativacaoComando.negativador.id";
public final static String CLIENTE_ID = "negativacaoComando.negativador.cliente.id";
public final static String CLIENTE = "negativacaoComando.negativador.cliente";
public final static String NEGATIVADOR = "negativacaoComando.negativador";
public final static String INDICADOR_EXCLUIDO = "indicadorExcluido";
public final static String ID_CLIENTE = "cliente.id";
} | [
"felipesantos2089@gmail.com"
] | felipesantos2089@gmail.com |
bd9fdb45cf89e2bd41d5e99db8301d459d5d237b | ac252b6f56d913990d98c6c923a239016de242bd | /src/main/java/ivorius/yegamolchattels/blocks/PlanksRefinementEntry.java | 89245d4e91ae7e69a3bfdbea5b30675fd834264b | [] | no_license | Techokami/YeGamolChattels | 3afd35c15ea898e38e6bd5f88802af827638197b | 8f884b5230c935a927e6b4953743750e72477142 | refs/heads/master | 2021-01-16T18:50:10.710083 | 2014-07-28T20:58:32 | 2014-07-28T20:58:32 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 896 | java | package ivorius.yegamolchattels.blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
/**
* Created by lukas on 11.05.14.
*/
public class PlanksRefinementEntry implements IPlanksRefinementEntry
{
public Item source;
public Item tool;
public ItemStack destination;
public PlanksRefinementEntry(Item source, Item tool, ItemStack destination)
{
this.source = source;
this.destination = destination;
this.tool = tool;
}
@Override
public boolean matchesSource(ItemStack source)
{
return source != null && source.getItem() == this.source;
}
@Override
public boolean matchesTool(ItemStack tool)
{
return tool != null && tool.getItem() == this.tool;
}
@Override
public ItemStack getResult()
{
return destination != null ? destination.copy() : null;
}
}
| [
"lukastenbrink@googlemail.com"
] | lukastenbrink@googlemail.com |
062bf42ac1e054aa1eee91f02e78ed6dbad64381 | 120c983b58deeffae762e606d90099883b629b0b | /xml/src/main/java/org/exolab/castor/xml/parsing/primitive/objects/PrimitiveInteger.java | 0b600b0b0bd9aacb46f735dd53755c757ab0a387 | [] | no_license | xsls/castor | 5203200b832fbcba2a1ad54f3ea092cc46553725 | d05aa94fdd307576763ba8d318ce47db270cc251 | refs/heads/master | 2021-05-26T21:10:14.547867 | 2010-09-20T08:55:57 | 2010-09-20T08:55:57 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,177 | java | /*
* Copyright 2005 Philipp Erlacher
*
* 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.exolab.castor.xml.parsing.primitive.objects;
import org.castor.core.util.StringUtil;
/**
* This class is part of the command pattern implementation to instantiate an
* object. It is used as a command by the command invoker {@link PrimitiveObject}.
*
* @author <a href="mailto:philipp DOT erlacher AT gmail DOT com">Philipp
* Erlacher</a>
*
*/
class PrimitiveInteger extends PrimitiveObject {
@Override
public Object getObject() {
if (StringUtil.isEmpty(value)) {
return new Integer(0);
}
return new Integer(value);
};
}
| [
"wguttmn@b24b0d9a-6811-0410-802a-946fa971d308"
] | wguttmn@b24b0d9a-6811-0410-802a-946fa971d308 |
a1dd5341befc5930352a3da939795c6933ca3dd4 | fbfcb88a9bfdc2868077a7035a74c98dc3eb25a0 | /src/combiz/ui/equipment/PremaintList.java | be2a30e07086af2bba46d5ab2a4578fa2ecb0422 | [] | no_license | jackwysxw/combiz | 817af9399251ff286d2a4c1d525953e8f66c8e06 | 9a84f3b4e8866a5030462eafa683bf5d7ad4bf40 | refs/heads/master | 2020-04-25T14:46:23.301900 | 2016-09-26T07:04:16 | 2016-09-26T07:04:16 | null | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 1,016 | java | package combiz.ui.equipment;
import combiz.domain.equipment.Equipment;
import combiz.domain.pm.Premaint;
import combiz.system.ui.ListWindow;
public class PremaintList extends ListWindow
{
///////////////////////////////////方法区////////////////////////////////////////////////
/**
* 构造函数,初始化数据
*
* 作者:ljh 日期:2008-03-10
*/
public PremaintList()
{
super();
}
public boolean addNew()
throws Exception
{
//获取父级主窗体对象
Equipment parent = (Equipment)this.ownerWnd.getMainObject();
Premaint newobj = new Premaint();
newobj.setPmcounter(0L);
newobj.setHaschild("否");
newobj.setAdjnextdue("否");
newobj.setAutowf("否");
newobj.setFrequency(0L);
newobj.setFrequnit("天");
newobj.setUsefrequency("是");
newobj.setEqdown("否");
newobj.setUsejpseq("否");
newobj.setEqnum(parent.getEqnum());
this.mainObject = newobj;
return true;
}
///////////////////////////////////////////////////////////////////
}
| [
"876301469@qq.com"
] | 876301469@qq.com |
a92cc69f25e6f7a8c0f49b32593dbf8a27cdf146 | 2a445110dda2564172e2d38877faa37912c46482 | /src/com/book_share/book_management/service/BookService.java | 1f434df7235408c95dd29ee40efae6dd9edded32 | [] | no_license | chenliguan/BookShareServer | 8abfda3e0175158dcab9ce3d25ad5449c6b10693 | 4d581864ff80c5e93cc580247e2a0480855a8904 | refs/heads/master | 2021-01-10T13:39:58.431105 | 2016-02-06T01:58:06 | 2016-02-06T01:58:06 | 50,969,476 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,472 | java | package com.book_share.book_management.service;
import java.util.ArrayList;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.book_share.book_management.dao.IBookDao;
import com.book_share.book_management.dto.BookDTO;
import com.book_share.book_management.dto.BookQueryConditionDTO;
import com.book_share.book_management.entity.Book;
import com.book_share.book_management.util.CopyProperties;
import com.book_share.core.util.Page;
/**
* @description 图书业务服务层实现
* @author ZhouRuiBang
* @date 2016-1-29 下午1:35:12
* @version 1.0
*/
@Transactional
@Service
public class BookService implements IBookService {
@Autowired
private IBookDao bookDao;
/**
* @description 检索图书信息
* @param queryConditionDTO
* @param start
* @param limit
* @param sort
* @param dir
* @return
*/
public Page<BookDTO> findBookPage(BookQueryConditionDTO queryConditionDTO,
int start, int limit, String sort, String dir) {
List<BookDTO> dtoList = null;
Page<Book> bookPage = bookDao.findBookPageByUser(queryConditionDTO,
start, limit, sort, dir);
if (bookPage != null) {
dtoList = new ArrayList<BookDTO>();
for (Book c : bookPage.getLists()) {
BookDTO dto = new BookDTO();
BookDTO.Entity2Dto(c, dto);
dtoList.add(dto);
}
}
return new Page<BookDTO>(dtoList, bookPage.getTotalCounts(), limit);
}
/**
* @description 新建图书信息(图书上传)
* @param BookDTO
*/
public void createBook(BookDTO bookDTO) {
Book book = new Book();
BookDTO.Dto2Entity(bookDTO, book);
bookDao.save(book);
}
/**
* @description 更新图书信息(修改图书)
* @param BookDTO
*/
public void updateBook(BookDTO bookDTO) {
// User
Book temp = (Book) bookDao.getById(bookDTO.getId());
System.out.println(temp);
// temp 持久化 与数据库同步
if (temp != null) {
// 前端的对象数据覆盖到持久化状态的对象中再更新 bookDTO->temp
// BeanUtils.copyProperties(bookDTO, temp);
CopyProperties.copyPropertiesIgnoreNull(bookDTO, temp);
// 关联关系
bookDao.update(temp);
}
}
/**
* @description 删除图书信息
* @param id
*/
public void removeBook(Long id) {
Book book = bookDao.getById(id);
if(book!=null){
//关联关系维护 O
bookDao.delete(book);
}
}
}
| [
"1130314814@qq.com"
] | 1130314814@qq.com |
c166e5dc17735138470df2dd167a5e091bf6645a | 293e395565a5689af9781f6f87389a87becadfa5 | /thevpc-common-msg/src/main/java/net/thevpc/common/msg/Message.java | 43e0077a38f525ea41c769d77792135b47c2d261 | [] | no_license | thevpc/vpc-common | fa0bcc7a40c7ab426d0871ee4620177717517435 | af29b2340a4beb1d5e6e3f278ec8c99077302144 | refs/heads/master | 2023-06-07T17:00:18.820723 | 2023-05-31T12:54:32 | 2023-05-31T12:54:32 | 71,976,446 | 0 | 0 | null | 2022-01-05T21:28:01 | 2016-10-26T07:14:22 | Java | UTF-8 | Java | false | false | 139 | java | package net.thevpc.common.msg;
import java.util.logging.Level;
public interface Message {
Level getLevel();
String getText();
}
| [
"taha.bensalah@gmail.com"
] | taha.bensalah@gmail.com |
2298ad873a3c6bcfb685dc79810e860733cffb70 | 19f3e4df408f56e7f4fe20c8cdecedbd71d9887e | /36_java/classes-dex2jar/net/youmi/android/c/k/i.java | 329cb471dadba0fd13c6e000c6073fd674877200 | [] | no_license | XuGuangHuiGit/softwareSecurity | 5ed6dfe1316672a061dbe03bf235c452342b296f | 9f1eb53d3e06751fe17dbf43a5d7a5fa95051313 | refs/heads/master | 2020-04-08T01:42:39.467579 | 2018-11-24T05:46:28 | 2018-11-24T05:46:28 | 158,906,469 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,101 | java | package net.youmi.android.c.k;
import android.content.Context;
import android.os.Build.VERSION;
public class i
{
public static boolean a(Context paramContext)
{
try
{
if (Build.VERSION.SDK_INT < 4) {
return true;
}
boolean bool = a(paramContext, "android.permission.WRITE_EXTERNAL_STORAGE");
return bool;
}
catch (Throwable paramContext) {}
return false;
}
public static boolean a(Context paramContext, String paramString)
{
try
{
int i = paramContext.checkCallingOrSelfPermission(paramString);
if (i == -1) {
return false;
}
}
catch (Throwable paramContext) {}
return true;
}
public static boolean b(Context paramContext)
{
return a(paramContext, "android.permission.INTERNET");
}
public static boolean c(Context paramContext)
{
return a(paramContext, "android.permission.READ_PHONE_STATE");
}
public static boolean d(Context paramContext)
{
return a(paramContext, "android.permission.ACCESS_NETWORK_STATE");
}
public static boolean e(Context paramContext)
{
return a(paramContext, "android.permission.ACCESS_FINE_LOCATION");
}
public static boolean f(Context paramContext)
{
return a(paramContext, "android.permission.ACCESS_COARSE_LOCATION");
}
public static boolean g(Context paramContext)
{
return a(paramContext, "android.permission.ACCESS_WIFI_STATE");
}
public static boolean h(Context paramContext)
{
return a(paramContext, "com.android.launcher.permission.INSTALL_SHORTCUT");
}
public static boolean i(Context paramContext)
{
return a(paramContext, "android.permission.SYSTEM_ALERT_WINDOW");
}
public static boolean j(Context paramContext)
{
return a(paramContext, "android.permission.GET_TASKS");
}
}
/* Location: C:\Users\guanghui\Desktop\软件安全\361\classes-dex2jar.jar
* Qualified Name: net.youmi.android.c.k.i
* JD-Core Version: 0.7.0.1
*/ | [
"xgh.bupt@gmail.com"
] | xgh.bupt@gmail.com |
dcc398350f258c2512087773da99ffdcc3497f20 | 447520f40e82a060368a0802a391697bc00be96f | /apks/playstore_apps/com_spotify_music/source/com/spotify/mobile/android/playlist/proto/ProtoPlaylistRootItem.java | 4f90562063eddc703de0365c45489eb45a846a4d | [
"Apache-2.0"
] | permissive | iantal/AndroidPermissions | 7f3343a9c29d82dbcd4ecd98b3a50ddf8d179465 | d623b732734243590b5f004d167e542e2e2ae249 | refs/heads/master | 2023-07-19T01:29:26.689186 | 2019-09-30T19:01:42 | 2019-09-30T19:01:42 | 107,239,248 | 0 | 0 | Apache-2.0 | 2023-07-16T07:41:38 | 2017-10-17T08:22:57 | null | UTF-8 | Java | false | false | 2,695 | java | package com.spotify.mobile.android.playlist.proto;
import com.squareup.wire.Message;
import com.squareup.wire.ProtoAdapter;
import hxv;
import okio.ByteString;
import xsi;
public final class ProtoPlaylistRootItem
extends Message<ProtoPlaylistRootItem, ProtoPlaylistRootItem.Builder>
{
public static final ProtoAdapter<ProtoPlaylistRootItem> ADAPTER = new hxv();
public static final String DEFAULT_HEADER_FIELD = "";
private static final long serialVersionUID = 0L;
public final ProtoPlaylistRootFolder folder;
public final String header_field;
public final ProtoPlaylistRootPlaylist playlist;
public ProtoPlaylistRootItem(String paramString, ProtoPlaylistRootFolder paramProtoPlaylistRootFolder, ProtoPlaylistRootPlaylist paramProtoPlaylistRootPlaylist, ByteString paramByteString)
{
super(ADAPTER, paramByteString);
this.header_field = paramString;
this.folder = paramProtoPlaylistRootFolder;
this.playlist = paramProtoPlaylistRootPlaylist;
}
public final boolean equals(Object paramObject)
{
if (paramObject == this) {
return true;
}
if (!(paramObject instanceof ProtoPlaylistRootItem)) {
return false;
}
paramObject = (ProtoPlaylistRootItem)paramObject;
return (a().equals(paramObject.a())) && (xsi.a(this.header_field, paramObject.header_field)) && (xsi.a(this.folder, paramObject.folder)) && (xsi.a(this.playlist, paramObject.playlist));
}
public final int hashCode()
{
int j = this.hashCode;
int i = j;
if (j == 0)
{
int m = a().hashCode();
String str = this.header_field;
int k = 0;
if (str != null) {
i = this.header_field.hashCode();
} else {
i = 0;
}
if (this.folder != null) {
j = this.folder.hashCode();
} else {
j = 0;
}
if (this.playlist != null) {
k = this.playlist.hashCode();
}
i = ((m * 37 + i) * 37 + j) * 37 + k;
this.hashCode = i;
}
return i;
}
public final String toString()
{
StringBuilder localStringBuilder = new StringBuilder();
if (this.header_field != null)
{
localStringBuilder.append(", header_field=");
localStringBuilder.append(this.header_field);
}
if (this.folder != null)
{
localStringBuilder.append(", folder=");
localStringBuilder.append(this.folder);
}
if (this.playlist != null)
{
localStringBuilder.append(", playlist=");
localStringBuilder.append(this.playlist);
}
localStringBuilder = localStringBuilder.replace(0, 2, "ProtoPlaylistRootItem{");
localStringBuilder.append('}');
return localStringBuilder.toString();
}
}
| [
"antal.micky@yahoo.com"
] | antal.micky@yahoo.com |
08b8778b55bf66e506b2ca53de72e647659bd522 | 5ec06dab1409d790496ce082dacb321392b32fe9 | /clients/java-inflector/generated/src/gen/java/org/openapitools/model/ComAdobeCqDamS7imagingImplIsImageServerComponentInfo.java | cf70176ebe01ebd0857e40c38fa48a0f155d59bb | [
"Apache-2.0"
] | permissive | shinesolutions/swagger-aem-osgi | e9d2385f44bee70e5bbdc0d577e99a9f2525266f | c2f6e076971d2592c1cbd3f70695c679e807396b | refs/heads/master | 2022-10-29T13:07:40.422092 | 2021-04-09T07:46:03 | 2021-04-09T07:46:03 | 190,217,155 | 3 | 3 | Apache-2.0 | 2022-10-05T03:26:20 | 2019-06-04T14:23:28 | null | UTF-8 | Java | false | false | 4,072 | java | package org.openapitools.model;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.openapitools.model.ComAdobeCqDamS7imagingImplIsImageServerComponentProperties;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaInflectorServerCodegen", date = "2019-08-05T00:53:46.291Z[GMT]")
public class ComAdobeCqDamS7imagingImplIsImageServerComponentInfo {
@JsonProperty("pid")
private String pid = null;
@JsonProperty("title")
private String title = null;
@JsonProperty("description")
private String description = null;
@JsonProperty("properties")
private ComAdobeCqDamS7imagingImplIsImageServerComponentProperties properties = null;
/**
**/
public ComAdobeCqDamS7imagingImplIsImageServerComponentInfo pid(String pid) {
this.pid = pid;
return this;
}
@ApiModelProperty(value = "")
@JsonProperty("pid")
public String getPid() {
return pid;
}
public void setPid(String pid) {
this.pid = pid;
}
/**
**/
public ComAdobeCqDamS7imagingImplIsImageServerComponentInfo title(String title) {
this.title = title;
return this;
}
@ApiModelProperty(value = "")
@JsonProperty("title")
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
/**
**/
public ComAdobeCqDamS7imagingImplIsImageServerComponentInfo description(String description) {
this.description = description;
return this;
}
@ApiModelProperty(value = "")
@JsonProperty("description")
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
/**
**/
public ComAdobeCqDamS7imagingImplIsImageServerComponentInfo properties(ComAdobeCqDamS7imagingImplIsImageServerComponentProperties properties) {
this.properties = properties;
return this;
}
@ApiModelProperty(value = "")
@JsonProperty("properties")
public ComAdobeCqDamS7imagingImplIsImageServerComponentProperties getProperties() {
return properties;
}
public void setProperties(ComAdobeCqDamS7imagingImplIsImageServerComponentProperties properties) {
this.properties = properties;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ComAdobeCqDamS7imagingImplIsImageServerComponentInfo comAdobeCqDamS7imagingImplIsImageServerComponentInfo = (ComAdobeCqDamS7imagingImplIsImageServerComponentInfo) o;
return Objects.equals(pid, comAdobeCqDamS7imagingImplIsImageServerComponentInfo.pid) &&
Objects.equals(title, comAdobeCqDamS7imagingImplIsImageServerComponentInfo.title) &&
Objects.equals(description, comAdobeCqDamS7imagingImplIsImageServerComponentInfo.description) &&
Objects.equals(properties, comAdobeCqDamS7imagingImplIsImageServerComponentInfo.properties);
}
@Override
public int hashCode() {
return Objects.hash(pid, title, description, properties);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ComAdobeCqDamS7imagingImplIsImageServerComponentInfo {\n");
sb.append(" pid: ").append(toIndentedString(pid)).append("\n");
sb.append(" title: ").append(toIndentedString(title)).append("\n");
sb.append(" description: ").append(toIndentedString(description)).append("\n");
sb.append(" properties: ").append(toIndentedString(properties)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
| [
"cliffano@gmail.com"
] | cliffano@gmail.com |
b26ce5c700c01916a781fb333da32db207c12c25 | cb4e96db361aa27ebf2573642cbbf9f7e2c47a96 | /wingtool-parent/wingtoolparent/wingtool-aop/src/main/java/com/orangehaswing/aop/aspects/SimpleAspect.java | 9fd56d39d35b3215db98cc8fd1bba0dc25f146fd | [] | no_license | orangehaswing/wingtool | 5242fb3929185b2c8c8c8f81ffd2a53959104829 | a8851360e40a4b1c9b24345f0aeb332e50ed8c5a | refs/heads/master | 2020-05-03T12:49:44.276966 | 2019-04-16T13:16:41 | 2019-04-16T13:16:41 | 178,637,437 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 679 | java | package com.orangehaswing.aop.aspects;
import java.lang.reflect.Method;
/**
* 简单切面类,不做任何操作<br>
* 可以继承此类实现自己需要的方法即可
*
* @author Looly
*
*/
public class SimpleAspect implements Aspect{
@Override
public boolean before(Object target, Method method, Object[] args) {
//继承此类后实现此方法
return true;
}
@Override
public boolean after(Object target, Method method, Object[] args) {
//继承此类后实现此方法
return true;
}
@Override
public boolean afterException(Object target, Method method, Object[] args, Throwable e) {
//继承此类后实现此方法
return true;
}
}
| [
"673556024@qq.com"
] | 673556024@qq.com |
ee7a8ffe58528c903bdac43386be7250aa89eea3 | 14d9cf24f2069c58a13a668cb185f8eee6431dcb | /src/main/java/wanderingMiniBosses/powers/delayedpowers/DelayPower.java | 9e917a3484a75dedacd940fa89469f33344659cf | [] | no_license | erasels/wanderingMiniBosses | 9ff05799bbd394219fd50151c9a44abf39842203 | 26990fd92a32c844bd8acedf1897467264c7fa42 | refs/heads/master | 2023-08-03T16:13:15.615181 | 2023-07-05T21:13:33 | 2023-07-05T21:13:33 | 234,706,884 | 1 | 10 | null | 2023-07-05T21:13:34 | 2020-01-18T08:51:45 | Java | UTF-8 | Java | false | false | 1,773 | java | package wanderingMiniBosses.powers.delayedpowers;
import com.evacipated.cardcrawl.mod.stslib.powers.interfaces.NonStackablePower;
import com.megacrit.cardcrawl.actions.common.ApplyPowerAction;
import com.megacrit.cardcrawl.actions.common.RemoveSpecificPowerAction;
import com.megacrit.cardcrawl.characters.AbstractPlayer;
import com.megacrit.cardcrawl.dungeons.AbstractDungeon;
import com.megacrit.cardcrawl.monsters.AbstractMonster;
import com.megacrit.cardcrawl.powers.AbstractPower;
public class DelayPower extends AbstractPower implements NonStackablePower {
private AbstractPower pow;
public DelayPower(AbstractPower pow) {
this.pow = pow;
this.region48 = pow.region48;
this.region128 = pow.region128;
this.owner = pow.owner;
this.name = pow.name;
this.description = pow.description;
this.type = this.pow.type;
}
@Override
public void atEndOfRound() {
if(this.pow.owner instanceof AbstractMonster) {
addToBot(new RemoveSpecificPowerAction(this.owner, this.owner, this));
addToBot(new ApplyPowerAction(this.owner, this.owner, this.pow));
}
}
@Override
public void atStartOfTurn() {
if(this.pow.owner instanceof AbstractPlayer) {
addToBot(new RemoveSpecificPowerAction(this.owner, this.owner, this));
addToBot(new ApplyPowerAction(this.owner, this.owner, this.pow));
}
}
public static void addToBottom(AbstractPower pow) {
AbstractDungeon.actionManager.addToBottom(new ApplyPowerAction(pow.owner, pow.owner, pow));
}
public static void addToTop(AbstractPower pow) {
AbstractDungeon.actionManager.addToTop(new ApplyPowerAction(pow.owner, pow.owner, pow));
}
}
| [
"razash@gmail.com"
] | razash@gmail.com |
6cd5c9c67dbaaac016232ee81b6ee67eb2525d21 | ca0e9689023cc9998c7f24b9e0532261fd976e0e | /src/com/tencent/mm/console/u.java | e2f048e03ef2658854c740e63b7b64f9c78cce06 | [] | no_license | honeyflyfish/com.tencent.mm | c7e992f51070f6ac5e9c05e9a2babd7b712cf713 | ce6e605ff98164359a7073ab9a62a3f3101b8c34 | refs/heads/master | 2020-03-28T15:42:52.284117 | 2016-07-19T16:33:30 | 2016-07-19T16:33:30 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 526 | java | package com.tencent.mm.console;
import com.tencent.mm.sdk.platformtools.t;
final class u
implements Runnable
{
public final void run()
{
t.d("!24@/B4Tb64lLpLOIdMtS2bKaA==", "dkcrash begin tid:%d [%s]", new Object[] { Long.valueOf(Thread.currentThread().getId()), Thread.currentThread().getName() });
Object[] arrayOfObject = new Object[1];
throw new NullPointerException();
}
}
/* Location:
* Qualified Name: com.tencent.mm.console.u
* Java Class Version: 6 (50.0)
* JD-Core Version: 0.7.1
*/ | [
"reverseengineeringer@hackeradmin.com"
] | reverseengineeringer@hackeradmin.com |
a24fde3e2362762b201c5c2c31d27cccb43bac17 | b3009958ed1d9be82c02cce695cec87d75a41c53 | /myoa/src/com/web/oa/junit/HelloWorldTest.java | 624d86cb5c99e99786744f9493484b67e75ae32c | [] | no_license | marry-cao/Myproject | d19d4992f1cb5459b8c984bdb46c3aebbcc6f078 | da0baa969ffea2937eab0d2c121a37a77178e257 | refs/heads/master | 2023-01-29T22:38:42.172246 | 2020-12-17T09:48:49 | 2020-12-17T09:48:49 | 322,242,278 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,860 | java | package com.web.oa.junit;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.List;
import java.util.zip.ZipInputStream;
import org.activiti.engine.FormService;
import org.activiti.engine.HistoryService;
import org.activiti.engine.ProcessEngine;
import org.activiti.engine.ProcessEngines;
import org.activiti.engine.RepositoryService;
import org.activiti.engine.RuntimeService;
import org.activiti.engine.TaskService;
import org.activiti.engine.history.HistoricTaskInstance;
import org.activiti.engine.repository.Deployment;
import org.activiti.engine.repository.ProcessDefinition;
import org.activiti.engine.runtime.ProcessInstance;
import org.activiti.engine.task.Task;
import org.apache.commons.io.FileUtils;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
/**
* `act_re_procdef` 流程定义表 process definition,相当于“模板”
* `act_re_deployment` 流程部署信息表
* `act_ge_bytearray` 流程的资源表(存放二进制数据)
* `act_hi_procinst` 流程实例历史表 process instance,相当于“某一个流程的具体操作” history
* `act_ru_execution` 流程实例的执行对象表
* `act_ru_task` 当前活动的任务(节点),默认情况,`act_ru_task和`act_ru_execution`有一对一的关系
* `act_hi_taskinst` 历史任务记录表
*
*
*/
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations={"classpath:spring/applicationContext.xml","classpath:spring/springmvc.xml"})
public class HelloWorldTest {
// 连接数据库,默认方式是使用spring方式,使用activiti.cfg.xml配置文件
//ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
@Autowired
private RepositoryService repositoryService;
@Autowired
private RuntimeService runtimeService;
@Autowired
private TaskService taskService;
@Autowired
private FormService formService;
@Autowired
private HistoryService historyService;
//部署流程图
@Test
public void testDeployProcess() {
Deployment deployment = repositoryService
.createDeployment()
.name("helloworld入门程序")
.addClasspathResource("diagram/helloworld.bpmn")
.addClasspathResource("diagram/helloworld.png")
.deploy();
System.out.println("部署对象 ID: " + deployment.getId());
System.out.println("部署对象 Name : " + deployment.getName());
}
//部署流程图
@Test
public void testDeployProcess2() throws FileNotFoundException {
InputStream inputstream = new FileInputStream("D:\\workflow\\helloworld.zip");
ZipInputStream zipInputstream = new ZipInputStream(inputstream );
Deployment deployment = this.repositoryService
.createDeployment()
.name("helloworld入门程序")
.addZipInputStream(zipInputstream)
.deploy();
System.out.println("部署对象 ID: " + deployment.getId());
System.out.println("部署对象 Name : " + deployment.getName());
}
//启动流程实例
@Test
public void testStartProcess() {
String key = "helloworldProcess";
ProcessInstance pi = this.runtimeService.startProcessInstanceByKey(key );
System.out.println("流程实例的ID: " + pi.getId());
System.out.println("流程定义的ID: " + pi.getProcessDefinitionId());//helloworldProcess:1:4
}
//查看任务人的待办事务
@Test
public void testTaskList() {
String assignee = "boss";
List<Task> list = this.taskService.createTaskQuery()
.taskAssignee(assignee).list();
for (Task task : list) {
System.out.println("Task Id: " + task.getId());
System.out.println("Task Assignee: " + task.getAssignee());
System.out.println("Task Time : " + task.getCreateTime());
System.out.println("Process Definition id: " + task.getProcessDefinitionId());
System.out.println("Process Instance id: " + task.getProcessInstanceId());
}
}
//完成待办事务
@Test
public void testFinishTask() {
String taskId = "202";
this.taskService.complete(taskId );
System.out.println("任务完成");
}
//查看应用的流程定义
@Test
public void testFindProcessDef() {
List<ProcessDefinition> list = this.repositoryService.createProcessDefinitionQuery()
.orderByProcessDefinitionName().desc()
.list();
for (ProcessDefinition pd : list) {
System.out.println("流程定义的ID : " + pd.getId());
System.out.println("流程定义的key : " + pd.getKey());
System.out.println("流程定义的版本 : " + pd.getVersion());
System.out.println("流程定义的部署ID : " + pd.getDeploymentId());
}
}
}
| [
"admin@qq.com"
] | admin@qq.com |
d00d1051b91f01ec04bc2b969f0ef71e11ce8ab9 | 55198905555db7de06a5ed6e743b9087560ee82e | /ServerLib/GsonServer/src/main/java/com/yc/gson/adapter/DoubleTypeAdapter.java | 01fb69199df398d0d861b21066b0c3463e66ad24 | [
"Apache-2.0"
] | permissive | Mario0o/LifeHelper | c68ebe76e50283403587558dfdfdddd418667943 | 83c22ffbd61186aa86d29a325755e5f796d1e117 | refs/heads/master | 2023-08-17T05:49:25.116555 | 2023-08-14T23:51:17 | 2023-08-14T23:51:17 | 190,854,495 | 0 | 0 | null | 2023-08-15T08:02:23 | 2019-06-08T06:37:35 | Java | UTF-8 | Java | false | false | 1,213 | java | package com.yc.gson.adapter;
import com.google.gson.TypeAdapter;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import java.io.IOException;
/**
* <pre>
* author : yangchong
* email : yangchong211@163.com
* time : 2021/8/11
* desc : Double 类型解析适配器
* revise : 参考:{@link com.google.gson.internal.bind.TypeAdapters#DOUBLE}
* </pre>
*/
public class DoubleTypeAdapter extends TypeAdapter<Double> {
@Override
public Double read(JsonReader in) throws IOException {
switch (in.peek()) {
case NUMBER:
return in.nextDouble();
case STRING:
String result = in.nextString();
if (result == null || "".equals(result)) {
return 0D;
}
return Double.parseDouble(result);
case NULL:
in.nextNull();
return null;
default:
in.skipValue();
throw new IllegalArgumentException();
}
}
@Override
public void write(JsonWriter out, Double value) throws IOException {
out.value(value);
}
} | [
"yangchong211@163.com"
] | yangchong211@163.com |
bcdbc44c8b38a4932512b7a22830bfe94762a7ba | dc1dbb7e5a4b95bf44170d2f51fd08b3814f2ac9 | /data_defect4j/preprossed_method_corpus/Math/2/org/apache/commons/math3/util/ResizableDoubleArray_getElement_761.java | 578421883342b393d1d4967862a37d5b7cde37f3 | [] | no_license | hvdthong/NetML | dca6cf4d34c5799b400d718e0a6cd2e0b167297d | 9bb103da21327912e5a29cbf9be9ff4d058731a5 | refs/heads/master | 2021-06-30T15:03:52.618255 | 2020-10-07T01:58:48 | 2020-10-07T01:58:48 | 150,383,588 | 1 | 1 | null | 2018-09-26T07:08:45 | 2018-09-26T07:08:44 | null | UTF-8 | Java | false | false | 3,518 | java |
org apach common math3 util
variabl length link doubl arrai doublearrai implement automat
handl expand contract intern storag arrai element
ad remov
import note usag assum thread safe
method code
qualifi drop major releas
intern storag arrai start capac determin
code initi capac initialcapac properti set constructor
initi capac ad element
link add element addel append element end arrai
open entri end intern storag arrai
arrai expand size expand arrai depend
code expans mode expansionmod code expans factor expansionfactor properti
code expans mode expansionmod determin size arrai
multipli code expans factor expansionfactor
link expans mode expansionmod multipl expans addit
link expans mode expansionmod addit code expans factor expansionfactor storag
locat ad
code expans mode expansionmod code multipl
code expans factor expansionfactor
link add element roll addelementrol method add element end
intern storag arrai adjust usabl window
intern arrai forward posit effect make
element repeat activ method
activ link discard front element discardfrontel effect orphan
storag locat begin intern storag arrai
reclaim storag time method activ size
intern storag arrai compar number address
element code num element numel properti differ
larg intern arrai contract size
code num element numel determin intern
storag arrai larg depend code expans mode expansionmod
code contract factor contractionfactor properti code expans mode expansionmod
code multipl contract trigger
ratio storag arrai length code num element numel exce
code contract factor contractionfactor code expans mode expansionmod
code addit number excess storag locat
compar code contract factor contractionfactor
avoid cycl expans contract
code expans factor expansionfactor exce code contract factor contractionfactor
constructor mutat properti enforc
requir throw code math illeg argument except mathillegalargumentexcept
violat
version
resiz doubl arrai resizabledoublearrai doubl arrai doublearrai serializ
return element index
param index index fetch
store index
arrai index bound except arrayindexoutofboundsexcept code index code
greater code num element getnumel code
element getel index
index num element numel
arrai index bound except arrayindexoutofboundsexcept index
index
intern arrai internalarrai start index startindex index
arrai index bound except arrayindexoutofboundsexcept index
| [
"hvdthong@gmail.com"
] | hvdthong@gmail.com |
44ce978b53f2e9abf1b43f4dc0acf0682710eb93 | bb3625b54d2ae9763a97124cdb4d1369439b5096 | /JavaRushTasks/4.JavaCollections/src/com/javarush/task/task33/task3310/Helper.java | 03ac261ce625e6ebc2399863554e0b942f7501fe | [] | no_license | viktorbrechko85/MyProjects | c4d7c2b5c9e4159bd93dadf8dd555e2a5362a71e | be188d801c323918cd959a6552582f63908012ac | refs/heads/master | 2022-12-21T21:21:32.733634 | 2019-09-10T12:14:08 | 2019-09-10T12:14:08 | 207,059,945 | 0 | 0 | null | 2022-12-16T00:47:27 | 2019-09-08T04:08:39 | Java | UTF-8 | Java | false | false | 419 | java | package com.javarush.task.task33.task3310;
import java.math.BigInteger;
import java.security.SecureRandom;
public class Helper {
private static SecureRandom random;
public static String generateRandomString(){
random = new SecureRandom();
return new BigInteger(130, random).toString(36);
}
public static void printMessage(String message){
System.out.println(message);
}
}
| [
"vbrobocop1985@gmail.com"
] | vbrobocop1985@gmail.com |
21de89597204d6d6d4ce221e60727f936fd79fb5 | 806f76edfe3b16b437be3eb81639d1a7b1ced0de | /src/org/apache/log4j/lf5/viewer/categoryexplorer/CategoryExplorerLogRecordFilter.java | 4454c6292eb7c88ce56a3aedebaa01cba38227df | [] | no_license | magic-coder/huawei-wear-re | 1bbcabc807e21b2fe8fe9aa9d6402431dfe3fb01 | 935ad32f5348c3d8c8d294ed55a5a2830987da73 | refs/heads/master | 2021-04-15T18:30:54.036851 | 2018-03-22T07:16:50 | 2018-03-22T07:16:50 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,054 | java | package org.apache.log4j.lf5.viewer.categoryexplorer;
import java.util.Enumeration;
import org.apache.log4j.lf5.LogRecord;
import org.apache.log4j.lf5.LogRecordFilter;
public class CategoryExplorerLogRecordFilter implements LogRecordFilter {
protected CategoryExplorerModel _model;
public CategoryExplorerLogRecordFilter(CategoryExplorerModel categoryExplorerModel) {
this._model = categoryExplorerModel;
}
public boolean passes(LogRecord logRecord) {
return this._model.isCategoryPathActive(new CategoryPath(logRecord.getCategory()));
}
public void reset() {
resetAllNodes();
}
protected void resetAllNodes() {
Enumeration depthFirstEnumeration = this._model.getRootCategoryNode().depthFirstEnumeration();
while (depthFirstEnumeration.hasMoreElements()) {
CategoryNode categoryNode = (CategoryNode) depthFirstEnumeration.nextElement();
categoryNode.resetNumberOfContainedRecords();
this._model.nodeChanged(categoryNode);
}
}
}
| [
"lebedev1537@gmail.com"
] | lebedev1537@gmail.com |
ae5d3c60f2e4f7dbc636eb932bfddb6cf49e875e | 6dc1f758822b3bd3fff1c60e1c038710a73dda2c | /app/src/main/java/android/app/yazhi/com/yazhiproject/common/retrofit/ResponseInterface.java | 07245db1376bbdc442b9fe2edbf16af08f7aa87d | [] | no_license | speak-out/YaZhiProject | 1a01098261c77f8b9b6ee105f295077c39981765 | eb185431d1033d16c4cd3da1f86fb79d50dffc7b | refs/heads/master | 2020-04-19T00:40:13.916359 | 2016-09-08T16:03:54 | 2016-09-08T16:03:54 | 67,715,667 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 325 | java | package android.app.yazhi.com.yazhiproject.common.retrofit;
/**
* Created by yuer on 2016/8/24.
*/
public interface ResponseInterface {
//请求成功
public void onSuccee(Object response, String code);
//请求错误
public void onError(Throwable e);
//请求结束
public void onCompleted();
}
| [
"1"
] | 1 |
794a8103bf1836fd04387ccf05af7ffd4307ad31 | 021c0e69518901d1dc41bdc3eaf82eb1e6db0776 | /services/src/main/java/org/keycloak/protocol/oidc/utils/RedirectUtils.java | df650f6c7925b13a2d3e12ce633d29c56c89628c | [
"Apache-2.0"
] | permissive | panga/keycloak | 7d2df919e4a0c37acb907a16d6d2e310d79560a8 | 748ed30b475dc984025d54392e8857d35f204bbb | refs/heads/master | 2020-02-26T17:37:08.224093 | 2015-05-20T05:56:54 | 2015-05-20T05:56:54 | 35,549,628 | 1 | 0 | null | 2015-05-13T13:09:41 | 2015-05-13T13:09:41 | null | UTF-8 | Java | false | false | 5,254 | java | package org.keycloak.protocol.oidc.utils;
import org.jboss.logging.Logger;
import org.keycloak.models.ClientModel;
import org.keycloak.models.Constants;
import org.keycloak.models.RealmModel;
import org.keycloak.services.Urls;
import javax.ws.rs.core.UriInfo;
import java.net.URI;
import java.util.HashSet;
import java.util.Set;
/**
* @author <a href="mailto:sthorger@redhat.com">Stian Thorgersen</a>
*/
public class RedirectUtils {
private static final Logger logger = Logger.getLogger(RedirectUtils.class);
public static String verifyRealmRedirectUri(UriInfo uriInfo, String redirectUri, RealmModel realm) {
Set<String> validRedirects = getValidateRedirectUris(realm);
return verifyRedirectUri(uriInfo, redirectUri, realm, validRedirects);
}
public static String verifyRedirectUri(UriInfo uriInfo, String redirectUri, RealmModel realm, ClientModel client) {
Set<String> validRedirects = client.getRedirectUris();
return verifyRedirectUri(uriInfo, redirectUri, realm, validRedirects);
}
public static Set<String> resolveValidRedirects(UriInfo uriInfo, Set<String> validRedirects) {
// If the valid redirect URI is relative (no scheme, host, port) then use the request's scheme, host, and port
Set<String> resolveValidRedirects = new HashSet<String>();
for (String validRedirect : validRedirects) {
resolveValidRedirects.add(validRedirect); // add even relative urls.
if (validRedirect.startsWith("/")) {
validRedirect = relativeToAbsoluteURI(uriInfo, validRedirect);
logger.debugv("replacing relative valid redirect with: {0}", validRedirect);
resolveValidRedirects.add(validRedirect);
}
}
return resolveValidRedirects;
}
private static Set<String> getValidateRedirectUris(RealmModel realm) {
Set<String> redirects = new HashSet<String>();
for (ClientModel client : realm.getClients()) {
for (String redirect : client.getRedirectUris()) {
redirects.add(redirect);
}
}
return redirects;
}
private static String verifyRedirectUri(UriInfo uriInfo, String redirectUri, RealmModel realm, Set<String> validRedirects) {
if (redirectUri == null) {
if (validRedirects.size() != 1) return null;
String validRedirect = validRedirects.iterator().next();
int idx = validRedirect.indexOf("/*");
if (idx > -1) {
validRedirect = validRedirect.substring(0, idx);
}
redirectUri = validRedirect;
} else if (validRedirects.isEmpty()) {
logger.debug("No Redirect URIs supplied");
redirectUri = null;
} else {
String r = redirectUri.indexOf('?') != -1 ? redirectUri.substring(0, redirectUri.indexOf('?')) : redirectUri;
Set<String> resolveValidRedirects = resolveValidRedirects(uriInfo, validRedirects);
boolean valid = matchesRedirects(resolveValidRedirects, r);
if (!valid && r.startsWith(Constants.INSTALLED_APP_URL) && r.indexOf(':', Constants.INSTALLED_APP_URL.length()) >= 0) {
int i = r.indexOf(':', Constants.INSTALLED_APP_URL.length());
StringBuilder sb = new StringBuilder();
sb.append(r.substring(0, i));
i = r.indexOf('/', i);
if (i >= 0) {
sb.append(r.substring(i));
}
r = sb.toString();
valid = matchesRedirects(resolveValidRedirects, r);
}
if (valid && redirectUri.startsWith("/")) {
redirectUri = relativeToAbsoluteURI(uriInfo, redirectUri);
}
redirectUri = valid ? redirectUri : null;
}
if (Constants.INSTALLED_APP_URN.equals(redirectUri)) {
return Urls.realmInstalledAppUrnCallback(uriInfo.getBaseUri(), realm.getName()).toString();
} else {
return redirectUri;
}
}
private static String relativeToAbsoluteURI(UriInfo uriInfo, String relative) {
URI baseUri = uriInfo.getBaseUri();
String uri = baseUri.getScheme() + "://" + baseUri.getHost();
if (baseUri.getPort() != -1) {
uri += ":" + baseUri.getPort();
}
relative = uri + relative;
return relative;
}
private static boolean matchesRedirects(Set<String> validRedirects, String redirect) {
for (String validRedirect : validRedirects) {
if (validRedirect.endsWith("*")) {
// strip off *
int length = validRedirect.length() - 1;
validRedirect = validRedirect.substring(0, length);
if (redirect.startsWith(validRedirect)) return true;
// strip off trailing '/'
if (length - 1 > 0 && validRedirect.charAt(length - 1) == '/') length--;
validRedirect = validRedirect.substring(0, length);
if (validRedirect.equals(redirect)) return true;
} else if (validRedirect.equals(redirect)) return true;
}
return false;
}
}
| [
"stianst@gmail.com"
] | stianst@gmail.com |
44986e70566323ed19da985ad0e5d05f106c4fb2 | 7bbc806193820f39f846d6381d10366f187e3dfc | /dps/.svn/pristine/44/44986e70566323ed19da985ad0e5d05f106c4fb2.svn-base | 1e71494388b2ab96ab1844355c08cb1395266295 | [] | no_license | artmalling/artmalling | fc45268b7cf566a2bc2de0549581eeb96505968a | 0dd2d495d0354a38b05f7986bfb572d7d7dd1b08 | refs/heads/master | 2020-03-07T07:55:07.111863 | 2018-03-30T06:51:35 | 2018-03-30T06:51:35 | 127,362,251 | 0 | 0 | null | 2018-03-30T01:05:05 | 2018-03-30T00:45:52 | null | UTF-8 | Java | false | false | 3,144 | /*
* Copyright (c) 2010 한국후지쯔. All rights reserved.
*
* This software is the confidential and proprietary information of 한국후지쯔.
* You shall not disclose such Confidential Information and shall use it
* only in accordance with the terms of the license agreement you entered into
* with 한국후지쯔
*/
package psal.action;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import kr.fujitsu.ffw.control.ActionForm;
import kr.fujitsu.ffw.control.ActionForward;
import kr.fujitsu.ffw.control.ActionMapping;
import kr.fujitsu.ffw.control.DispatchAction;
import kr.fujitsu.ffw.control.cfg.svc.shift.GauceHelper2;
import org.apache.log4j.Logger;
import psal.dao.PSal933DAO;
import com.gauce.GauceDataSet;
import common.vo.SessionInfo;
/**
* <p>입금상세데이터 Action</p>
*
* @created on 1.0, 2010/06/01
* @created by 김영진
*
* @modified on
* @modified by
* @caused by
*/
public class PSal933Action extends DispatchAction {
/*
* Java Pattern 에서 지원하는 logger를 사용할 수 있도록 객체를 선언
*/
private Logger logger = Logger.getLogger(PSal933Action.class);
/**
* <p>입금상세데이터 조회 화면으로 이동한다.</p>
*
*/
public ActionForward list(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
try {
GauceHelper2.initialize(form, request, response);
HttpSession session = request.getSession();
SessionInfo sessionInfo = (SessionInfo)session.getAttribute("sessionInfo");
if (sessionInfo != null) {
System.out.println("USER : " + sessionInfo.getUSER_ID());
}
} catch (Exception e) {
e.printStackTrace();
logger.error("[list]", e);
}
return mapping.findForward("list");
}
/**
* <p>입금상세데이터를 조회한다.</p>
*
*/
public ActionForward searchMaster(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
List list = null;
GauceHelper2 helper = null;
GauceDataSet dSet = null;
PSal933DAO dao = null;
String strGoTo = form.getParam("goTo"); // 분기할곳
try {
dao = new PSal933DAO();
helper = new GauceHelper2(request, response, form);
dSet = helper.getDataSet("DS_O_MASTER");
helper.setDataSetHeader(dSet, "H_MASTER");
list = dao.searchMaster(form);
helper.setListToDataset(list, dSet);
} catch (Exception e) {
logger.error("", e);
helper.writeException("GAUCE", "002", e.getMessage());
} finally {
helper.close(dSet);
}
return mapping.findForward(strGoTo);
}
}
| [
"HP@HP-PC0000a"
] | HP@HP-PC0000a | |
c255d214d364ca63d371508dc7ec54b52b2b1086 | f108c31bf39bf5047dd8c0e80e164f3b24c54a77 | /cmmn-xml/cmmn-xml-core/src/main/java/org/omg/spec/cmmn/_20151109/model/MultiplicityEnum.java | 1c2937affa1e9576b86cac68e08350b21a0bb7ea | [
"Apache-2.0"
] | permissive | sotty/cmmn-xml | d071feebe9e0685cb893ce25c5de436f90357a53 | 949eeebcd7f7f77e013d6aab5836b6e1188ba167 | refs/heads/master | 2021-07-09T08:43:29.153541 | 2018-05-18T23:01:59 | 2018-05-18T23:01:59 | 96,401,870 | 0 | 0 | null | 2017-07-06T07:32:28 | 2017-07-06T07:32:28 | null | UTF-8 | Java | false | false | 1,656 | java |
package org.omg.spec.cmmn._20151109.model;
import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for MultiplicityEnum.
*
* <p>The following schema fragment specifies the expected content contained within this class.
* <p>
* <pre>
* <simpleType name="MultiplicityEnum">
* <restriction base="{http://www.w3.org/2001/XMLSchema}string">
* <enumeration value="ZeroOrOne"/>
* <enumeration value="ZeroOrMore"/>
* <enumeration value="ExactlyOne"/>
* <enumeration value="OneOrMore"/>
* <enumeration value="Unspecified"/>
* <enumeration value="Unknown"/>
* </restriction>
* </simpleType>
* </pre>
*
*/
@XmlType(name = "MultiplicityEnum")
@XmlEnum
public enum MultiplicityEnum {
@XmlEnumValue("ZeroOrOne")
ZERO_OR_ONE("ZeroOrOne"),
@XmlEnumValue("ZeroOrMore")
ZERO_OR_MORE("ZeroOrMore"),
@XmlEnumValue("ExactlyOne")
EXACTLY_ONE("ExactlyOne"),
@XmlEnumValue("OneOrMore")
ONE_OR_MORE("OneOrMore"),
@XmlEnumValue("Unspecified")
UNSPECIFIED("Unspecified"),
@XmlEnumValue("Unknown")
UNKNOWN("Unknown");
private final String value;
MultiplicityEnum(String v) {
value = v;
}
public String value() {
return value;
}
public static MultiplicityEnum fromValue(String v) {
for (MultiplicityEnum c: MultiplicityEnum.values()) {
if (c.value.equals(v)) {
return c;
}
}
throw new IllegalArgumentException(v);
}
}
| [
"dsotty@gmail.com"
] | dsotty@gmail.com |
99b4cc20750ddcb4e575b7db7e3c3fca75294614 | 63489b9d7f48b5f95dd7823f1ee0e81beb88aba4 | /artrade/src/main/java/com/UCMobile/PayPlugin/a.java | f102b882f517c52ecef818432ee8a7588f5921ce | [] | no_license | h4x0r139/MyApplication | 7f7b7b65c160cad5af5baa5727163fae5d26a2bb | b71648d2963761efdfdf66de72075e590781c835 | refs/heads/master | 2020-05-21T14:55:31.488110 | 2019-05-28T11:29:45 | 2019-05-28T11:29:45 | 63,512,880 | 5 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,238 | java | package com.UCMobile.PayPlugin;
import android.view.SurfaceHolder;
import android.view.SurfaceHolder.Callback;
final class a
implements SurfaceHolder.Callback
{
a(PluginSurfaceView paramPluginSurfaceView)
{
}
public final void surfaceChanged(SurfaceHolder paramSurfaceHolder, int paramInt1, int paramInt2, int paramInt3)
{
synchronized (PluginSurfaceView.a(this.a))
{
if (PluginSurfaceView.b(this.a))
PluginSurfaceView.a(this.a, PluginSurfaceView.c(this.a), paramInt1, paramInt2, paramInt3);
return;
}
}
public final void surfaceCreated(SurfaceHolder paramSurfaceHolder)
{
synchronized (PluginSurfaceView.a(this.a))
{
if (PluginSurfaceView.b(this.a))
PluginSurfaceView.a(this.a, PluginSurfaceView.c(this.a));
return;
}
}
public final void surfaceDestroyed(SurfaceHolder paramSurfaceHolder)
{
synchronized (PluginSurfaceView.a(this.a))
{
if (PluginSurfaceView.b(this.a))
PluginSurfaceView.b(this.a, PluginSurfaceView.c(this.a));
return;
}
}
}
/* Location: D:\yinxm\Android\work\拍卖\apktool\artrade\classes_dex2jar.jar
* Qualified Name: com.UCMobile.PayPlugin.a
* JD-Core Version: 0.6.2
*/ | [
"h4x0r_001@163.com"
] | h4x0r_001@163.com |
ed6712761c47f6cdac3d7dbb93ffd79ccd5be954 | dbd50ee67907fc5be392956de73bb6dcee56cd28 | /tests/robotests/src/com/android/tv/util/TvInputManagerHelperRoboTest.java | 837a18bfb861c79ca12cf8056b0a9d1358fcb8c9 | [
"Apache-2.0"
] | permissive | werktrieb/TV-App | 807787dde148b6cf13f3770803487d9297b59ac8 | 906d4098e8264baf527b072179273517c1209eb5 | refs/heads/master | 2023-04-07T19:08:12.619668 | 2019-05-22T12:37:27 | 2019-09-16T22:52:58 | 216,421,016 | 0 | 0 | null | 2021-03-31T21:33:23 | 2019-10-20T20:10:19 | Java | UTF-8 | Java | false | false | 1,786 | java | /*
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License
*/
package com.android.tv.util;
import static com.google.common.truth.Truth.assertThat;
import android.media.tv.TvInputInfo;
import android.media.tv.TvInputManager;
import com.android.tv.common.flags.impl.DefaultLegacyFlags;
import com.android.tv.testing.constants.ConfigConstants;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.RuntimeEnvironment;
import org.robolectric.annotation.Config;
/**
* Tests for {@link TvInputManagerHelper}.
*
* <p>This test is named ...RoboTest because there is already a test named <code>
* TvInputManagerHelperTest</code>
*/
@RunWith(RobolectricTestRunner.class)
@Config(sdk = ConfigConstants.SDK)
public class TvInputManagerHelperRoboTest {
@Test
public void getInputState_null() {
TvInputInfo tvinputInfo = null;
TvInputManagerHelper tvInputManagerHelper =
new TvInputManagerHelper(
RuntimeEnvironment.application, DefaultLegacyFlags.DEFAULT);
assertThat(TvInputManager.INPUT_STATE_DISCONNECTED)
.isSameInstanceAs(tvInputManagerHelper.getInputState(tvinputInfo));
}
}
| [
"copybara-worker@google.com"
] | copybara-worker@google.com |
3a2a0aabcdbf5025c116a4c0c22ffbb7236f9ba3 | eb9f655206c43c12b497c667ba56a0d358b6bc3a | /java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting/IDEA57410.java | 93efea5d8b341b48a74f863c6dc05c61c40fd83c | [
"Apache-2.0"
] | permissive | JetBrains/intellij-community | 2ed226e200ecc17c037dcddd4a006de56cd43941 | 05dbd4575d01a213f3f4d69aa4968473f2536142 | refs/heads/master | 2023-09-03T17:06:37.560889 | 2023-09-03T11:51:00 | 2023-09-03T12:12:27 | 2,489,216 | 16,288 | 6,635 | Apache-2.0 | 2023-09-12T07:41:58 | 2011-09-30T13:33:05 | null | UTF-8 | Java | false | false | 291 | java |
interface IA {
<T> void a(Iterable<String> x);
}
interface IB {
<T> void a(Iterable x);
}
<error descr="'a(Iterable)' in 'IB' clashes with 'a(Iterable<String>)' in 'IA'; both methods have same erasure, yet neither overrides the other">abstract class C implements IA, IB</error> {} | [
"Anna.Kozlova@jetbrains.com"
] | Anna.Kozlova@jetbrains.com |
2cf88a3e69936d9bca705d6dd5bf00b9522d4fc9 | 40544f702eaa2ac6d8e0fe57d166587c1b58d7e9 | /AppUpdate/app/src/main/java/com/example/appupdate/util/HProgressDialogUtils.java | 23b27c34ff127a16663462b438a3a702f7617563 | [] | no_license | linxiaoxing/- | 5d00dd26d133b81015bf414ac74b4cf053fa3743 | 15066155fd784bcae68761275b5f63ecbaa73d0f | refs/heads/master | 2020-09-22T01:27:24.474624 | 2020-01-17T19:13:40 | 2020-01-17T19:13:57 | 225,002,760 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,823 | java | package com.example.appupdate.util;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.ProgressDialog;
import android.text.TextUtils;
public class HProgressDialogUtils {
private static ProgressDialog sHorizontalProgressDialog;
private HProgressDialogUtils() {
throw new UnsupportedOperationException("cannot be instantiated");
}
@SuppressLint("NewApi")
public static void showHorizontalProgressDialog(Activity context, String msg, boolean isShowSize) {
cancel();
if (sHorizontalProgressDialog == null) {
sHorizontalProgressDialog = new ProgressDialog(context);
sHorizontalProgressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
sHorizontalProgressDialog.setCanceledOnTouchOutside(false);
if (isShowSize)
sHorizontalProgressDialog.setProgressNumberFormat("%2dMB/%1dMB");
}
if (!TextUtils.isEmpty(msg)) {
sHorizontalProgressDialog.setMessage(msg);
}
sHorizontalProgressDialog.show();
}
public static void setMax(long total) {
if (sHorizontalProgressDialog != null) {
sHorizontalProgressDialog.setMax(((int) total) / (1024 * 1024));
}
}
public static void cancel() {
if (sHorizontalProgressDialog != null) {
sHorizontalProgressDialog.dismiss();
sHorizontalProgressDialog = null;
}
}
public static void setProgress(int current) {
if (sHorizontalProgressDialog == null) {
return;
}
sHorizontalProgressDialog.setProgress(current);
if (sHorizontalProgressDialog.getProgress() >= sHorizontalProgressDialog.getMax()) {
sHorizontalProgressDialog.dismiss();
sHorizontalProgressDialog = null;
}
}
public static void setProgress(long current) {
if (sHorizontalProgressDialog == null) {
return;
}
sHorizontalProgressDialog.setProgress(((int) current) / (1024 * 1024));
if (sHorizontalProgressDialog.getProgress() >= sHorizontalProgressDialog.getMax()) {
sHorizontalProgressDialog.dismiss();
sHorizontalProgressDialog = null;
}
}
public static void onLoading(long total, long current) {
if (sHorizontalProgressDialog == null) {
return;
}
if (current == 0) {
sHorizontalProgressDialog.setMax(((int) total) / (1024 * 1024));
}
sHorizontalProgressDialog.setProgress(((int) current) / (1024 * 1024));
if (sHorizontalProgressDialog.getProgress() >= sHorizontalProgressDialog.getMax()) {
sHorizontalProgressDialog.dismiss();
sHorizontalProgressDialog = null;
}
}
}
| [
"1208280008@qq.com"
] | 1208280008@qq.com |
9dbcdd8474088b311b294e20dcf564bd401c96aa | ba44e8867d176d74a6ca0a681a4f454ca0b53cad | /com/sybase/automation/framework/common/WatchLog.java | 38b53cb61375aca27753c0c4b593f9d0b896973a | [] | no_license | eric2323223/FATPUS | 1879e2fa105c7e7683afd269965d8b59a7e40894 | 989d2cf49127d88fdf787da5ca6650e2abd5a00e | refs/heads/master | 2016-09-15T19:10:35.317021 | 2012-06-29T02:32:36 | 2012-06-29T02:32:36 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 429 | java | package com.sybase.automation.framework.common;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.vfs2.FileChangeEvent;
public class WatchLog {
private List<FileChangeEvent> events = new ArrayList<FileChangeEvent>();
public void addEvent(FileChangeEvent event) {
events.add(event);
}
public boolean hasChanges(){
return events.size()>0;
}
public void reset() {
events.clear();
}
}
| [
"eric2323223@gmail.com"
] | eric2323223@gmail.com |
44549ee3f6c0750065d36e178731134d0cceaca9 | 0c9452b5cf1d0aaf25a405fcf6f0e2e75c2bbbce | /SpringBoot-tutorial/exDI/src/test/java/com/dong/ExDiApplicationTests.java | 82ec2e70c491e79f1724939f46242f32585c6372 | [] | no_license | opklnm102/spring | 708e0f17dc44a46e5605ea96af02f148ab0fea75 | 9bba55966bf3fb2bb9c99de1e2c3bb19644ff114 | refs/heads/master | 2020-12-11T03:37:34.729412 | 2017-02-06T11:30:37 | 2017-02-06T11:30:37 | 68,808,621 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 402 | java | package com.dong;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.SpringApplicationConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(classes = ExDiApplication.class)
public class ExDiApplicationTests {
@Test
public void contextLoads() {
}
}
| [
"opklnm102@gmail.com"
] | opklnm102@gmail.com |
9f267338b70218353cf71e49bcb8c62ad38561bb | f378ddd47c8b7de6e9cf1d4228c84f73e9dc59f1 | /projetos/TankGame/Resources/DontSynchronize.java | 3d57729652d59137f380ee042609a4dcb29ca107 | [] | no_license | charles-marques/dataset-375 | 29e2f99ac1ba323f8cb78bf80107963fc180487c | 51583daaf58d5669c69d8208b8c4ed4e009001a5 | refs/heads/master | 2023-01-20T07:23:09.445693 | 2020-11-27T22:35:49 | 2020-11-27T22:35:49 | 283,315,149 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 608 | java | package Resources;
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* Marks that the annotated method can safely be *not* marked synchronized.
*
* Valid unit consistency tests should mark any annotated methods which are
* synchronized as incorrect.
*
* @author harrison
*/
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.CLASS)
public @interface DontSynchronize {
}
| [
"suporte@localhost.localdomain"
] | suporte@localhost.localdomain |
995edfe3ea41129f2715d04f67f1251872ec3d1c | fe430ee2057016eed1f20b07ca0275f4992e8800 | /gwt/src/main/java/org/seamless/gwt/component/client/widget/BlacklistEventTranslator.java | 1ae8dab87f60f14c6fb7103ca1de244f9224c3a9 | [] | no_license | videonrooster/seamless | f39de38fd316af78d0af2a806e3af7d6450c9150 | e33b558c8cfd544a90d847242b7a579a86e3047c | refs/heads/master | 2021-01-15T20:37:58.491596 | 2012-02-21T22:08:08 | 2012-02-21T22:08:08 | 3,508,058 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,674 | java | /*
* Copyright (C) 2011 4th Line GmbH, Switzerland
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.seamless.gwt.component.client.widget;
import com.google.gwt.view.client.CellPreviewEvent;
import com.google.gwt.view.client.DefaultSelectionEventManager;
import java.util.HashSet;
import java.util.Set;
public class BlacklistEventTranslator<T> implements DefaultSelectionEventManager.EventTranslator<T> {
private final Set<Integer> blacklist = new HashSet<Integer>();
/**
* Construct a new {@link BlacklistEventTranslator}.
*
* @param blacklistedColumns the columns to blacklist
*/
public BlacklistEventTranslator(int... blacklistedColumns) {
if (blacklistedColumns != null) {
for (int i : blacklistedColumns) {
setColumnBlacklisted(i, true);
}
}
}
/**
* Clear all columns from the blacklist.
*/
public void clearBlacklist() {
blacklist.clear();
}
public boolean clearCurrentSelection(CellPreviewEvent<T> event) {
return false;
}
/**
* Check if the specified column is blacklisted.
*
* @param index the column index
* @return true if blacklisted, false if not
*/
public boolean isColumnBlacklisted(int index) {
return blacklist.contains(index);
}
/**
* Set whether or not the specified column in blacklisted.
*
* @param index the column index
* @param isBlacklisted true to blacklist, false to allow selection
*/
public void setColumnBlacklisted(int index, boolean isBlacklisted) {
if (isBlacklisted) {
blacklist.add(index);
} else {
blacklist.remove(index);
}
}
public DefaultSelectionEventManager.SelectAction translateSelectionEvent(CellPreviewEvent<T> event) {
return isColumnBlacklisted(event.getColumn()) ? DefaultSelectionEventManager.SelectAction.IGNORE
: DefaultSelectionEventManager.SelectAction.DEFAULT;
}
} | [
"cb@4thline.com"
] | cb@4thline.com |
ef93bbfea7704fcc875a01e5c1b45df319d51afe | 3f845730d07e3e1f847dc285905e77a132d6edcc | /src/main/java/factoryMethod/ejercicioTarea4/PasajeEstandar.java | 918fcc7c253c167de0278b9860f1a9812800ca68 | [] | no_license | AleChirinos/Todo-DP | 2d4911e2910e8f7a2418cd81004352337659c16c | c076cb66c9eb5395c8448081249585e53f892ef4 | refs/heads/main | 2023-06-08T14:19:18.364102 | 2021-07-01T06:12:10 | 2021-07-01T06:12:10 | 372,260,222 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,026 | java | package factoryMethod.ejercicioTarea4;
public class PasajeEstandar implements IPasaje{
private String numeroDeVuelo;
private String numeroDeAsiento;
private String costoDelPasaje;
private Destino destino;
private Origen origen;
private Avion avion;
private Pasajero pasajero;
public PasajeEstandar(){
destino = new Destino();
origen = new Origen();
avion = new Avion();
pasajero = new Pasajero();
}
@Override
public void crear() {
System.out.println("Pasaje estandar - numero de vuelo: " + numeroDeVuelo);
System.out.println("Pasaje estandar - numero de asiento: " + numeroDeAsiento);
System.out.println("Pasaje estandar - costo: " + costoDelPasaje);
destino.showInfo();
origen.showInfo();
avion.showInfo();
pasajero.showInfo();
}
public String getNumeroDeVuelo() {
return numeroDeVuelo;
}
public void setNumeroDeVuelo(String numeroDeVuelo) {
this.numeroDeVuelo = numeroDeVuelo;
}
public String getNumeroDeAsiento() {
return numeroDeAsiento;
}
public void setNumeroDeAsiento(String numeroDeAsiento) {
this.numeroDeAsiento = numeroDeAsiento;
}
public String getCostoDelPasaje() {
return costoDelPasaje;
}
public void setCostoDelPasaje(String costoDelPasaje) {
this.costoDelPasaje = costoDelPasaje;
}
public Destino getDestino() {
return destino;
}
public void setDestino(Destino destino) {
this.destino = destino;
}
public Origen getOrigen() {
return origen;
}
public void setOrigen(Origen origen) {
this.origen = origen;
}
public Avion getAvion() {
return avion;
}
public void setAvion(Avion avion) {
this.avion = avion;
}
public Pasajero getPasajero() {
return pasajero;
}
public void setPasajero(Pasajero pasajero) {
this.pasajero = pasajero;
}
}
| [
"alejandra.chirinos2702@gmail.com"
] | alejandra.chirinos2702@gmail.com |
89093ca24e81b6f0bd24bad3927d83cd8e23179a | 777d41c7dc3c04b17dfcb2c72c1328ea33d74c98 | /DongCi_Android/app/src/main/java/com/wmlive/hhvideo/heihei/record/widget/IProgressBar.java | 8f63a5bab915f40b63edf6570cb015650f2d13c6 | [] | no_license | foryoung2018/videoedit | 00fc132c688be6565efb373cae4564874f61d52a | 7a316996ce1be0f08dbf4c4383da2c091447c183 | refs/heads/master | 2020-04-08T04:56:42.930063 | 2018-11-25T14:27:43 | 2018-11-25T14:27:43 | 159,038,966 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,721 | java | package com.wmlive.hhvideo.heihei.record.widget;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.PaintFlagsDrawFilter;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.view.View;
/**
* 进度条的base
* Created by JIAN on 2017/5/15.
*/
public class IProgressBar extends View {
protected int mMax = 1000, mMin = 0;
protected int mProgress = 0;
/**
* 总时长
*/
protected int duration = mMax;
public IProgressBar(Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
}
/**
* 设置运行的时间轴
*
* @param mduration
*/
public void setDuration(int mduration) {
duration = mduration;
if (mMax >= duration) {
mMax = duration;
}
invalidate();
}
/**
* 获取时间轴的总时间
*
* @return
*/
public int getDuration() {
return duration;
}
/**
* 时间进度转为像素
*
* @param progress
* @return
*/
protected int progressTodp(int progress) {
return (int) (getWidth() * ((progress + 0.0f) / duration));
}
/**
* 设置最小最大时间区间值
*
* @param min
* @param max
*/
public void setInterval(int min, int max) {
mMin = min;
if (max < mMin) {
max = mMin;
}
mMax = max;
if (duration < max) {
duration = max;
}
// Log.e("setInterval", "setInterval: "+mProgress );
mProgress = 0;
invalidate();
}
/**
* 设置最小
*
* @param min
*/
public void setMin(int min) {
mMin = Math.min(min, mMax);
invalidate();
}
public int getMin() {
return mMin;
}
public int getMax() {
return mMax;
}
/**
* 更新进度
*
* @param progress
*/
public void setProgress(int progress) {
// Log.e("setProgress", "setProgress: " + progress + "........" + (progress - mProgress));
mProgress = progress;
// Log.e("setProgress", "setProgress: "+mProgress);
invalidate();
}
/**
* 获取当前进度
*
* @return
*/
public int getProgress() {
return mProgress;
}
private PaintFlagsDrawFilter filter = new PaintFlagsDrawFilter(0, Paint.ANTI_ALIAS_FLAG
| Paint.FILTER_BITMAP_FLAG);
@Override
protected void onDraw(Canvas canvas) {
canvas.setDrawFilter(filter);
}
/**
* 释放资源
*/
public void recycle() {
}
}
| [
"1184394624@qq.com"
] | 1184394624@qq.com |
2f93c4d8cd0b0ef52a2e4d3dfdb21da5e1bc35d5 | 13ea5da0b7b8d4ba87d622a5f733dcf6b4c5f1e3 | /crash-reproduction-new-fitness/results/LANG-2b-1-13-Single_Objective_GGA-IntegrationSingleObjective-BasicBlockCoverage-opt/org/apache/commons/lang3/LocaleUtils_ESTest_scaffolding.java | d5cd68d339ecfdd4d161d634da4b354d3c758783 | [
"MIT",
"CC-BY-4.0"
] | permissive | STAMP-project/Botsing-basic-block-coverage-application | 6c1095c6be945adc0be2b63bbec44f0014972793 | 80ea9e7a740bf4b1f9d2d06fe3dcc72323b848da | refs/heads/master | 2022-07-28T23:05:55.253779 | 2022-04-20T13:54:11 | 2022-04-20T13:54:11 | 285,771,370 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,976 | java | /**
* Scaffolding file used to store all the setups needed to run
* tests automatically generated by EvoSuite
* Fri Oct 29 04:22:13 UTC 2021
*/
package org.apache.commons.lang3;
import org.evosuite.runtime.annotation.EvoSuiteClassExclude;
import org.junit.BeforeClass;
import org.junit.Before;
import org.junit.After;
@EvoSuiteClassExclude
public class LocaleUtils_ESTest_scaffolding {
@org.junit.Rule
public org.evosuite.runtime.vnet.NonFunctionalRequirementRule nfr = new org.evosuite.runtime.vnet.NonFunctionalRequirementRule();
private org.evosuite.runtime.thread.ThreadStopper threadStopper = new org.evosuite.runtime.thread.ThreadStopper (org.evosuite.runtime.thread.KillSwitchHandler.getInstance(), 3000);
@BeforeClass
public static void initEvoSuiteFramework() {
org.evosuite.runtime.RuntimeSettings.className = "org.apache.commons.lang3.LocaleUtils";
org.evosuite.runtime.GuiSupport.initialize();
org.evosuite.runtime.RuntimeSettings.maxNumberOfIterationsPerLoop = 10000;
org.evosuite.runtime.RuntimeSettings.mockSystemIn = true;
org.evosuite.runtime.Runtime.getInstance().resetRuntime();
}
@Before
public void initTestCase(){
threadStopper.storeCurrentThreads();
threadStopper.startRecordingTime();
org.evosuite.runtime.GuiSupport.setHeadless();
org.evosuite.runtime.Runtime.getInstance().resetRuntime();
org.evosuite.runtime.agent.InstrumentingAgent.activate();
}
@After
public void doneWithTestCase(){
threadStopper.killAndJoinClientThreads();
org.evosuite.runtime.agent.InstrumentingAgent.deactivate();
org.evosuite.runtime.GuiSupport.restoreHeadlessMode();
}
private static void initializeClasses() {
org.evosuite.runtime.classhandling.ClassStateSupport.initializeClasses(LocaleUtils_ESTest_scaffolding.class.getClassLoader() ,
"org.apache.commons.lang3.LocaleUtils",
"org.apache.commons.lang3.LocaleUtils$SyncAvoid"
);
}
}
| [
"pderakhshanfar@serg2.ewi.tudelft.nl"
] | pderakhshanfar@serg2.ewi.tudelft.nl |
27bf619b1ac3dbf7d34e9645097535346a11e92d | c4976c7f24a4cf8bcc52587998d61299c0060136 | /src/test/java/me/khmoon/demoinflearnrestapi/DemoApplicationTests.java | c897d2725f4df16e37233c014137383b05678bcb | [] | no_license | mgh3326/rest-api-with-spring | 50b776e15d7aecacb56c42ec48c2c4675de3f53f | f2f54802326a3f18af9fdb0eec6975ea1e0d91c0 | refs/heads/master | 2022-07-11T13:45:51.888355 | 2019-08-19T03:16:10 | 2019-08-19T03:16:10 | 198,809,311 | 0 | 0 | null | 2019-11-30T06:26:01 | 2019-07-25T10:20:52 | Java | UTF-8 | Java | false | false | 424 | java | package me.khmoon.demoinflearnrestapi;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@SpringBootTest
@ActiveProfiles("test")
public class DemoApplicationTests {
@Test
public void contextLoads() {
}
}
| [
"mgh3326@naver.com"
] | mgh3326@naver.com |
ec603c18ae66e3d80d776eb03e12ebdaa4651ee4 | 44f1b987ddec54caf0ec5fc1ec8c8c4a410a8ca9 | /src/subarray/BestTimetoBuyandSellStockIII.java | 0ecb246e289e88880d0abba593654c95759bec1d | [] | no_license | hanrick2000/Leetcode_Lintcode_Jun | 28feb74e660986b0792db0be009553ee679a08b7 | 7f23ddc7c7d54ac29e96e9fc4c1b8b4247e6dc48 | refs/heads/master | 2021-09-15T05:50:44.437621 | 2018-05-27T11:17:43 | 2018-05-27T11:17:43 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,319 | java | package subarray;
import java.util.Arrays;
/**
* at most two transactions.
*
* Given an example [4,4,6,1,1,4,2,5], return 6.
*
* http://liangjiabin.com/blog/2015/04/leetcode-best-time-to-buy-and-sell-stock.
* html
*
*/
public class BestTimetoBuyandSellStockIII {
public static void main(String[] args) {
int nums[] = { 1, 2 };
System.out.println(maxProfit2(nums));
}
/**
* 思路: http://www.cnblogs.com/springfor/p/3877068.html
*
* 根据题目要求,最多进行两次买卖股票,而且手中不能有2只股票,就是不能连续两次买入操作。
*
* 所以,两次交易必须是分布在2各区间内,也就是动作为:买入卖出,买入卖出。
*
* 进而,我们可以划分为2个区间[0,i]和[i,len-1],i可以取0~len-1。
*
* 那么两次买卖的最大利润为:在两个区间的最大利益和的最大利润。
*
* 一次划分的最大利益为:Profit[i] = MaxProfit(区间[0,i]) + MaxProfit(区间[i,len-1]);
*
* 最终的最大利润为:MaxProfit(Profit[0], Profit[1], Profit[2], ... , Profit[len-1])。
* 即,表示不同的分割点
*
*/
/**
*
* 动态规划法。以第i天为分界线,计算第i天之前进行一次交易的最大收益preProfit[i],和第i天之后进行一次交易的最大收益postProfit
* [i],最后遍历一遍,max{preProfit[i] + postProfit[i]}
* (0≤i≤n-1)就是最大收益。第i天之前和第i天之后进行一次的最大收益求法同Best Time to Buy and Sell Stock I。
*
*
* http://www.programcreek.com/2014/02/leetcode-best-time-to-buy-and-sell-
* stock-iii-java/
*
* ONLY 2 transactions to 2. This can be solve by "devide and conquer".
*
* left[i] to track the maximum profit for transactions before i 天
*
* right[i] to track the maximum profit for transactions after i 天. You can
* use the following example to understand the Java solution:
*
* Prices: 1 4 5 7 6 3 2 9
*
* left = [0, 3, 4, 6, 6, 6, 6, 8]
*
* right= [8, 7, 7, 7, 7, 7, 7, 0]
*
* The maximum profit = 13 (7+6)
*/
public static int maxProfit2(int[] prices) {
/**
* 注意: prices.length < 2
*/
if (prices == null || prices.length < 2) {
return 0;
}
// highest profit in 0 ... i,record max profit before i
int[] left = new int[prices.length];
// highest profit in i.... len-1, record max profit after i
int[] right = new int[prices.length];
// DP from left to right,
/**
* 注意:left[0] = 0; 之前写错了, 第一天的profit只能为0
*
* 该子过程就是BestTimetoBuyandSellStockI里面的DP方法, 这不过这里要保留整个数组计算,最后要尝试不同的组合
*/
left[0] = 0;
int min = prices[0];
for (int i = 1; i < prices.length; i++) {
min = Math.min(min, prices[i]);
left[i] = Math.max(left[i - 1], prices[i] - min);
}
// DP from right to left
/**
* 注意:right[prices.length - 1] = 0;; 之前写错了
*/
right[prices.length - 1] = 0;
int max = prices[prices.length - 1];
for (int i = prices.length - 2; i >= 0; i--) {
max = Math.max(max, prices[i]);
right[i] = Math.max(right[i + 1], max - prices[i]);
}
/**
* 注意最后处理时下标时候,和MaximumSubarrayII.java不同
*
* 在第i天时, 对于left, right两个方向上,有一个方向是没有transaction的,
* 虽然对应的数组[i]不为0,体现在,那个值是从前一天挪过来的,(在填DP数组时候)
*
* 之所以写成 profit = Math.max(profit, left[i] + right[i]);
* 是因为,在第i天有可能有操作,但是我不知道,在哪个方向是没有操作的
*
* DP 数组,只保存到目前为止天数的最大收益,而没有保存某天是否有transaction, 所以对于题目要求求最大值,这么加起来不影响
*
* 比如3 2 1 2 3 4 5 6 5
* 4,这种情况肯定是只取1到6这一段收益最大,任何其他的方法收益都比这个小,而这时的left和right在前后两段递减序列里都是0
*
*/
System.out.println(Arrays.toString(left));
System.out.println(Arrays.toString(right));
int profit = 0;
for (int i = 0; i < prices.length; i++) {
profit = Math.max(profit, left[i] + right[i]);
}
return profit;
}
}
| [
"jungan@juns-mbp.torolab.ibm.com"
] | jungan@juns-mbp.torolab.ibm.com |
b97d0987f0716b45f1c2b391cdde9a78b4fa7159 | 0a52db43ded97fffc5b47a008aaeb01fb82c6c31 | /jumper-hospital-admin/src/main/java/com/jumper/hospital/vo/school/VoAppointList.java | f30e95d32a7d4ccfce808e53b85dbd3bb0b389b0 | [] | no_license | cash2one/hospitalAdmin | a31436f3d8f242eb94ddb4f87946bc8026b7bd42 | 3c3c7cfc378920cb8db2d9eea4ac8bfdd558b967 | refs/heads/master | 2021-07-12T08:17:50.414571 | 2017-10-10T02:28:35 | 2017-10-10T02:28:35 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,621 | java | package com.jumper.hospital.vo.school;
import com.jumper.hospital.enums.SchoolAppointState;
import com.jumper.hospital.enums.SchoolSignState;
public class VoAppointList {
/** 课程名称 **/
private String appointCourseName;
/** 授课医师 **/
private String appointCourseDoctor;
/** 学员姓名 **/
private String appointUserName;
/** 孕周 **/
private String userWeek;
/** 预约用户手机号码 **/
private String appointUserPhone;
/** 用户预约时间 **/
private String userAppointTime;
/** 预约状态:0,预约成功,1,已取消,2,已完成,3,已过期 **/
private SchoolAppointState appointState;
/** 用户签到时间 **/
private String userSignTime;
/** 签到状态:0,未签到,1,已签到 **/
private SchoolSignState signState;
/** 缴费状态:0,未缴费,1,已缴费 ,2,已退费**/
private String payState;
public VoAppointList(String payState) {
this.payState = payState;
}
public VoAppointList() {
}
public String getAppointUserName() {
return appointUserName;
}
public void setAppointUserName(String appointUserName) {
this.appointUserName = appointUserName;
}
public String getUserWeek() {
return userWeek;
}
public void setUserWeek(String userWeek) {
this.userWeek = userWeek;
}
public String getAppointUserPhone() {
return appointUserPhone;
}
public void setAppointUserPhone(String appointUserPhone) {
this.appointUserPhone = appointUserPhone;
}
public String getUserAppointTime() {
return userAppointTime;
}
public void setUserAppointTime(String userAppointTime) {
this.userAppointTime = userAppointTime;
}
public SchoolAppointState getAppointState() {
return appointState;
}
public void setAppointState(SchoolAppointState appointState) {
this.appointState = appointState;
}
public String getUserSignTime() {
return userSignTime;
}
public void setUserSignTime(String userSignTime) {
this.userSignTime = userSignTime;
}
public SchoolSignState getSignState() {
return signState;
}
public void setSignState(SchoolSignState signState) {
this.signState = signState;
}
public String getPayState() {
return payState;
}
public void setPayState(String payState) {
this.payState = payState;
}
public String getAppointCourseName() {
return appointCourseName;
}
public void setAppointCourseName(String appointCourseName) {
this.appointCourseName = appointCourseName;
}
public String getAppointCourseDoctor() {
return appointCourseDoctor;
}
public void setAppointCourseDoctor(String appointCourseDoctor) {
this.appointCourseDoctor = appointCourseDoctor;
}
}
| [
"1365018743@qq.com"
] | 1365018743@qq.com |
b6103ac603d901ac27066aef12e9ff5eca60e96b | e5e048f1716e5d8e92023b6a9d4f80d9e6bd366b | /src/main/java/com/opengamma/analytics/financial/equity/future/pricing/DividendYieldFuturesCalculator.java | 3d731e9c045d288a29ffb68f9832bf27fb3dd3d3 | [
"Apache-2.0"
] | permissive | jerome79/Analytics | e4dd03ae9d95a67f7ff36fb75bd5e268b87f2547 | 71ab1c7a88ed851c50a8de87af000155666f4894 | refs/heads/master | 2020-04-09T17:24:30.623733 | 2015-08-17T10:01:27 | 2015-08-17T10:01:27 | 42,441,934 | 1 | 0 | null | 2015-09-14T10:19:57 | 2015-09-14T10:19:56 | null | UTF-8 | Java | false | false | 4,886 | java | /**
* Copyright (C) 2012 - present by OpenGamma Inc. and the OpenGamma group of companies
*
* Please see distribution for license.
*/
package com.opengamma.analytics.financial.equity.future.pricing;
import com.opengamma.analytics.financial.equity.future.derivative.EquityFuture;
import com.opengamma.analytics.financial.equity.future.derivative.EquityIndexDividendFuture;
import com.opengamma.analytics.financial.interestrate.InstrumentDerivativeVisitorAdapter;
import com.opengamma.analytics.financial.simpleinstruments.pricing.SimpleFutureDataBundle;
import com.opengamma.strata.collect.ArgChecker;
/**
*
*/
public abstract class DividendYieldFuturesCalculator extends InstrumentDerivativeVisitorAdapter<SimpleFutureDataBundle, Double> {
/* package */DividendYieldFuturesCalculator() {
}
@Override
public Double visitEquityFuture(final EquityFuture future, final SimpleFutureDataBundle dataBundle) {
ArgChecker.notNull(future, "future");
ArgChecker.notNull(dataBundle, "data bundle");
return getResult(dataBundle, future.getStrike(), future.getUnitAmount(), future.getTimeToSettlement());
}
@Override
public Double visitEquityIndexDividendFuture(final EquityIndexDividendFuture future, final SimpleFutureDataBundle dataBundle) {
ArgChecker.notNull(future, "future");
ArgChecker.notNull(dataBundle, "data bundle");
return getResult(dataBundle, future.getStrike(), future.getUnitAmount(), future.getTimeToSettlement());
}
abstract double getResult(SimpleFutureDataBundle dataBundle, double strike, double unitAmount, double t);
/**
* Calculates the present value
*/
public static final class PresentValueCalculator extends DividendYieldFuturesCalculator {
private static final PresentValueCalculator INSTANCE = new PresentValueCalculator();
public static PresentValueCalculator getInstance() {
return INSTANCE;
}
private PresentValueCalculator() {
}
@Override
double getResult(final SimpleFutureDataBundle dataBundle, final double strike, final double unitAmount, final double t) {
return (dataBundle.getMarketPrice() - strike) * unitAmount;
}
}
/**
* Calculates the spot delta
*/
public static final class SpotDeltaCalculator extends DividendYieldFuturesCalculator {
private static final SpotDeltaCalculator INSTANCE = new SpotDeltaCalculator();
public static SpotDeltaCalculator getInstance() {
return INSTANCE;
}
private SpotDeltaCalculator() {
}
@Override
double getResult(final SimpleFutureDataBundle dataBundle, final double strike, final double unitAmount, final double t) {
return unitAmount;
}
}
/**
* Calculates the rates delta
*/
public static final class RatesDeltaCalculator extends DividendYieldFuturesCalculator {
private static final RatesDeltaCalculator INSTANCE = new RatesDeltaCalculator();
public static RatesDeltaCalculator getInstance() {
return INSTANCE;
}
private RatesDeltaCalculator() {
}
@Override
double getResult(final SimpleFutureDataBundle dataBundle, final double strike, final double unitAmount, final double t) {
return t * dataBundle.getMarketPrice() * unitAmount;
}
}
/**
* Calculates the pv01
*/
public static final class PV01Calculator extends DividendYieldFuturesCalculator {
private static final PV01Calculator INSTANCE = new PV01Calculator();
public static PV01Calculator getInstance() {
return INSTANCE;
}
private PV01Calculator() {
}
@Override
double getResult(final SimpleFutureDataBundle dataBundle, final double strike, final double unitAmount, final double t) {
return RatesDeltaCalculator.getInstance().getResult(dataBundle, strike, unitAmount, t) / 10000;
}
}
/**
* Gets the spot price
*/
public static final class SpotPriceCalculator extends DividendYieldFuturesCalculator {
private static final SpotPriceCalculator INSTANCE = new SpotPriceCalculator();
public static SpotPriceCalculator getInstance() {
return INSTANCE;
}
private SpotPriceCalculator() {
}
@Override
double getResult(final SimpleFutureDataBundle dataBundle, final double strike, final double unitAmount, final double t) {
return dataBundle.getSpotValue();
}
}
/**
* Gets the forward price
*/
public static final class ForwardPriceCalculator extends DividendYieldFuturesCalculator {
private static final ForwardPriceCalculator INSTANCE = new ForwardPriceCalculator();
public static ForwardPriceCalculator getInstance() {
return INSTANCE;
}
private ForwardPriceCalculator() {
}
@Override
double getResult(final SimpleFutureDataBundle dataBundle, final double strike, final double unitAmount, final double t) {
return dataBundle.getMarketPrice();
}
}
}
| [
"stephen@opengamma.com"
] | stephen@opengamma.com |
d3a7438c020bef817b5a47fedd9735df555951f0 | 34f8d4ba30242a7045c689768c3472b7af80909c | /JDK-18-ea31/src/jdk.localedata/sun/util/resources/cldr/ext/CurrencyNames_ur_IN.java | 733ed83f331bf9fb70c693df0080aed5cce4c585 | [
"Apache-2.0"
] | permissive | lovelycheng/JDK | 5b4cc07546f0dbfad15c46d427cae06ef282ef79 | 19a6c71e52f3ecd74e4a66be5d0d552ce7175531 | refs/heads/master | 2023-04-08T11:36:22.073953 | 2022-09-04T01:53:09 | 2022-09-04T01:53:09 | 227,544,567 | 0 | 0 | null | 2019-12-12T07:18:30 | 2019-12-12T07:18:29 | null | UTF-8 | Java | false | false | 4,186 | java | /*
* Copyright (c) 2012, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code 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
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* COPYRIGHT AND PERMISSION NOTICE
*
* Copyright (c) 1991-2020 Unicode, Inc. All rights reserved.
* Distributed under the Terms of Use in https://www.unicode.org/copyright.html.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of the Unicode data files and any associated documentation
* (the "Data Files") or Unicode software and any associated documentation
* (the "Software") to deal in the Data Files or Software
* without restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, and/or sell copies of
* the Data Files or Software, and to permit persons to whom the Data Files
* or Software are furnished to do so, provided that either
* (a) this copyright and permission notice appear with all copies
* of the Data Files or Software, or
* (b) this copyright and permission notice appear in associated
* Documentation.
*
* THE DATA FILES AND SOFTWARE ARE 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 OF THIRD PARTY RIGHTS.
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS
* NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL
* DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THE DATA FILES OR SOFTWARE.
*
* Except as contained in this notice, the name of a copyright holder
* shall not be used in advertising or otherwise to promote the sale,
* use or other dealings in these Data Files or Software without prior
* written authorization of the copyright holder.
*/
package sun.util.resources.cldr.ext;
import sun.util.resources.OpenListResourceBundle;
public class CurrencyNames_ur_IN extends OpenListResourceBundle {
@Override
protected final Object[][] getContents() {
final Object[][] data = new Object[][] {
{ "PKR", "PKR" },
{ "crc", "\u06a9\u0648\u0633\u0679\u0627 \u0631\u06cc\u06a9\u0627 \u06a9\u0648\u0644\u0648\u0646" },
{ "cuc", "\u0642\u0627\u0628\u0644 \u0645\u0646\u062a\u0642\u0644\u06cc \u06a9\u06cc\u0648\u0628\u0627\u0626\u06cc \u067e\u06cc\u0633\u0648" },
{ "cup", "\u06a9\u06cc\u0648\u0628\u0627\u0626\u06cc \u067e\u06cc\u0633\u0648" },
{ "cve", "\u06a9\u06cc\u067e \u0648\u0631\u0688\u06cc \u0627\u0633\u06a9\u06cc\u0648\u0688\u0648" },
{ "gbp", "\u0628\u0631\u0637\u0627\u0646\u0648\u06cc \u067e\u0627\u0648\u0646\u0688 \u0633\u0679\u0631\u0644\u0646\u06af" },
{ "ghs", "\u06af\u06be\u0627\u0646\u06cc \u0633\u06cc\u0688\u06cc" },
{ "wst", "\u0633\u0627\u0645\u0648\u0622\u0626\u06cc \u0679\u0627\u0644\u0627" },
};
return data;
}
}
| [
"zeng255@163.com"
] | zeng255@163.com |
aba6521f43f2d7ebc2648032cb7cb86c23f7bbad | baacb864fdf73bb8f88afb0eeff190ad86c8c221 | /JC_Client/src/controllerservice/user/FriendControllerService.java | bfe585aee67f92aee75c6af78fc27842f39d6deb | [] | no_license | SeniYuting/Elimination | c0c9e5d0bb85e7d0408076ddcd449a7a40224f17 | 2dd3547d0e4b60f9a75e3b06923d18f3341d376d | refs/heads/master | 2020-03-29T09:09:49.099319 | 2017-06-18T06:41:59 | 2017-06-18T06:41:59 | 94,669,924 | 0 | 0 | null | null | null | null | WINDOWS-1252 | Java | false | false | 700 | java | package controllerservice.user;
import java.util.ArrayList;
/**
* <code><b>FriendControllerService</b></code> contains components about handling friends' issues
*
* @author Åô·É
*
*/
public interface FriendControllerService {
/**
* Contact the <code><b>FriendControllerService</code></b> to getOnlineFriends.
* @see InviteFriendPanel
* @param userName
* @return
*/
public abstract ArrayList<String> getOnlineFriends(String userName);
/**
* Contact the <code><b>FriendControllerService</code></b> to setFriendRequest.
* @see InviteFriendPanel
* @param userName,friendName
* @return
*/
public abstract void setFriendRequest(String userName, String friendName);
}
| [
"2580238659@qq.com"
] | 2580238659@qq.com |
b228f28e6f73684214350e380215f174808b0460 | c172a08411eba60e810ee1ac8632f0176c2981c7 | /src/main/java/aula20191001/proxy_dinâmico/ArrayListProxyConvencional.java | 267dc58e0268564021cbb8ee6f11f2d6a2a014db | [] | no_license | aczavads/4esoft2019-progr-III | c7ea75b510601033bf7b39375d61f29a423336c6 | 2eb137d29c61f9e4895d36997da86136ca18bdda | refs/heads/master | 2020-04-24T00:48:51.067341 | 2019-11-06T00:32:22 | 2019-11-06T00:32:22 | 171,576,920 | 5 | 2 | null | null | null | null | ISO-8859-13 | Java | false | false | 2,871 | java | package aula20191001.proxy_dināmico;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;
public class ArrayListProxyConvencional<E> implements List<E> {
private ArrayList<E> arrayListVerdadeiro;
private int contador;
public ArrayListProxyConvencional(ArrayList<E> arrayListVerdadeiro) {
this.arrayListVerdadeiro = arrayListVerdadeiro;
}
@Override
public boolean add(E arg0) {
return arrayListVerdadeiro.add(arg0);
}
@Override
public void add(int arg0, E arg1) {
arrayListVerdadeiro.add(arg0, arg1);
}
@Override
public boolean addAll(Collection<? extends E> arg0) {
// TODO Auto-generated method stub
return false;
}
@Override
public boolean addAll(int arg0, Collection<? extends E> arg1) {
// TODO Auto-generated method stub
return false;
}
@Override
public void clear() {
// TODO Auto-generated method stub
}
@Override
public boolean contains(Object arg0) {
// TODO Auto-generated method stub
return false;
}
@Override
public boolean containsAll(Collection<?> arg0) {
// TODO Auto-generated method stub
return false;
}
@Override
public E get(int arg0) {
// TODO Auto-generated method stub
return null;
}
@Override
public int indexOf(Object arg0) {
// TODO Auto-generated method stub
return 0;
}
@Override
public boolean isEmpty() {
// TODO Auto-generated method stub
return false;
}
@Override
public Iterator<E> iterator() {
// TODO Auto-generated method stub
return null;
}
@Override
public int lastIndexOf(Object arg0) {
// TODO Auto-generated method stub
return 0;
}
@Override
public ListIterator<E> listIterator() {
// TODO Auto-generated method stub
return null;
}
@Override
public ListIterator<E> listIterator(int arg0) {
// TODO Auto-generated method stub
return null;
}
@Override
public boolean remove(Object arg0) {
contador++;
return arrayListVerdadeiro.remove(arg0);
}
@Override
public E remove(int arg0) {
contador++;
return arrayListVerdadeiro.remove(arg0);
}
@Override
public boolean removeAll(Collection<?> arg0) {
// TODO Auto-generated method stub
return false;
}
@Override
public boolean retainAll(Collection<?> arg0) {
// TODO Auto-generated method stub
return false;
}
@Override
public E set(int arg0, E arg1) {
// TODO Auto-generated method stub
return null;
}
@Override
public int size() {
return arrayListVerdadeiro.size();
}
@Override
public List<E> subList(int arg0, int arg1) {
// TODO Auto-generated method stub
return null;
}
@Override
public Object[] toArray() {
// TODO Auto-generated method stub
return null;
}
@Override
public <T> T[] toArray(T[] arg0) {
// TODO Auto-generated method stub
return null;
}
public int getContador() {
return contador;
}
}
| [
"aczavads@gmail.com"
] | aczavads@gmail.com |
e8a0acf67cba51adc7c0df4d3dd324073864e718 | ab6c3626364b835f23df13ec6f9de2b80d99a887 | /sos-commons/sos-commons-credentialstore/src/main/java/com/sos/commons/credentialstore/keepass/db/kdbx/ASOSKdbxHandler.java | a0d8e7f1d5bd1f62fdad9ec675a50dc8970b11be | [] | no_license | sos-berlin/sos-components | e0a2b05b2cadd97dceb20f0322d13a869ad7a644 | 865506c880f39af38c22491b68bda8385d74f08a | refs/heads/master | 2023-08-30T01:40:05.968297 | 2023-08-29T16:06:32 | 2023-08-29T16:06:32 | 116,804,720 | 0 | 0 | null | 2023-02-07T11:48:42 | 2018-01-09T10:59:58 | Java | UTF-8 | Java | false | false | 6,164 | java | package com.sos.commons.credentialstore.keepass.db.kdbx;
import java.io.FileOutputStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.Date;
import java.util.List;
import org.linguafranca.pwdb.Database;
import org.linguafranca.pwdb.Entry;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.sos.commons.credentialstore.keepass.SOSKeePassDatabase;
import com.sos.commons.credentialstore.keepass.SOSKeePassPath;
import com.sos.commons.credentialstore.keepass.db.ASOSKeePassHandler;
import com.sos.commons.credentialstore.keepass.db.kdbx.credentials.SOSKdbxCreds;
import com.sos.commons.credentialstore.keepass.exceptions.SOSKeePassAttachmentException;
import com.sos.commons.credentialstore.keepass.exceptions.SOSKeePassDatabaseException;
public abstract class ASOSKdbxHandler extends ASOSKeePassHandler {
private static final Logger LOGGER = LoggerFactory.getLogger(ASOSKdbxHandler.class);
protected abstract Database<?, ?, ?, ?> load() throws SOSKeePassDatabaseException;
protected abstract Entry<?, ?, ?, ?> createEntry(String[] entryPath) throws SOSKeePassDatabaseException;
@Override
public boolean isKdbx() {
return true;
}
@Override
public void load(String pass, Path keyFile) throws SOSKeePassDatabaseException {
if (LOGGER.isDebugEnabled()) {
LOGGER.debug(String.format("[load]%s", SOSKeePassDatabase.getFilePath(getKeePassFile())));
}
setCredentials(pass, keyFile);
setDatabase(load());
}
@Override
public List<? extends Entry<?, ?, ?, ?>> getEntries() {
if (getDatabase() == null) {
return null;
}
return getDatabase().findEntries("");
}
@Override
public Entry<?, ?, ?, ?> getEntryByPath(String path) {
if (getDatabase() == null || path == null) {
return null;
}
List<? extends Entry<?, ?, ?, ?>> l = getDatabase().findEntries(new Entry.Matcher() {
public boolean matches(@SuppressWarnings("rawtypes") Entry entry) {
String p = path.startsWith("/") ? path : "/" + path;
return entry.getPath().equals(p);
}
});
return l == null || l.size() == 0 ? null : l.get(0);
}
@Override
public byte[] getBinaryProperty(Entry<?, ?, ?, ?> entry, String propertyName) throws SOSKeePassAttachmentException {
try {
if (propertyName == null) {
List<String> l = entry.getBinaryPropertyNames();
if (l != null && l.size() > 0) {
String fa = l.get(0);
if (LOGGER.isDebugEnabled()) {
LOGGER.debug(String.format("[getBinaryProperty][%s][first BinaryProperty]%s", entry.getPath(), fa));
}
return entry.getBinaryProperty(fa);
}
} else {
if (LOGGER.isDebugEnabled()) {
LOGGER.debug(String.format("[getBinaryProperty][%s][BinaryProperty]%s", entry.getPath(), propertyName));
}
return entry.getBinaryProperty(propertyName);
}
} catch (Throwable e) {
throw new SOSKeePassAttachmentException(e);
}
return null;
}
@Override
public Entry<?, ?, ?, ?> setBinaryProperty(SOSKeePassPath path, Entry<?, ?, ?, ?> entry, Path attachment) throws SOSKeePassAttachmentException {
String method = "setBinaryProperty";
if (Files.notExists(attachment)) {
throw new SOSKeePassAttachmentException(String.format("[%s]attachment file not founded", SOSKeePassDatabase.getFilePath(attachment)));
}
String propertyName = SOSKeePassDatabase.getBinaryPropertyName(path, attachment);
if (LOGGER.isDebugEnabled()) {
LOGGER.debug(String.format("[%s][%s][%s]%s", method, path.getEntry(), propertyName, attachment));
}
try {
entry.setBinaryProperty(propertyName, Files.readAllBytes(attachment));
} catch (Throwable t) {
throw new SOSKeePassAttachmentException(t);
}
return entry;
}
@Override
public Entry<?, ?, ?, ?> setProperty(Entry<?, ?, ?, ?> entry, String name, String value) {
entry.setProperty(name, value);
return entry;
}
@Override
public Entry<?, ?, ?, ?> createEntry(final String entryPath) throws SOSKeePassDatabaseException {
String method = "createEntry";
if (LOGGER.isDebugEnabled()) {
LOGGER.debug(String.format("[%s][entryPath]%s", method, entryPath));
}
String[] arr = null;
if (entryPath.startsWith("/")) {
arr = entryPath.split("/");
if (!getDatabase().getRootGroup().getName().equals(arr[1])) {
throw new SOSKeePassDatabaseException(String.format("[%s]could't create entry. Root node not matching: %s != %s", entryPath, arr[1],
getDatabase().getRootGroup().getName()));
}
} else {
arr = new StringBuilder().append("/").append(getDatabase().getRootGroup().getName()).append("/").append(entryPath).toString().split("/");
}
return createEntry(arr);
}
@Override
public void saveAs(Path file) throws SOSKeePassDatabaseException {
if (getDatabase() == null) {
return;
}
try (FileOutputStream fos = new FileOutputStream(file.toFile())) {
getDatabase().save(getCredentials(), fos);
} catch (Throwable e) {
throw new SOSKeePassDatabaseException(e);
}
}
protected Date getNowAsUTC() {
LocalDateTime localDateTime = LocalDateTime.now(ZoneId.of("UTC"));
return Date.from(localDateTime.atZone(ZoneId.systemDefault()).toInstant());
}
protected void setCredentials(final String pass, final Path keyFile) throws SOSKeePassDatabaseException {
SOSKdbxCreds cred = new SOSKdbxCreds();
cred.load(pass, keyFile);
setCredentials(cred);
}
}
| [
"robert.ehrlich@sos-berlin.com"
] | robert.ehrlich@sos-berlin.com |
77de35f3d4f502697f2d38e7d134c5b285e50d0d | 85ce7967e4296b176b9f52f284ea95434e064f4c | /light-blog-web/src/main/java/com/lightblog/config/Constants.java | c56e2a6de2b8d0a8ee41e3aab7569560edacd1f7 | [
"Apache-2.0"
] | permissive | lwh-fork/LightBlog | 97d6b8477d13ad92f5332569a64da8a3f298acd1 | 66e7db6ded9bf8cf2dec5f6fde17ca43fcb07dd5 | refs/heads/master | 2021-08-30T06:29:07.790389 | 2017-12-16T13:42:22 | 2017-12-16T13:42:22 | 115,395,418 | 0 | 1 | null | 2017-12-26T07:01:10 | 2017-12-26T07:01:10 | null | UTF-8 | Java | false | false | 1,386 | java | package com.lightblog.config;
/**
* @Description: The constant.
* @Author: mingshan
* @Date: Created in 12:04 2017/10/14
*/
public class Constants {
/**
* The current user that has logined.
*/
public static final String CURRENT_USER_ID = "CURRENT_USER_ID";
/**
* token有效期(小时)
*/
public static final int TOKEN_EXPIRES_HOUR = 72;
/**
* 存放Authorization的header字段
*/
public static final String AUTHORIZATION = "authorization";
/**
* 成功响应
*/
public static final String RESPONSE_OK = "OK!";
/**
* 缓存需要的分隔符
*/
public static final String ELIMITER = ":";
// --------- JWT ---------------
/**
* The prefix of token
*/
public static final String TOKEN_PREFIX = "Bearer ";
/**
* JWT ID
*/
public static final String JWT_ID = "jwt";
/**
* JWT - 加密密匙
*/
public static final String JWT_SECRET = "walker";
/**
* token 保存时间
*/
public static final int JWT_TTL = 3 * 24 * 60 * 60 * 1000; //millisecond => 72 h
/**
* 刷新间隔
*/
public static final int JWT_REFRESH_INTERVAL = 55 * 60 * 1000; //millisecond
/**
* 刷新时间
*/
public static final int JWT_REFRESH_TTL = 12 * 60 * 60 * 1000; //millisecond => 12 h
}
| [
"499445428@qq.com"
] | 499445428@qq.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.