blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 7 410 | content_id stringlengths 40 40 | detected_licenses listlengths 0 51 | license_type stringclasses 2
values | repo_name stringlengths 5 132 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringlengths 4 80 | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 5.85k 684M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 22
values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 132
values | src_encoding stringclasses 34
values | language stringclasses 1
value | is_vendor bool 1
class | is_generated bool 2
classes | length_bytes int64 3 9.45M | extension stringclasses 28
values | content stringlengths 3 9.45M | authors listlengths 1 1 | author_id stringlengths 0 352 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
83c36b4715977a6a68b66b6bb19169672190d4ff | 7190b326f828ef3b7549da6e3140460d094c68bf | /src/model/fileuser/DirectoryItem.java | edbf7a2abc6a88629d6bb78d95e56a36122287cf | [] | no_license | ZeroZeroLin/pro_os | 3f2125aa72e0ccff6600d9c140c0fd1ccf2529ce | 7919a2568858e33dcc5cc4fc2acf58aaacf65dde | refs/heads/master | 2022-12-28T01:19:10.172828 | 2020-10-16T03:44:36 | 2020-10-16T03:44:36 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,027 | java | package model.fileuser;
/*
该类是文件的目录项
*/
public class DirectoryItem {
private int typeOfFile ; //文件类型,三种 0目录、1普通文件.txt、2执行文件.e 2B
//文件属性 1B 0只读文件 1系统文件 2普通文件 3目录属性 其余几位是无效位
private boolean isOnlyRead ; //只读文件
private boolean isSystemFile ; //系统文件
private boolean isFile ; //普通文件
private boolean isDirectory ; //是目录
private String fileName ;//文件名,绝对路径 3B
private int numOfStartDisk ;//起始盘号,0-255 1B
private int lengthOfFile ;//文件长度 1B
private String fileContext ; //文件的内容
//构造方法
public DirectoryItem(){
typeOfFile=-1;
}
public DirectoryItem(int typeOfFile,String fileName,boolean isSystemFile,boolean isOnlyRead,String fileContext){
this.fileName = fileName;
this.typeOfFile = typeOfFile;
this.isSystemFile = isSystemFile;
this.isOnlyRead = isOnlyRead;
this.lengthOfFile = 1;
this.numOfStartDisk = 2;
this.fileContext = fileContext;
if(typeOfFile ==0){
this.isDirectory = true;
this.isFile = false;
}
else if (typeOfFile ==1||typeOfFile==2){
this.isDirectory = false;
this.isFile = true;
}
else{
}
}
//获得实际文件名(不包含路径)的方法
public String getactFileName(){
int i = this.fileName.lastIndexOf("/");
int e = this.fileName.lastIndexOf(".");
System.out.println(i);
String actName = null;
if(i==-1){
System.out.println(i);
actName = this.fileName.substring(0);
}
else {
if(e==-1){
actName = this.fileName.substring(i+1);
}
else {
actName = this.fileName.substring(i+1,e);
}
}
return actName;
}
//更改文件名
public void changeFileName(int type,String name){
int endNum = this.fileName.lastIndexOf("/");
String path = null;
if(endNum==-1){
path = null;
}
else {
path = this.fileName.substring(0,endNum);
}
if (type==0){
fileName = path+"/"+name;
}
else if (type==1){
fileName = path+"/"+name+".t";
}
else if (type==2){
fileName = path+"/"+name+".e";
}
}
//G&&S
public String getFileContext() {
return fileContext;
}
public void setFileContext(String fileContext) {
this.fileContext = fileContext;
}
public boolean isOnlyRead() {
return isOnlyRead;
}
public void setOnlyRead(boolean onlyRead) {
isOnlyRead = onlyRead;
}
public boolean isSystemFile() {
return isSystemFile;
}
public void setSystemFile(boolean systemFile) {
isSystemFile = systemFile;
}
public boolean isFile() {
return isFile;
}
public void setFile(boolean file) {
isFile = file;
}
public boolean isDirectory() {
return isDirectory;
}
public void setDirectory(boolean directory) {
isDirectory = directory;
}
public int getTypeOfFile() {
return typeOfFile;
}
public void setTypeOfFile(int typeOfFile) {
this.typeOfFile = typeOfFile;
}
public String getFileName() {
return fileName;
}
public void setFileName(String fileName) {
this.fileName = fileName;
}
public int getNumOfStartDisk() {
return numOfStartDisk;
}
public void setNumOfStartDisk(int numOfStartDisk) {
this.numOfStartDisk = numOfStartDisk;
}
public int getLengthOfFile() {
return lengthOfFile;
}
public void setLengthOfFile(int lengthOfFile) {
this.lengthOfFile = lengthOfFile;
}
}
| [
"839395879@qq.com"
] | 839395879@qq.com |
69bf1a46664e71b7873f7a815d06f7748cc49207 | 2158950cb11bbcf1f111dc069fb37efe8afe7ea1 | /squidb/src/com/yahoo/squidb/sql/Update.java | 5264ce0da3b6d0a650be35f4b1e1cbaba28b1a52 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | taimur97/squidb | 9712d049a2eba1c31028634ed32e75c096e27499 | cd74ea6b095c7cf1dd12021e4b36b35a96359ac6 | refs/heads/master | 2020-12-02T22:36:20.610594 | 2015-04-23T17:30:57 | 2015-04-23T17:30:57 | 34,612,625 | 1 | 0 | null | 2015-04-26T13:29:31 | 2015-04-26T13:29:30 | null | UTF-8 | Java | false | false | 6,191 | java | /*
* Copyright 2015, Yahoo Inc.
* Copyrights licensed under the Apache 2.0 License.
* See the accompanying LICENSE file for terms.
*/
package com.yahoo.squidb.sql;
import android.content.ContentValues;
import com.yahoo.squidb.data.AbstractModel;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
/**
* Builder class for a SQLite UPDATE statement
*/
public class Update extends TableStatement {
private final SqlTable<?> table;
private ConflictAlgorithm conflictAlgorithm = ConflictAlgorithm.NONE;
private final Map<String, Object> valuesToUpdate = new HashMap<String, Object>();
private final List<Criterion> criterions = new ArrayList<Criterion>();
protected Update(SqlTable<?> table) {
this.table = table;
}
/**
* Construct a new Update statement on the specified {@link Table}
*/
public static Update table(Table table) {
return new Update(table);
}
/**
* Construct a new Update statement on the specified {@link View}. Note that updates on a View are only permissible
* when an INSTEAD OF Trigger is constructed on that View.
*/
public static Update table(View view) {
return new Update(view);
}
@Override
public SqlTable<?> getTable() {
return table;
}
/**
* Set the {@link ConflictAlgorithm} this statement should use if a constraint violation occurs
*
* @param conflictAlgorithm the conflictAlgorithm to use
* @return this Update object, to allow chaining method calls
*/
public Update onConflict(ConflictAlgorithm conflictAlgorithm) {
this.conflictAlgorithm = conflictAlgorithm;
invalidateCompileCache();
return this;
}
/**
* Adds a WHERE clause to this statement. Calling this method multiple times will combine all the criterions with
* AND.
*
* @param criterion A criterion to use in the where clause
* @return this Delete object, to allow chaining method calls
*/
public Update where(Criterion criterion) {
this.criterions.add(criterion);
invalidateCompileCache();
return this;
}
/**
* Update the specified column to the value provided
*
* @param column the column to set
* @param value the new value for the column
* @return this Update object, to allow chaining method calls
*/
public Update set(Property<?> column, Object value) {
if (column == null) {
throw new IllegalArgumentException("column must not be null");
}
valuesToUpdate.put(column.getExpression(), value);
invalidateCompileCache();
return this;
}
/**
* Update the specified columns to the values provided
*
* @param columns the columns to set
* @param values the new values for the columns
* @return this Update object, to allow chaining method calls
*/
public Update set(Property<?>[] columns, Object[] values) {
if (columns.length != values.length) {
throw new IllegalArgumentException("You must provide the same number of columns and values");
}
for (int i = 0; i < columns.length; i++) {
set(columns[i], values[i]);
}
invalidateCompileCache();
return this;
}
/**
* Update the specified columns to the values provided
*
* @param columns the columns to set
* @param values the new values for the columns
* @return this Update object, to allow chaining method calls
*/
public Update set(List<Property<?>> columns, List<Object> values) {
final int size = columns.size();
if (size != values.size()) {
throw new IllegalArgumentException("You must provide the same number of columns and values");
}
for (int i = 0; i < size; i++) {
set(columns.get(i), values.get(i));
}
invalidateCompileCache();
return this;
}
/**
* Set the columns and values to update based on the specified model object
*
* @return this Update object, to allow chaining method calls
*/
public Update fromTemplate(AbstractModel template) {
if (!template.isModified()) {
throw new IllegalArgumentException("Template has no values set to use for update");
}
ContentValues setValues = template.getSetValues();
for (Entry<String, Object> entry : setValues.valueSet()) {
valuesToUpdate.put(entry.getKey(), entry.getValue());
}
invalidateCompileCache();
return this;
}
@Override
protected void appendCompiledStringWithArguments(StringBuilder sql, List<Object> updateArgsBuilder) {
assertValues();
sql.append("UPDATE ");
visitConflictAlgorithm(sql);
sql.append(table.getExpression()).append(" SET ");
visitValues(sql, updateArgsBuilder);
visitWhere(sql, updateArgsBuilder);
}
private void assertValues() {
if (valuesToUpdate.isEmpty()) {
throw new IllegalStateException("No columns specified for update");
}
}
private void visitConflictAlgorithm(StringBuilder sql) {
if (ConflictAlgorithm.NONE != conflictAlgorithm) {
sql.append("OR ").append(conflictAlgorithm).append(" ");
}
}
protected void visitValues(StringBuilder sql, List<Object> updateArgsBuilder) {
boolean appendComma = false;
for (String column : valuesToUpdate.keySet()) {
if (appendComma) {
sql.append(",");
}
appendComma = true;
sql.append(column).append(" = ");
Object value = valuesToUpdate.get(column);
SqlUtils.addToSqlString(sql, updateArgsBuilder, value);
}
}
private void visitWhere(StringBuilder sql, List<Object> updateArgsBuilder) {
if (criterions.isEmpty()) {
return;
}
sql.append(" WHERE ");
SqlUtils.appendConcatenatedCompilables(criterions, sql, updateArgsBuilder, " AND ");
}
}
| [
"sboz88@gmail.com"
] | sboz88@gmail.com |
6a0488ccbb0f46e175cc510dc2b1d03d41700964 | bd323106133c44558e7a5189881b66728f789dcb | /Maws/src/main/java/com/company/maws/MyUtil.java | d37dbaad0624d76b147d5dfcd49553b019d50347 | [] | no_license | LeeKangWon/Maws | 5d12551a3e3b72d18133f4ba0ab26fa59e7e1cd8 | b4b76200263f7fe8e344de974fa2723e65ae3207 | refs/heads/master | 2021-01-20T19:13:12.231034 | 2016-11-04T17:43:53 | 2016-11-04T17:43:53 | 63,134,659 | 0 | 0 | null | null | null | null | UHC | Java | false | false | 1,975 | java | package com.company.maws;
import java.lang.*;
import java.io.*;
import java.sql.*;
import java.text.*;
import java.util.*;
//import javax.mail.*;
//import javax.mail.internet.*;
//import javax.activation.*;
public class MyUtil {
//8859_1을 KSC5601로 변환
public String toKorean(String str) {
String convStr = null;
try {
if(str == null)
return "";
convStr = new String(str.getBytes("8859_1"), "KSC5601");
} catch (UnsupportedEncodingException e) {
}
return convStr;
}
//KSC5601을 8859_1로 변환
public String formKorean(String str) {
String convStr = null;
try {
if (str == null)
return "";
convStr = new String(str.getBytes("KSC5601"), "8859_1");
} catch (UnsupportedEncodingException e) {
}
return convStr;
}
// Null을 ""로 변환
public String checkNull(String str) {
String strTmp;
if(str == null)
strTmp = "";
else
strTmp = str;
return strTmp;
}
// Null을 0으로 변환
public String checkNull2(String str) {
String strTmp;
if(str == null)
strTmp = "0";
else
strTmp = str;
return strTmp;
}
// TextArea에서 입력받은 캐리지 리턴값을 <br>태그로 변환
public String n12br(String comment)
{
// 넘어온 값의 길이를 구합니다.
int length = comment.length();
StringBuffer buffer = new StringBuffer();
//변수의 길이 만큼 반복문을 통해 돌립니다.
for (int i =0; i<length; ++i)
{
//단어를 하나씩 잘라서 변수에 넣습니다.
String comp = comment.substring(i, i+1);
if ("\r".compareTo(comp) == 0)
{
comp = comment.substring(++i, i+1);
//만약 엔터에 해당하는 값이 있을 경우에는 <BR>태그를
//아닐 경우에는 그냥 값을 버퍼에 저장
if ("\n".compareTo(comp) == 0)
buffer.append("<BR>\r");
else
buffer.append("\r");
}
buffer.append(comp);
}
//구해진 값을 다시 리턴시킵니다.
return buffer.toString();
}
} | [
"wangchozza1@gmail.com"
] | wangchozza1@gmail.com |
a1cb1192689f5add7ddb1bc74e478102276698e7 | eb759600b01ed1013236e6461d10a4b9fa404874 | /foreword/src/main/java/com/myos/design/observe/WechatServer.java | f6c388c2ab13524f4b5406b1525cfcd87d5182a8 | [] | no_license | zzsymyos/MyosRpc | d017be670d6864cd7515e13f306780c6b112b07d | 6e5a10e7b821a6d9c62b9de0f709cc72cc822891 | refs/heads/master | 2022-01-18T23:56:41.747790 | 2021-04-10T02:37:30 | 2021-04-10T02:37:30 | 228,414,143 | 0 | 0 | null | 2022-01-12T23:06:42 | 2019-12-16T15:12:27 | Java | UTF-8 | Java | false | false | 748 | java | package com.myos.design.observe;
import java.util.ArrayList;
import java.util.List;
/**
* @Author: wu sir
* @Date: 2020/8/16 10:09 下午
*/
public class WechatServer implements Observerable {
private List<Observer> list;
private String message;
public WechatServer(){
list = new ArrayList<>();
}
@Override
public void registerObserver(Observer observer) {
list.add(observer);
}
@Override
public void removeObserver(Observer o) {
if (!list.isEmpty()) {
list.remove(o);
}
}
@Override
public void notifyObserver(String message) {
this.message = message;
for (Observer o : list) {
o.update(message);
}
}
}
| [
"wuwenbin@daojia-inc.com"
] | wuwenbin@daojia-inc.com |
0d981a7edf79ae3d05a3f5af68bf616c1305c944 | e9f77cc80015bc81cea0ee4418e179b2112d808c | /main/plugins/kafka/src/main/java/de/tweerlei/dbgrazer/plugins/kafka/types/MessageHeadersQueryType.java | a24a5ecdcfd7fea24340bcdd7c0c3541082379b5 | [
"Apache-2.0"
] | permissive | tweerlei/dbgrazer | 2d3754596a51e293ed0a232d7b0128bf523789c2 | 2cec20e9730c14e6e6c18c274765647a369f7175 | refs/heads/master | 2023-08-08T22:28:11.633335 | 2023-07-26T13:05:30 | 2023-07-26T13:05:30 | 144,776,073 | 4 | 1 | Apache-2.0 | 2023-03-27T14:00:05 | 2018-08-14T21:58:01 | Java | UTF-8 | Java | false | false | 1,199 | java | /*
* Copyright 2018 tweerlei Wruck + Buchmeier GbR - http://www.tweerlei.de/
*
* 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 de.tweerlei.dbgrazer.plugins.kafka.types;
import de.tweerlei.dbgrazer.plugins.kafka.impl.KafkaLinkType;
import de.tweerlei.dbgrazer.query.model.impl.AbstractRowQueryType;
/**
* HEAD webservice request
*
* @author Robert Wruck
*/
//@Service
//@Order(501)
public class MessageHeadersQueryType extends AbstractRowQueryType
{
private static final String NAME = "KAFKA_HEADERS";
/**
* Constructor
* @param linkType LinkType
*/
// @Autowired
public MessageHeadersQueryType(KafkaLinkType linkType)
{
super(NAME, linkType, null);
}
}
| [
"wruck@tweerlei.de"
] | wruck@tweerlei.de |
1e04d97fdf58b52f7dbabb48e5a3b9ea727ab7bf | b3d9e98f353eaba1cf92e3f1fc1ccd56e7cecbc5 | /xy-games/game-logic/trunk/src/main/java/com/cai/game/mj/hunan/syhz/MJHandlerChiPeng_SYHZ.java | b4f6a601d353a1860ffb933e4ac76bc5f51aface | [] | no_license | konser/repository | 9e83dd89a8ec9de75d536992f97fb63c33a1a026 | f5fef053d2f60c7e27d22fee888f46095fb19408 | refs/heads/master | 2020-09-29T09:17:22.286107 | 2018-10-12T03:52:12 | 2018-10-12T03:52:12 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 16,242 | java | package com.cai.game.mj.hunan.syhz;
import com.cai.common.constant.GameConstants;
import com.cai.common.constant.MsgConstants;
import com.cai.common.domain.ChiHuRight;
import com.cai.common.domain.GangCardResult;
import com.cai.common.domain.PlayerStatus;
import com.cai.common.domain.WeaveItem;
import com.cai.game.mj.handler.MJHandlerChiPeng;
import com.cai.util.SysParamServerUtil;
import protobuf.clazz.Protocol.Int32ArrayResponse;
import protobuf.clazz.Protocol.RoomResponse;
import protobuf.clazz.Protocol.TableResponse;
import protobuf.clazz.Protocol.WeaveItemResponse;
import protobuf.clazz.Protocol.WeaveItemResponseArrayResponse;
public class MJHandlerChiPeng_SYHZ extends MJHandlerChiPeng<MJTable_SYHZ> {
private GangCardResult m_gangCardResult;
public MJHandlerChiPeng_SYHZ() {
m_gangCardResult = new GangCardResult();
}
@Override
public void exe(MJTable_SYHZ table) {
for (int i = 0; i < table.getTablePlayerNumber(); i++) {
table._playerStatus[i].clean_action();
// table._playerStatus[i].clean_status();
table.change_player_status(i, GameConstants.INVALID_VALUE);
table.operate_player_action(i, true);
}
// 组合扑克
int wIndex = table.GRR._weave_count[_seat_index]++;
table.GRR._weave_items[_seat_index][wIndex].public_card = 1;
table.GRR._weave_items[_seat_index][wIndex].center_card = _card;
table.GRR._weave_items[_seat_index][wIndex].weave_kind = _action;
table.GRR._weave_items[_seat_index][wIndex].provide_player = _provider;
// 设置用户
table._current_player = _seat_index;
// 效果
table.operate_effect_action(_seat_index, GameConstants.EFFECT_ACTION_TYPE_ACTION, 1, new long[] { _action }, 1,
GameConstants.INVALID_SEAT);
table.operate_remove_discard(this._provider, table.GRR._discard_count[_provider]);
// 刷新手牌包括组合
int cards[] = new int[GameConstants.MAX_COUNT];
int hand_card_count = table._logic.switch_to_cards_data(table.GRR._cards_index[_seat_index], cards);
WeaveItem weaves[] = new WeaveItem[GameConstants.MAX_WEAVE];// table.GRR._weave_items[_seat_index];
int weave_count = table.GRR._weave_count[_seat_index];
for (int i = 0; i < weave_count; i++) {
weaves[i] = new WeaveItem();
weaves[i].weave_kind = table.GRR._weave_items[_seat_index][i].weave_kind;
weaves[i].center_card = table.GRR._weave_items[_seat_index][i].center_card;
weaves[i].public_card = table.GRR._weave_items[_seat_index][i].public_card;
weaves[i].provide_player = table.GRR._weave_items[_seat_index][i].provide_player
+ GameConstants.WEAVE_SHOW_DIRECT;
}
if (SysParamServerUtil.is_new_algorithm(3000, 3000, 1)) {
// TODO: 出任意一张牌时,能胡哪些牌 -- Begin
int count = 0;
int ting_count = 0;
int card_type_count = GameConstants.MAX_ZI_FENG;
for (int i = 0; i < card_type_count; i++) {
count = table.GRR._cards_index[_seat_index][i];
if (count > 0) {
table.GRR._cards_index[_seat_index][i]--;
table._playerStatus[_seat_index]._hu_out_card_ting_count[ting_count] = table.get_hz_ting_card(
table._playerStatus[_seat_index]._hu_out_cards[ting_count],
table.GRR._cards_index[_seat_index], table.GRR._weave_items[_seat_index],
table.GRR._weave_count[_seat_index], false);
if (table._playerStatus[_seat_index]._hu_out_card_ting_count[ting_count] > 0) {
table._playerStatus[_seat_index]._hu_out_card_ting[ting_count] = table._logic
.switch_to_card_data(i);
ting_count++;
}
table.GRR._cards_index[_seat_index][i]++;
}
}
table._playerStatus[_seat_index]._hu_out_card_count = ting_count;
if (ting_count > 0) {
int tmp_cards[] = new int[GameConstants.MAX_COUNT];
int tmp_hand_card_count = table._logic.switch_to_cards_data(table.GRR._cards_index[_seat_index],
tmp_cards);
for (int i = 0; i < tmp_hand_card_count; i++) {
for (int j = 0; j < ting_count; j++) {
if (tmp_cards[i] == table._playerStatus[_seat_index]._hu_out_card_ting[j]) {
tmp_cards[i] += GameConstants.CARD_ESPECIAL_TYPE_TING;
break;
}
}
}
table.operate_player_cards_with_ting(_seat_index, tmp_hand_card_count, tmp_cards, weave_count, weaves);
} else {
// 刷新手牌
table.operate_player_cards(_seat_index, hand_card_count, cards, weave_count, weaves);
}
// TODO: 出任意一张牌时,能胡哪些牌 -- End
} else {
// 刷新手牌
table.operate_player_cards(_seat_index, hand_card_count, cards, weave_count, weaves);
}
//红中比赛场吃碰操作标识
if(table.is_match() || table.isCoinRoom()){
table.chi_peng_index(_seat_index);
}
// 检测剩下的牌是否胡牌
ChiHuRight chr = new ChiHuRight();
int in_card_arr[] = new int[GameConstants.MAX_INDEX];
int card = GameConstants.INVALID_CARD;
for (int i = 0; i < table.GRR._cards_index[_seat_index].length; i++) {
if (card == GameConstants.INVALID_CARD && table.GRR._cards_index[_seat_index][i] != 0) {
card = table._logic.switch_to_card_data(i);
in_card_arr[i] = table.GRR._cards_index[_seat_index][i] - 1;
} else {
in_card_arr[i] = table.GRR._cards_index[_seat_index][i];
}
}
int action = table.analyse_chi_hu_card_hz(in_card_arr, table.GRR._weave_items[_seat_index],
table.GRR._weave_count[_seat_index], card, chr, GameConstants.HU_CARD_TYPE_PAOHU);
if (action != GameConstants.WIK_NULL) {
table._playerStatus[_seat_index]._check_chi_pen_hu = true;
table.peng_index = _seat_index;
}
// 回放
PlayerStatus curPlayerStatus = table._playerStatus[_seat_index];
curPlayerStatus.reset();
table._playerStatus[_seat_index].chi_hu_round_valid(); // 可以胡了
// 至少要留抓鸟的牌
int llcard = table.get_niao_card_num(true, 0);
m_gangCardResult.cbCardCount = 0;
// 如果牌堆还有牌,判断能不能杠
if (table.GRR._left_card_count > llcard) {
int cbActionMask = table._logic.analyse_gang_card_all(table.GRR._cards_index[_seat_index],
table.GRR._weave_items[_seat_index], table.GRR._weave_count[_seat_index], m_gangCardResult, false);
if (cbActionMask != 0) {
curPlayerStatus.add_action(GameConstants.WIK_GANG);// 转转就是杠
for (int i = 0; i < m_gangCardResult.cbCardCount; i++) {
// 加上刚
curPlayerStatus.add_gang(m_gangCardResult.cbCardData[i], _seat_index, m_gangCardResult.isPublic[i]);
}
}
}
if (curPlayerStatus.has_action()) {
// curPlayerStatus.set_status(GameConstants.Player_Status_OPR_CARD);// 操作状态
table.change_player_status(_seat_index, GameConstants.Player_Status_OPR_CARD);
table.operate_player_action(_seat_index, false);
} else {
// curPlayerStatus.set_status(GameConstants.Player_Status_OUT_CARD);// 出牌状态
table.change_player_status(_seat_index, GameConstants.Player_Status_OUT_CARD);
table.operate_player_status();
}
handler_check_auto_behaviour(table, _seat_index, GameConstants.INVALID_VALUE);
}
/***
* //用户操作
*
* @param seat_index
* @param operate_code
* @param operate_card
* @return
*/
@Override
public boolean handler_operate_card(MJTable_SYHZ table, int seat_index, int operate_code, int operate_card) {
PlayerStatus playerStatus = table._playerStatus[seat_index];
// 效验操作
if ((operate_code != GameConstants.WIK_NULL) && (playerStatus.has_action_by_code(operate_code) == false)) {
table.log_error("没有这个操作");
return false;
}
if (seat_index != _seat_index) {
table.log_error("不是当前玩家操作");
return false;
}
// 放弃操作
if (operate_code == GameConstants.WIK_NULL) {
table.record_effect_action(seat_index, GameConstants.EFFECT_ACTION_TYPE_ACTION, 1,
new long[] { GameConstants.WIK_NULL }, 1);
// 用户状态
table._playerStatus[_seat_index].clean_action();
// table._playerStatus[_seat_index].clean_status();
table.change_player_status(_seat_index, GameConstants.INVALID_VALUE);
// table._playerStatus[_seat_index].set_status(GameConstants.Player_Status_OUT_CARD);
table.change_player_status(_seat_index, GameConstants.Player_Status_OUT_CARD);
table.operate_player_status();
return true;
}
//WalkerGeek 比赛场吃碰标识清理
if(table.is_match() || table.isCoinRoom()){
table.chi_peng_index_invaild();
}
// 执行动作
switch (operate_code) {
case GameConstants.WIK_GANG: // 杠牌操作
{
for (int i = 0; i < m_gangCardResult.cbCardCount; i++) {
if (operate_card == m_gangCardResult.cbCardData[i]) {
// 是否有抢杠胡
table.exe_gang(_seat_index, _seat_index, operate_card, operate_code, m_gangCardResult.type[i], true,
false);
return true;
}
}
}
break;
}
return true;
}
@Override
public boolean handler_player_be_in_room(MJTable_SYHZ table, int seat_index) {
RoomResponse.Builder roomResponse = RoomResponse.newBuilder();
roomResponse.setType(MsgConstants.RESPONSE_RECONNECT_DATA);
roomResponse.setIsGoldRoom(table.is_sys());
TableResponse.Builder tableResponse = TableResponse.newBuilder();
table.load_room_info_data(roomResponse);// 加载房间的玩法 状态信息
table.load_player_info_data(roomResponse);
table.load_common_status(roomResponse);
// 游戏变量
tableResponse.setBankerPlayer(table.GRR._banker_player);
tableResponse.setCurrentPlayer(_seat_index);
tableResponse.setCellScore(0);
// 状态变量
tableResponse.setActionCard(0);
// tableResponse.setActionMask((_response[seat_index] == false) ?
// _player_action[seat_index] : MJGameConstants.WIK_NULL);
// 历史记录
tableResponse.setOutCardData(0);
tableResponse.setOutCardPlayer(0);
for (int i = 0; i < table.getTablePlayerNumber(); i++) {
tableResponse.addTrustee(false);// 是否托管
//比赛场托管状态取玩家当前托管状态
if(table.is_match()){
tableResponse.addTrustee(table.istrustee[i]);// 是否托管
}
// 剩余牌数
tableResponse.addDiscardCount(table.GRR._discard_count[i]);
Int32ArrayResponse.Builder int_array = Int32ArrayResponse.newBuilder();
for (int j = 0; j < 55; j++) {
int_array.addItem(table.GRR._discard_cards[i][j]);
}
tableResponse.addDiscardCards(int_array);
// 组合扑克
tableResponse.addWeaveCount(table.GRR._weave_count[i]);
WeaveItemResponseArrayResponse.Builder weaveItem_array = WeaveItemResponseArrayResponse.newBuilder();
for (int j = 0; j < GameConstants.MAX_WEAVE; j++) {
WeaveItemResponse.Builder weaveItem_item = WeaveItemResponse.newBuilder();
weaveItem_item.setCenterCard(table.GRR._weave_items[i][j].center_card);
weaveItem_item.setProvidePlayer(table.GRR._weave_items[i][j].provide_player+ GameConstants.WEAVE_SHOW_DIRECT);
weaveItem_item.setPublicCard(table.GRR._weave_items[i][j].public_card);
weaveItem_item.setWeaveKind(table.GRR._weave_items[i][j].weave_kind);
weaveItem_array.addWeaveItem(weaveItem_item);
}
tableResponse.addWeaveItemArray(weaveItem_array);
//
tableResponse.addWinnerOrder(0);
// 牌
tableResponse.addCardCount(table._logic.get_card_count_by_index(table.GRR._cards_index[i]));
}
// 数据
tableResponse.setSendCardData(0);
int hand_cards[] = new int[GameConstants.MAX_COUNT];
int hand_card_count = table._logic.switch_to_cards_data(table.GRR._cards_index[seat_index], hand_cards);
// TODO: 出任意一张牌时,能胡哪些牌 -- Begin
int out_ting_count = table._playerStatus[seat_index]._hu_out_card_count;
if ((out_ting_count > 0) && (seat_index == _seat_index)) {
for (int j = 0; j < hand_card_count; j++) {
for (int k = 0; k < out_ting_count; k++) {
if (hand_cards[j] == table._playerStatus[seat_index]._hu_out_card_ting[k]) {
hand_cards[j] += GameConstants.CARD_ESPECIAL_TYPE_TING;
break;
}
}
}
}
for (int i = 0; i < GameConstants.MAX_COUNT; i++) {
tableResponse.addCardsData(hand_cards[i]);
}
roomResponse.setTable(tableResponse);
roomResponse.setOutCardCount(out_ting_count);
for (int i = 0; i < out_ting_count; i++) {
int ting_card_cout = table._playerStatus[seat_index]._hu_out_card_ting_count[i];
roomResponse.addOutCardTingCount(ting_card_cout);
roomResponse.addOutCardTing(
table._playerStatus[seat_index]._hu_out_card_ting[i] + GameConstants.CARD_ESPECIAL_TYPE_TING);
Int32ArrayResponse.Builder int_array = Int32ArrayResponse.newBuilder();
for (int j = 0; j < ting_card_cout; j++) {
int_array.addItem(table._playerStatus[seat_index]._hu_out_cards[i][j]);
}
roomResponse.addOutCardTingCards(int_array);
}
table.send_response_to_player(seat_index, roomResponse);
// TODO: 出任意一张牌时,能胡哪些牌 -- End
// 听牌显示
int ting_cards[] = table._playerStatus[seat_index]._hu_cards;
int ting_count = table._playerStatus[seat_index]._hu_card_count;
if (ting_count > 0) {
table.operate_chi_hu_cards(seat_index, ting_count, ting_cards);
}
// 效果
table.operate_effect_action(_seat_index, GameConstants.EFFECT_ACTION_TYPE_ACTION, 1, new long[] { _action }, 1,
seat_index);
if (table._playerStatus[seat_index].has_action() && (table._playerStatus[seat_index].is_respone() == false)) {
table.operate_player_action(seat_index, false);
}
//重连后比赛场发送托管协议
table.be_in_room_trustee_match(seat_index);
return true;
}
}
| [
"905202059@qq.com"
] | 905202059@qq.com |
28a8f3bc6ddfad4ab83035275a3803eec38e0b97 | f0d465b53f66ef3a0640f0f3fb0b5e3b42f53875 | /app/src/main/java/com/mad/mycamera/ChangePaintThicknessView.java | 9c909aa4962cecb266e8c874d4d538bc88fb9876 | [] | no_license | Antony-madonnaD/Phote_Editor_MadLab | 245e5e68a17d67c93d116d2158da6f88e24a0d71 | 7de1538784ca6db7b262803d3572104c9b9ce37a | refs/heads/master | 2023-07-11T01:44:52.315721 | 2021-08-20T14:21:40 | 2021-08-20T14:21:40 | 398,297,017 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,608 | java | package com.mad.mycamera;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.util.AttributeSet;
import android.view.View;
import androidx.annotation.Nullable;
import androidx.core.content.ContextCompat;
public class ChangePaintThicknessView extends View {
private float mThickness;
private int mCurrentColor;
private Paint mCirclePaint;
private void init(Context context) {
mThickness = 10f;
mCurrentColor = ContextCompat.getColor(context, R.color.white);
mCirclePaint = new Paint(Paint.ANTI_ALIAS_FLAG);
mCirclePaint.setColor(mCurrentColor);
mCirclePaint.setStrokeWidth(mThickness);
}
public ChangePaintThicknessView(Context context) {
super(context);
init(context);
}
public ChangePaintThicknessView(Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
init(context);
}
public ChangePaintThicknessView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
init(context);
}
@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
canvas.drawCircle(getHeight()/2f, getWidth()/2f, mThickness/2, mCirclePaint);
}
public void setThickness(float thickness) {
mCirclePaint.setStrokeWidth(mThickness);
mThickness = thickness;
postInvalidate();
}
public void setCurrentColor(int color) {
mCurrentColor = color;
mCirclePaint.setColor(color);
}
}
| [
"antonymadonna14@gmail.com"
] | antonymadonna14@gmail.com |
3dfbb78430eeddcede56969bac3fe7a9eb494f59 | fd351499a86dbcada48c3110557df5bb195ed83e | /src/main/java/com/deepak/codility/MissingInteger.java | 3980b407e73f0876f3b1d20e89b4270a1498fd25 | [] | no_license | spdeepak/Codility | a756c36c1e09f06dfb83ce173c5ae49c4bce7eb9 | 9eea920fb8f7bd1b6ef802ee42a9f81491becb85 | refs/heads/master | 2020-01-23T21:44:25.176786 | 2016-11-24T17:59:04 | 2016-11-24T17:59:04 | 74,694,966 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,244 | java | package com.deepak.codility;
import java.util.HashSet;
import java.util.Set;
/**
* @author Deepak
*
*/
public class MissingInteger {
public int solution(int[] A) {
Set<Integer> set = new HashSet<Integer>();
for (int i = 0; i < A.length; i++) {
set.add(i + 1);
}
for (int i = 0; i < A.length; i++) {
if (set.contains(A[i])) {
set.remove(A[i]);
}
}
return set.isEmpty() ? (A.length + 1) : set.stream().findFirst().get();
}
public static void main(String[] args) {
int[] A = new int[10000];
System.out.println(A.length);
System.out.println(new int[1].length);
for (int i = 0; i < 10000; i++) {
A[i] = i + 1;
}
System.out.println(A[A.length - 1]);
Set<Integer> set = new HashSet<Integer>();
for (int i = 0; i < A.length; i++) {
set.add(i + 1);
}
for (int i = 0; i < A.length; i++) {
if (set.contains(A[i])) {
set.remove(A[i]);
}
}
System.out.println(set.isEmpty() ? A[A.length - 1] : set.stream().findFirst().get());
}
}
| [
"speedpak1991@gmail.com"
] | speedpak1991@gmail.com |
482b1108dabc08aaba4f500b6ef2fe0a55650f3f | 6b229059893f2106e19c77b5d7d66d0357ac31a2 | /old/junit_test_by_spring/src/main/java/com/test/domain/es/Repository.java | e0793d5841d318778c0557a0980a8ffea6ead410 | [] | no_license | zacscoding/spring-example | 33ce7ce26bb72e91cdca8c4c02fea5108eb4ed4b | d538cbfad328b0c12913560133fef9d71c20b43d | refs/heads/master | 2018-12-10T06:44:22.668988 | 2018-09-13T14:02:11 | 2018-09-13T14:02:11 | 115,132,696 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 798 | java | package com.test.domain.es;
import java.util.List;
import com.google.gson.Gson;
public class Repository {
private String ip;
private List<String> prepared;
private List<String[]> values;
private List<String> labels;
public String getIp() {
return ip;
}
public void setIp(String ip) {
this.ip = ip;
}
public List<String> getPrepared() {
return prepared;
}
public void setPrepared(List<String> prepared) {
this.prepared = prepared;
}
public List<String[]> getValues() {
return values;
}
public void setValues(List<String[]> values) {
this.values = values;
}
public List<String> getLabels() {
return labels;
}
public void setLabels(List<String> labels) {
this.labels = labels;
}
@Override
public String toString() {
return new Gson().toJson(this);
}
}
| [
"zaccoding725@gmail.com"
] | zaccoding725@gmail.com |
f56a4851f7dc292737f98dc2b2f72cfb6b8f4e79 | 00e0ad2c31263b1ad468d7891171c81a6554d690 | /MyProjects/Individual_work/ATMMachine/ATMController.java | 4a9db655b2ca48f96e266ada641debc0ab4b226e | [] | no_license | bolohori/software-guild-projects | 9e4774bb0487bdf3345feaaafa03c849a0e91325 | 7ed4e5cb58c586874d0a534dd26493e4f6ff462a | refs/heads/master | 2023-03-18T07:06:55.151946 | 2017-01-09T22:58:56 | 2017-01-09T22:58:56 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,059 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package ATMMachine;
import java.util.List;
/**
*
* @author apprentice
*/
public class ATMController {
private ConsoleIO console;
private ATMDao dao;
public void run() {
int PIN = 1234;
int Attempts = 0;
int userPIN;
int x;
console = new ConsoleIO();
dao = new ATMDao();
List<Account> accounts = dao.accountData();
System.out.println("WELCOME TO FLOYD FIRST BANK");
System.out.println("PLEASE ENTER YOUR PIN NUMBER:");
do {
userPIN = console.readInt("", 0000, 9999);
Attempts = Attempts++;
} while (Attempts > 10 || userPIN != PIN);
do {
if (Attempts >= 10) {
console.print("You Have Been Locked Out Of The System.");
x = 0;
} else {
x = accountMenu();
}
switch (x) {
case 0:
System.out.println("Goodbye.");
break;
case 1:
listAll(accounts);
break;
case 2:
accountWithdrawl(accounts);
break;
case 3:
accountDeposit(accounts);
break;
}
} while (x != 0);
}
public int accountMenu() {
System.out.println(" ");
System.out.println("SUCCESSFUL LOG IN, WELCOME!");
System.out.println("WHICH ACCOUNT WOULD YOU LIKE TO ACCESS?");
System.out.println("0. Quit");
System.out.println("1. List all open accounts");
System.out.println("2. Withdraw from an account");
System.out.println("3. Make a deposit into an account");
int x = console.readInt("please make a selection", 0, 3);
System.out.println(" ");
return x;
}
public void listAll(List<Account> accounts) {
for (Account i : accounts) {
System.out.println(i.name + ": $" + i.balance);
}
}
public void accountWithdrawl(List<Account> accounts) {
String x = console.readString("Enter name of account you want to withdraw from");
for (Account i : accounts) {
if (x.equalsIgnoreCase(i.name)) {
if (i.balance > 0) {
i.withdrawl();
} else if (i.balance <= 0) {
System.out.println("You may not make a"
+ "withdrawl from an overdrafted account");
}
}
}
}
public void accountDeposit(List<Account> accounts) {
String x = console.readString("Enter name of account you want to make a deposit into");
for (Account i : accounts) {
if (x.equalsIgnoreCase(i.name)) {
i.deposit();
}
}
}
}
| [
"floydchris@hotmail.com"
] | floydchris@hotmail.com |
aa216c478d3cbee6066ff4454d05dae56b8fdc77 | 2c67fe5879cab5d5b201572f9e32ab35e5794a50 | /sessionServer/src/main/java/com/zero/service/ChattingRoomRepository.java | 66263466a506d0dae772243a0a70fd6021434365 | [] | no_license | pyuuuuuu/MSAserver | 93723cb64f2ba9767fb2766fdad1c9d0025891ba | fffcdb3d0c030ff26bfe368accaa320b9ce0031e | refs/heads/master | 2022-04-03T05:25:18.504461 | 2020-02-09T18:06:57 | 2020-02-09T18:06:57 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 906 | java | /*
package com.zero.service;
import com.zero.dao.ChattingRoom;
import org.springframework.stereotype.Repository;
import javax.annotation.PostConstruct;
import java.util.*;
@Repository
public class ChattingRoomRepository {
private Map<String, ChattingRoom> chattingRoomMap;
@PostConstruct
private void init() {
chattingRoomMap = new LinkedHashMap<>();
}
public List<ChattingRoom> findAllRoom() {
List chattingRooms = new ArrayList(chattingRoomMap.values());
Collections.reverse(chattingRooms);
return chattingRooms;
}
public ChattingRoom findRoomById(String id) {
return chattingRoomMap.get(id);
}
public ChattingRoom createChattingRoom(String name) {
ChattingRoom chattingRoom = ChattingRoom.create(name);
chattingRoomMap.put(chattingRoom.getRoomId(), chattingRoom);
return chattingRoom;
}
}
*/ | [
"4whomtbts@gmail.com"
] | 4whomtbts@gmail.com |
dd201c60d37775ebb2dbe12904199d57a60dccee | 00153a83ce34a999f5cde651080dcfd577f15bb4 | /buildSrc/src/main/java/org/springframework/build/KotlinConventions.java | f0ef7f3d59c7122c0186886175eb28f722bc44b1 | [
"Apache-2.0"
] | permissive | zhaobingss/spring-framework | c3d94261fca7576d8ee0aa684f1d2baea097652c | af40a124bb4407d3615105725b8f3eda4474863d | refs/heads/main | 2023-03-16T17:19:48.021152 | 2022-11-18T17:24:43 | 2022-11-18T17:24:43 | 380,640,502 | 0 | 0 | Apache-2.0 | 2021-06-27T03:14:01 | 2021-06-27T03:14:01 | null | UTF-8 | Java | false | false | 1,667 | java | /*
* Copyright 2002-2022 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
*
* https://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.build;
import java.util.ArrayList;
import java.util.List;
import org.gradle.api.Project;
import org.jetbrains.kotlin.gradle.dsl.KotlinJvmOptions;
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile;
/**
* @author Brian Clozel
*/
public class KotlinConventions {
void apply(Project project) {
project.getPlugins().withId("org.jetbrains.kotlin.jvm",
(plugin) -> project.getTasks().withType(KotlinCompile.class, this::configure));
}
private void configure(KotlinCompile compile) {
KotlinJvmOptions kotlinOptions = compile.getKotlinOptions();
kotlinOptions.setApiVersion("1.7");
kotlinOptions.setLanguageVersion("1.7");
kotlinOptions.setJvmTarget("17");
kotlinOptions.setAllWarningsAsErrors(true);
List<String> freeCompilerArgs = new ArrayList<>(compile.getKotlinOptions().getFreeCompilerArgs());
freeCompilerArgs.addAll(List.of("-Xsuppress-version-warnings", "-Xjsr305=strict", "-opt-in=kotlin.RequiresOptIn"));
compile.getKotlinOptions().setFreeCompilerArgs(freeCompilerArgs);
}
}
| [
"bclozel@vmware.com"
] | bclozel@vmware.com |
670d69a084dc3592bdc38331f3530af9bcc47300 | 6b70281f38c54a561bb6a80061e662e784880e32 | /src/test/java/com/smartertravel/metrics/aop/backend/MetricSinkDropWizardTest.java | 5fd8f95f2d3d435104351ce8c237586d7759ba5a | [
"MIT"
] | permissive | smarter-travel-media/st-metrics | 13dbd2554d05907e9c9369a8329471bf8b6bc1d2 | e6296afe6aead516732835ec1ebe1d88571c7af5 | refs/heads/master | 2020-12-29T02:32:05.857913 | 2018-04-12T22:45:08 | 2018-04-12T22:45:08 | 35,183,941 | 3 | 2 | null | 2017-05-16T20:05:33 | 2015-05-06T21:31:05 | Java | UTF-8 | Java | false | false | 943 | java | package com.smartertravel.metrics.aop.backend;
import com.codahale.metrics.MetricRegistry;
import com.codahale.metrics.Timer;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import java.util.concurrent.TimeUnit;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
@RunWith(MockitoJUnitRunner.class)
public class MetricSinkDropWizardTest {
@Mock
private MetricRegistry metricRegistry;
@Mock
private Timer timer;
@InjectMocks
private MetricSinkDropWizard sink;
@Test
public void testTimeDurationAndUnitPropagated() {
when(metricRegistry.timer(eq("timer.someKey"))).thenReturn(timer);
sink.time("timer.someKey", 100, TimeUnit.MILLISECONDS);
verify(timer).update(100, TimeUnit.MILLISECONDS);
}
}
| [
"nickp@smartertravelmedia.com"
] | nickp@smartertravelmedia.com |
6fa0e44db8a989fbbdbc5be2316c1fb4eefcf730 | 9f554ef007390d838a9de998f79c6dd81a220f3a | /app/src/main/java/Database/DatabaseUserContract.java | cc57a36a9d96cc0616a879297648a518448c8895 | [] | no_license | Ben10B/grind-for-the-grail | 136b46b19fbd3435c06669a9b161d8c07b32ef41 | b8ea07e8479b16388557a209898521ae6808658a | refs/heads/master | 2020-03-17T11:52:13.407807 | 2018-06-06T04:17:04 | 2018-06-06T04:17:04 | 133,566,838 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 303 | java | package Database;
public final class DatabaseUserContract {
public DatabaseUserContract(){}
public static class ContractEntry {
public static final String TABLE_NAME = "user";
public static final String NAME = "name";
public static final String EMAIL = "email";
}
}
| [
"mbrannen747@yahoo.com"
] | mbrannen747@yahoo.com |
bad59f61fb8719ae2ffb99aa1117e5f6f7340669 | e82c1473b49df5114f0332c14781d677f88f363f | /MED-CLOUD/med-service/src/main/java/nta/med/service/ihis/handler/ocsa/OCS0118U00GrdOCS0118Handler.java | d2ad1f4e7563ddd63c2bad44de259c19c7073802 | [] | no_license | zhiji6/mih | fa1d2279388976c901dc90762bc0b5c30a2325fc | 2714d15853162a492db7ea8b953d5b863c3a8000 | refs/heads/master | 2023-08-16T18:35:19.836018 | 2017-12-28T09:33:19 | 2017-12-28T09:33:19 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,375 | java | package nta.med.service.ihis.handler.ocsa;
import java.util.List;
import javax.annotation.Resource;
import nta.med.core.utils.BeanUtils;
import nta.med.data.dao.medi.ocs.Ocs0103Repository;
import nta.med.data.model.ihis.ocsa.OCS0118U00GrdOCS0118Info;
import nta.med.core.infrastructure.socket.handler.ScreenHandler;
import nta.med.service.ihis.proto.OcsaModelProto;
import nta.med.service.ihis.proto.OcsaServiceProto;
import nta.med.service.ihis.proto.OcsaServiceProto.OCS0118U00GrdOCS0118Request;
import nta.med.service.ihis.proto.OcsaServiceProto.OCS0118U00GrdOCS0118Response;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.vertx.java.core.Vertx;
@Service
@Scope("prototype")
public class OCS0118U00GrdOCS0118Handler extends ScreenHandler<OcsaServiceProto.OCS0118U00GrdOCS0118Request,OcsaServiceProto.OCS0118U00GrdOCS0118Response> {
@Resource
private Ocs0103Repository ocs0103Repository;
@Override
@Transactional(readOnly = true)
public OCS0118U00GrdOCS0118Response handle(Vertx vertx, String clientId,
String sessionId, long contextId,
OCS0118U00GrdOCS0118Request request) throws Exception {
OcsaServiceProto.OCS0118U00GrdOCS0118Response.Builder response = OcsaServiceProto.OCS0118U00GrdOCS0118Response.newBuilder();
List<OCS0118U00GrdOCS0118Info> list = ocs0103Repository.getOCS0118U00GrdOCS0118Info(getHospitalCode(vertx, sessionId), request.getHangmogNameInx());
if(!CollectionUtils.isEmpty(list)){
for(OCS0118U00GrdOCS0118Info item : list){
OcsaModelProto.OCS0118U00GrdOCS0118Info.Builder info = OcsaModelProto.OCS0118U00GrdOCS0118Info.newBuilder();
BeanUtils.copyProperties(item, info, getLanguage(vertx, sessionId));
response.addGrdOCS0118Info(info);
}
}
return response.build();
}
}
| [
"duc_nt@nittsusystem-vn.com"
] | duc_nt@nittsusystem-vn.com |
c51f88a2d2551a310bf852e983fc1e0d98b4e9ba | 028cbe18b4e5c347f664c592cbc7f56729b74060 | /v2/admin/mbeans/src/java/com/sun/enterprise/management/model/J2EEServerMdl.java | 32ebc251cc9b3c362faf524d278e149523a9ea83 | [] | no_license | dmatej/Glassfish-SVN-Patched | 8d355ff753b23a9a1bd9d7475fa4b2cfd3b40f9e | 269e29ba90db6d9c38271f7acd2affcacf2416f1 | refs/heads/master | 2021-05-28T12:55:06.267463 | 2014-11-11T04:21:44 | 2014-11-11T04:21:44 | 23,610,469 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,988 | java | /*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
*
* The contents of this file are subject to the terms of either the GNU
* General Public License Version 2 only ("GPL") or the Common Development
* and Distribution License("CDDL") (collectively, the "License"). You
* may not use this file except in compliance with the License. You can obtain
* a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html
* or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific
* language governing permissions and limitations under the License.
*
* When distributing the software, include this License Header Notice in each
* file and include the License file at glassfish/bootstrap/legal/LICENSE.txt.
* Sun designates this particular file as subject to the "Classpath" exception
* as provided by Sun in the GPL Version 2 section of the License file that
* accompanied this code. If applicable, add the following below the License
* Header, with the fields enclosed by brackets [] replaced by your own
* identifying information: "Portions Copyrighted [year]
* [name of copyright owner]"
*
* Contributor(s):
*
* If you wish your version of this file to be governed by only the CDDL or
* only the GPL Version 2, indicate your decision by adding "[Contributor]
* elects to include this software in this distribution under the [CDDL or GPL
* Version 2] license." If you don't indicate a single choice of license, a
* recipient has the option to distribute your version of this file under
* either the CDDL, the GPL Version 2 or to extend the choice of license to
* its licensees as provided above. However, if you add GPL Version 2 code
* and therefore, elected the GPL Version 2 license, then the option applies
* only if the new code is made subject to such option by the copyright
* holder.
*/
package com.sun.enterprise.management.model;
import javax.management.*;
import java.util.*;
import com.sun.enterprise.instance.ServerManager;
import com.sun.enterprise.instance.InstanceDefinition;
import com.sun.enterprise.admin.server.core.AdminService;
import com.sun.appserv.server.util.Version;
import com.sun.enterprise.admin.event.AdminEventCache;
import com.sun.enterprise.admin.server.core.channel.AdminChannel;
import com.sun.enterprise.admin.server.core.channel.RMIClient;
import com.sun.enterprise.server.PEMain;
//Config imports
import com.sun.enterprise.server.ServerContext;
import com.sun.enterprise.config.ConfigContext;
import com.sun.enterprise.config.serverbeans.Domain;
import com.sun.enterprise.config.serverbeans.Server;
import com.sun.enterprise.config.serverbeans.Config;
import com.sun.enterprise.config.serverbeans.JmsService;
import com.sun.enterprise.config.serverbeans.JmsHost;
// JMS util imports
import com.sun.enterprise.jms.IASJmsUtil;
//JMS SPI imports
import com.sun.messaging.jmq.jmsspi.JMSAdmin;
import com.sun.messaging.jmq.jmsspi.JMSAdminFactory;
//import com.sun.enterprise.management.util.J2EEManagementObjectUtility;
//import com.sun.enterprise.tools.admin.RealmTool;
public class J2EEServerMdl extends J2EEManagedObjectMdl {
/* The vendor information for this server. */
private String serverVendor = "Sun Microsystems, Inc.";
/* The server version number. */
private String serverVersion = "9.1";
/* The managed object type. */
private static String MANAGED_OBJECT_TYPE = "J2EEServer";
/* start time */
private long startTime = now();
/* The debug string system property. */
private static String DEBUG_SYS_PROPERTY = "com.sun.aas.jdwpOptions";
public J2EEServerMdl() {
/*
super(System.getProperty(com.sun.enterprise.server.J2EEServer.J2EE_APPNAME, "j2ee") +
System.getProperty(com.sun.enterprise.server.J2EEServer.J2EE_SERVER_ID_PROP, "100"), false, false, false);
//this.serverName = System.getProperty(com.sun.enterprise.server.J2EEServer.J2EE_APPNAME) + System.getProperty(com.sun.enterprise.server.J2EEServer.J2EE_SERVER_ID_PROP);
*/
super("j2ee100", true, false, false);
}
public J2EEServerMdl(String serverName, String version) {
super(serverName, serverName, true, false, false);
this.serverVersion = version;
}
//constructor for generic instantiation from the MBeanRegistry
public J2EEServerMdl(String[] location) {
this(location[1], "8.0" /*FIXME: use constant*/);
}
/**
* A list of all applications deployed on this J2EEServer.
* @supplierCardinality 0..*
*/
public String[] getdeployedObjects(){
Set apps = findNames("j2eeType=J2EEApplication,J2EEServer=" + getJ2EEServer());
apps.addAll(findNames("j2eeType=EJBModule,J2EEServer=" + getJ2EEServer()));
apps.addAll(findNames("j2eeType=WebModule,J2EEServer=" + getJ2EEServer()));
apps.addAll(findNames("j2eeType=ResourceAdapterModule,J2EEServer=" + getJ2EEServer()));
apps.addAll(findNames("j2eeType=AppClientModule,J2EEServer=" + getJ2EEServer()));
Iterator it = apps.iterator();
String [] deployed = new String[apps.size()];
int i =0;
while(it.hasNext()) {
deployed[i++] = ((ObjectName)it.next()).toString();
}
return deployed;
}
/**
* A list of resources available to this server.
* @supplierCardinality 0..*
*/
public String[] getresources() {
Set res = findNames("j2eeType=JCAResource,J2EEServer=" + getJ2EEServer());
res.addAll(findNames("j2eeType=JavaMailResource,J2EEServer=" + getJ2EEServer()));
res.addAll(findNames("j2eeType=JDBCResource,J2EEServer=" + getJ2EEServer()));
res.addAll(findNames("j2eeType=JMSResource,J2EEServer=" + getJ2EEServer()));
res.addAll(findNames("j2eeType=JNDIResource,J2EEServer=" + getJ2EEServer()));
res.addAll(findNames("j2eeType=JTAResource,J2EEServer=" + getJ2EEServer()));
res.addAll(findNames("j2eeType=RMI_IIOPResource,J2EEServer=" + getJ2EEServer()));
res.addAll(findNames("j2eeType=URLResource,J2EEServer=" + getJ2EEServer()));
res.addAll(findNames("j2eeType=AdminObjectResource,J2EEServer=" + getJ2EEServer()));
Iterator it = res.iterator();
String [] resources = new String[res.size()];
int i =0;
while(it.hasNext()) {
resources[i++] = ((ObjectName)it.next()).toString();
}
return resources;
}
/**
* A list of nodes that this J2EEServer spans.
* @supplierCardinality 1..*
*/
public String[] getnodes(){
try {
return new String [] { (java.net.InetAddress.getLocalHost()).toString() };
} catch(Exception e) {
return new String[0];
}
}
/**
* A list of all Java virtual machines on which this J2EEServer has running threads.
* @supplierCardinality 0..*
*/
public String[] getjavaVMs() {
Set vms = findNames("j2eeType=JVM");
Iterator it = vms.iterator();
String [] jvms = new String[vms.size()];
int i =0;
while(it.hasNext()) {
jvms[i++] = ((ObjectName)it.next()).toString();
}
return jvms;
}
/**
* Identifies the J2EE platform vendor of this J2EEServer. The value of serverVendor is specified by the vendor.
*/
public String getserverVendor(){
return serverVendor;
}
/**
* Identifies the J2EE platform version of this J2EEServer. The value of serverVersion is specified by the vendor.
*/
public String getserverVersion() {
return Version.getVersion();
}
/**
* The type of the J2EEManagedObject as specified by JSR77. The class that implements a specific type must override this method and return the appropriate type string.
*/
public String getj2eeType() {
return MANAGED_OBJECT_TYPE;
}
/**
* The name of the J2EEManagedObject. All managed objects must have a unique name within the context of the management
* domain. The name must not be null.
*/
public String getobjectName() {
Set s = findNames("j2eeType="+getj2eeType()+",name="+getJ2EEServer());
Object [] objs = s.toArray();
if (objs.length > 0) {
String name = ((ObjectName)objs[0]).toString();
return name;
} else {
return null;
}
}
/**
* start time for the server instance
*/
public long getstartTime(){
return this.startTime;
}
/**
* Starts the server instance.
*/
public void start() {
}
/**
* Starts the server instance.
*/
public void startRecursive() {
start();
}
/**
* Stops the server instance.
*/
public void stop() {
PEMain.shutdown();
}
/**
* Returns the debug port for this instance.
*/
public String getdebugPort() {
String debug = java.lang.System.getProperty(DEBUG_SYS_PROPERTY);
int nameIndex;
if ( debug!=null && (nameIndex = debug.indexOf("address")) != -1 ) {
String value = debug.substring(nameIndex + "address".length() + 1);
int commaIndex;
if ( (commaIndex = value.indexOf(",")) != -1 ) {
value = value.substring(0, commaIndex);
}
return value;
}
return null;
}
/**
* Is instance restart required. Restart is required if dynamic
* reconfiguration on the instance could not be dones and the user has
* not restarted the instance since then.
*
* @deprecated Use runtime status object to runtime status
*/
public boolean isrestartRequired() {
String instanceId = AdminService.getAdminService().getInstanceName();
RMIClient rc = AdminChannel.getRMIClient(instanceId);
return rc.isRestartNeeded();
}
}
| [
"kohsuke@6f3ba3e3-413c-0410-a8aa-90bee3ab43b5"
] | kohsuke@6f3ba3e3-413c-0410-a8aa-90bee3ab43b5 |
f55136040852b5b3ff35af517d1226d74b853fe2 | beb7e790ec9f6b1b86ce962eef9a99a778f0c01e | /kopipe/AbstractFactory/A2/listfactory/ListFactory.java | cdd209fc6ea99f47992e19f27e992a3cea148114 | [] | no_license | kakazu-takaki-gn/DesignPatternStudy | 4fdfa66642792ab1eacf1c2bc6619702fa91aea1 | a2ad7ff89255344498bd68e4aee5a04af51cf47e | refs/heads/master | 2020-04-06T16:42:51.103141 | 2018-11-15T01:36:44 | 2018-11-15T01:36:44 | 157,631,297 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 414 | java | package kopipe.AbstractFactory.A2.listfactory;
import factory.*;
public class ListFactory extends Factory {
public Link createLink(String caption, String url) {
return new ListLink(caption, url);
}
public Tray createTray(String caption) {
return new ListTray(caption);
}
public Page createPage(String title, String author) {
return new ListPage(title, author);
}
}
| [
"kakazu_takaki_gn@cyberagent.co.jp"
] | kakazu_takaki_gn@cyberagent.co.jp |
95b2ff79fae2942c9361d0917bc037df3e909628 | 2260fe537906977dd5c3f0a1e2073cff1f627c58 | /OOPs-Inheritance/Inheritance/src/Employee.java | d4bc4f8c31295213211afd0c65fb02b330e8d14f | [] | no_license | android-kunjapppan/wipro-pjp-java | ec53267791a7c34d973f1510baa35df0f44ff753 | 7604b9e7ac0ed9ebf760eb3c4ec514549c68b26d | refs/heads/master | 2022-08-05T14:24:50.008775 | 2020-05-22T21:47:44 | 2020-05-22T21:47:44 | 259,070,556 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 708 | java | class Employee extends Person {
double annualSalary;
int yearOfStart;
String insuranceNumber;
Employee() {
name = "NoName";
annualSalary = 1000000;
yearOfStart = 2017;
insuranceNumber = "0142512";
}
Employee(String name, double salary, int year, String insurance) {
this.name = name;
annualSalary = salary;
yearOfStart = year;
insuranceNumber = insurance;
}
String getName() {
return name;
}
double getAnnualSalary() {
return annualSalary;
}
int getYearOfStart() {
return yearOfStart;
}
String getInsurancenumber() {
return insuranceNumber;
}
} | [
"42858846+maheer23@users.noreply.github.com"
] | 42858846+maheer23@users.noreply.github.com |
76d4dffeb7730c66eeeddf67d9e496f2a95420ba | ba3d47e78f52f83625b1b9319497c7c9546907e1 | /app/src/main/java/com/yzx/chat/broadcast/NetworkStateReceive.java | 02dd38a6f881c83c16a7475866cbde562f5c58cd | [] | no_license | VN0/ChatProject | ec7ad7a179757fcaa8ac978fd431988398a27ecc | 475ec6d81c5f851620c0b9573c5866f4f4434c15 | refs/heads/master | 2020-04-28T00:49:32.004506 | 2019-02-27T11:32:36 | 2019-02-27T11:32:36 | 174,830,471 | 1 | 0 | null | 2019-03-10T13:54:26 | 2019-03-10T13:54:26 | null | UTF-8 | Java | false | false | 3,471 | java | package com.yzx.chat.broadcast;
import android.app.Application;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import java.util.LinkedList;
import java.util.List;
/**
* Created by YZX on 2017年10月23日.
* 每一个不曾起舞的日子,都是对生命的辜负.
*/
public class NetworkStateReceive extends BroadcastReceiver {
private static final String RECEIVE_INTENT_TYPE = ConnectivityManager.CONNECTIVITY_ACTION;
private static int sCurrentNetworkType = -1;
private static boolean sIsNetworkAvailable;
private static List<NetworkChangeListener> sListenerList = new LinkedList<>();
public static void init(Application context) {
IntentFilter filter = new IntentFilter(RECEIVE_INTENT_TYPE);
NetworkStateReceive receive = new NetworkStateReceive();
context.registerReceiver(receive, filter);
}
public static synchronized void registerNetworkChangeListener(NetworkChangeListener listener) {
if(listener==null){
throw new RuntimeException("NetworkChangeListener can't be null");
}
if (!sListenerList.contains(listener)) {
sListenerList.add(listener);
}
}
public static synchronized void unregisterNetworkChangeListener(NetworkChangeListener listener) {
if(listener==null){
throw new RuntimeException("NetworkChangeListener can't be null");
}
sListenerList.remove(listener);
}
private NetworkStateReceive() {
}
@Override
public void onReceive(Context context, Intent intent) {
if (RECEIVE_INTENT_TYPE.equals(intent.getAction())) {
ConnectivityManager manager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
if (manager == null) {
return;
}
NetworkInfo activeNetwork = manager.getActiveNetworkInfo();
synchronized (NetworkStateReceive.class) {
if (activeNetwork != null && activeNetwork.isConnected()) {
int type = activeNetwork.getType();
if (type != sCurrentNetworkType || !sIsNetworkAvailable) {
for (NetworkChangeListener l : sListenerList) {
if (type != sCurrentNetworkType) {
l.onNetworkTypeChange(type);
}
if (!sIsNetworkAvailable) {
l.onConnectionStateChange(true);
}
}
}
sCurrentNetworkType = type;
sIsNetworkAvailable = true;
} else {
if (sIsNetworkAvailable) {
for (NetworkChangeListener l : sListenerList) {
l.onConnectionStateChange(false);
}
}
sIsNetworkAvailable = false;
}
}
}
}
public interface NetworkChangeListener {
void onNetworkTypeChange(int type);
void onConnectionStateChange(boolean isNetworkAvailable);
}
}
| [
"244546875@qq.com"
] | 244546875@qq.com |
8b150553a7c7d8d17faf3dd5fef221cfe25b449b | 1fddbc1211d5e4ae5846dec7ee26e7f5f51f8e18 | /Adlib/src/com/mobilead/adlib/ads/SubAdlibAdViewAdmob.java | 14b9dec6c8c69b06feb9934188d059e8075afba1 | [] | no_license | wikibook/mobileappad | fc5ab90ce010ef480d93ffc25432fdf1d6e1776a | 6a98f74ee4e9a28f1f127960d12fb36b40cdc6af | refs/heads/master | 2016-09-06T13:12:33.252530 | 2013-10-25T07:59:30 | 2013-10-25T07:59:30 | 13,854,820 | 1 | 1 | null | null | null | null | UHC | Java | false | false | 2,509 | java | /*
* adlibr - Library for mobile AD mediation.
* http://adlibr.com
* Copyright (c) 2012 Mocoplex, Inc. All rights reserved.
* Licensed under the BSD open source license.
*/
/*
* confirmed compatible with admob SDK 6.0.1
*/
package com.mobilead.adlib.ads;
import android.app.Activity;
import android.content.Context;
import android.util.AttributeSet;
import android.view.Gravity;
import com.google.ads.Ad;
import com.google.ads.AdRequest.ErrorCode;
import com.mocoplex.adlib.SubAdlibAdViewCore;
public class SubAdlibAdViewAdmob extends SubAdlibAdViewCore {
protected com.google.ads.AdView ad;
protected boolean bGotAd = false;
public SubAdlibAdViewAdmob(Context context) {
this(context,null);
}
public SubAdlibAdViewAdmob(Context context, AttributeSet attrs) {
super(context, attrs);
// 여기에 ADMOB ID 를 입력하세요.
String admobID = "a15016769c3992a";
ad = new com.google.ads.AdView((Activity) this.getContext(), com.google.ads.AdSize.BANNER, admobID);
// 광고 뷰의 위치 속성을 제어할 수 있습니다.
this.setGravity(Gravity.CENTER);
ad.setAdListener( new com.google.ads.AdListener() {
@Override
public void onDismissScreen(Ad arg0) {
}
@Override
public void onFailedToReceiveAd(Ad arg0, ErrorCode arg1) {
if(!bGotAd)
failed();
}
@Override
public void onLeaveApplication(Ad arg0) {
}
@Override
public void onPresentScreen(Ad arg0) {
}
@Override
public void onReceiveAd(Ad arg0) {
bGotAd = true;
// 광고를 받아왔으면 이를 알려 화면에 표시합니다.
gotAd();
}
});
this.addView(ad);
}
// 스케줄러에의해 자동으로 호출됩니다.
// 실제로 광고를 보여주기 위하여 요청합니다.
public void query()
{
ad.loadAd(request);
if(bGotAd)
gotAd();
}
private com.google.ads.AdRequest request = new com.google.ads.AdRequest();
public void onDestroy()
{
if(ad != null)
{
ad.destroy();
ad = null;
}
super.onDestroy();
}
public void clearAdView()
{
if(ad != null)
{
ad.stopLoading();
}
super.clearAdView();
}
public void onResume()
{
if(ad != null)
ad.loadAd(request);
super.onResume();
}
public void onPause()
{
if(ad != null)
ad.stopLoading();
super.onPause();
}
}
| [
"dylee@wikibook.co.kr"
] | dylee@wikibook.co.kr |
2538ae52c4428d6687338da9d1a74fd369462528 | 3fa209ae326ab46f6e5b9a5b96418430c045eea4 | /core/src/main/java/io/undertow/predicate/Predicates.java | 714853ae63c652d7cadf689e85ce963beb31edb5 | [
"Apache-2.0"
] | permissive | hongjiang/undertow | f74f9ac827ff42fa5692789fb2a2b60c8222133f | 7d8aa461aedccfad5d07bf7fd398afe96127430f | refs/heads/master | 2020-12-07T13:36:52.152666 | 2013-10-22T14:51:04 | 2013-10-22T14:51:04 | 13,830,431 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,606 | java | package io.undertow.predicate;
import io.undertow.attribute.ExchangeAttribute;
import io.undertow.attribute.ExchangeAttributes;
/**
* @author Stuart Douglas
*/
public class Predicates {
/**
* Creates a predicate that returns true if an only if the given predicates all
* return true.
*/
public static Predicate and(final Predicate... predicates) {
return new AndPredicate(predicates);
}
/**
* Creates a predicate that returns true if any of the given predicates
* return true.
*/
public static Predicate or(final Predicate... predicates) {
return new OrPredicate(predicates);
}
/**
* Creates a predicate that returns true if the given predicate returns
* false
*/
public static Predicate not(final Predicate predicate) {
return new NotPredicate(predicate);
}
/**
* creates a predicate that returns true if the given path matches exactly
*/
public static Predicate path(final String path) {
return new PathMatchPredicate(path);
}
/**
* creates a predicate that returns true if any of the given paths match exactly
*/
public static Predicate paths(final String... paths) {
final PathMatchPredicate[] predicates = new PathMatchPredicate[paths.length];
for (int i = 0; i < paths.length; ++i) {
predicates[i] = new PathMatchPredicate(paths[i]);
}
return or(predicates);
}
/**
* creates a predicate that returns true if the request path ends with the provided suffix
*/
public static Predicate suffix(final String path) {
return new PathSuffixPredicate(path);
}
/**
* creates a predicate that returns true if the request path ends with any of the provided suffixs
*/
public static Predicate suffixs(final String... paths) {
final PathSuffixPredicate[] predicates = new PathSuffixPredicate[paths.length];
for (int i = 0; i < paths.length; ++i) {
predicates[i] = new PathSuffixPredicate(paths[i]);
}
return or(predicates);
}
/**
* creates a predicate that returns true if the given relative path starts with the provided prefix
*/
public static Predicate prefix(final String path) {
return new PathPrefixPredicate(path);
}
/**
* creates a predicate that returns true if the relative request path matches any of the provided prefixes
*/
public static Predicate prefixs(final String... paths) {
final PathPrefixPredicate[] predicates = new PathPrefixPredicate[paths.length];
for (int i = 0; i < paths.length; ++i) {
predicates[i] = new PathPrefixPredicate(paths[i]);
}
return or(predicates);
}
/**
* Predicate that returns true if the Content-Size of a request is above a
* given value.
*
* @author Stuart Douglas
*/
public static Predicate maxContentSize(final long size) {
return new MaxContentSizePredicate(size);
}
/**
* Predicate that returns true if the Content-Size of a request is below a
* given value.
*/
public static Predicate minContentSize(final long size) {
return new MinContentSizePredicate(size);
}
/**
* predicate that always returns true
*/
public static Predicate truePredicate() {
return TruePredicate.instance();
}
/**
* predicate that always returns false
*/
public static Predicate falsePredicate() {
return FalsePredicate.instance();
}
/**
* Return a predicate that will return true if the given attribute is not null and not empty
*
* @param attribute The attribute to check
*/
public static Predicate exists(final ExchangeAttribute attribute) {
return new ExistsPredicate(attribute);
}
/**
* Returns true if the given attribute is present and contains one of the provided value
* @param attribute The exchange attribute
* @param values The values to check for
*/
public static Predicate contains(final ExchangeAttribute attribute, final String ... values) {
return new ContainsPredicate(attribute, values);
}
/**
* Creates a predicate that matches the given attribute against a regex. A full match is not required
* @param attribute The attribute
* @param pattern The pattern
*/
public static Predicate regex(final ExchangeAttribute attribute, final String pattern) {
return new RegularExpressionPredicate(pattern, attribute);
}
/**
* Creates a predicate that matches the given attribute against a regex.
* @param requireFullMatch If a full match is required
* @param attribute The attribute
* @param pattern The pattern
*/
public static Predicate regex(final ExchangeAttribute attribute, final String pattern, boolean requireFullMatch) {
return new RegularExpressionPredicate(pattern, attribute, requireFullMatch);
}
/**
* Creates a predicate that matches the given attribute against a regex.
* @param requireFullMatch If a full match is required
* @param attribute The attribute
* @param pattern The pattern
*/
public static Predicate regex(final String attribute, final String pattern, final ClassLoader classLoader, final boolean requireFullMatch) {
return new RegularExpressionPredicate(pattern, ExchangeAttributes.parser(classLoader).parse(attribute), requireFullMatch);
}
private Predicates() {
}
}
| [
"stuart.w.douglas@gmail.com"
] | stuart.w.douglas@gmail.com |
bcffc2b989ff769137b97140871a64add31b5a06 | e7b8c70aa0558d8143fe0122f56b3ecaa8527e87 | /app/src/main/java/zhangz/com/imoocmusic/constants/SPContants.java | 3ef849907b4599132236774c7478fedb12d57dc8 | [] | no_license | zhangzhenoooo/ImoocMusic | 4250abaecfd4259b3d2efafe4e08a02d58d41201 | baba3a99adf8acd4606663758da6ef383ede3c6b | refs/heads/master | 2022-09-09T19:13:59.829233 | 2020-05-25T08:20:48 | 2020-05-25T08:20:48 | 266,723,573 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 266 | java | package zhangz.com.imoocmusic.constants;
/**
* Created by zhangz on 2019/9/30.
* SharedPreferences 常量类
*/
public class SPContants {
public static final String SP_NAME_USER = "user";
public static final String SP_KEY_USERNAME = "nsername";
}
| [
"1804919062@qq.com"
] | 1804919062@qq.com |
e135ed1e28fcd8640808fc59a31304a1143477a9 | 2439a07f4cbaa7ac3e06de98b6675a1fdd10acf3 | /app/src/main/java/com/wind/designpattern_observer/JiaoLongAmryControlCenter.java | 9a5fadf56ce72e7b4546fc359a2d4079c1244fa4 | [] | no_license | Simon986793021/DesignPattern_Observer | c17f54f83a0d7ce44211f8bc5254135f07503cae | a051e1edd9f9e487a324684f597388c5d6d4ee47 | refs/heads/master | 2021-04-09T11:51:05.088300 | 2018-03-16T10:06:38 | 2018-03-16T10:06:38 | 125,498,835 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 551 | java | package com.wind.designpattern_observer;
/**
* Created by zhangcong on 2018/3/16.
*/
public class JiaoLongAmryControlCenter extends AmryControlCenter {
private String armyName;
public JiaoLongAmryControlCenter(String name){
armyName=name;
System.out.println(name+"战队组建成功");
}
@Override
public void notifyAll(String name) {
for (Observer observer:arrayList){
if (!observer.getName().equalsIgnoreCase(name)){
observer.supportAmry();
}
}
}
}
| [
"986793021@qq.com"
] | 986793021@qq.com |
dd45810c1507da37fae07abf6eff9d737d63dd66 | ccc7a9e44d486bebbc9788e615edb1bb2698139c | /src/main/java/com/sistema/finacx/security/WebSecurityConfig.java | b65d2604709025742f115f471ef07ea22ea3e7a9 | [] | no_license | gerlingabriel/finacx | b7bb47ddad9e4e9e70105d7af21fa273792b1d8b | fd0aa15dee509344f089d031cf4f17368e6393c3 | refs/heads/master | 2023-04-16T13:33:00.171478 | 2021-04-30T00:30:27 | 2021-04-30T00:30:27 | 362,985,951 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,393 | java | package com.sistema.finacx.security;
import com.sistema.finacx.service.ImplementUserDetails;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
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.config.http.SessionCreationPolicy;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.factory.PasswordEncoderFactories;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.security.web.csrf.CookieCsrfTokenRepository;
@EnableWebSecurity
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
@Autowired
private ImplementUserDetails acesso;
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
PasswordEncoder encoder = PasswordEncoderFactories.createDelegatingPasswordEncoder(); // precisa dele para passar em "password"
auth.inMemoryAuthentication() // deixa um acesso em mémora do sistema
.withUser("teste").password(encoder.encode("teste")).roles("ADMIN"); // não vai funcionar devido ao password não é criotgrafado
// Teste se precisar criar class para pegar autozizacao - extends AuthorizationServerConfigurerAdapter
auth.userDetailsService(acesso).passwordEncoder(new BCryptPasswordEncoder()); // ele fará a validação no banco de dados
}
@Override
protected void configure(HttpSecurity http) throws Exception {
http.authorizeRequests() // começa dzendo que como será as autorizações a baixo
.antMatchers("/").permitAll()
.antMatchers("/login").permitAll() // autorizei que essa requisição qualquer posso pode fazer
//.antMatchers("pessoas/admin//**").hasRole("ADMIN") // quando quer daixar aquela autorization somente quem tem role ADMIN
.anyRequest().authenticated() // todos outros acessos tem que ser com acesso ao sistema
.and().logout().logoutSuccessUrl("/index")
//.and().httpBasic() // sessão será com acesso básico //
// não terá session o sistema //
.and().sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS)
//.and().csrf().disable(); // dispensa configuração csrf
.and().csrf().csrfTokenRepository(CookieCsrfTokenRepository.withHttpOnlyFalse()); //proteção para não acesso em token
}
}
| [
"75265629+gerlingabriel@users.noreply.github.com"
] | 75265629+gerlingabriel@users.noreply.github.com |
1ae0f3d184bfc95eaea39dc5b4b8e9b723d82ca7 | 55be1659a048fb208cf3c10115068846bb134265 | /addressbook-web-tests/src/test/java/com/telran/qa16/generators/ContactDataGenerator.java | cf483d703ff979f4ef92dd3ba2f1e3d83353a35b | [
"Apache-2.0"
] | permissive | IrinaYukh/IrinaYukhQA16 | f93bd6a29127fc3af343173c5e370694c785534a | cb54183fe86c025b9531c5b540416f8fb233cd2a | refs/heads/master | 2020-03-22T10:03:52.380188 | 2018-09-18T13:20:49 | 2018-09-18T13:20:49 | 139,878,522 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,302 | java | package com.telran.qa16.generators;
import com.telran.qa16.model.ContactData;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.Writer;
import java.util.ArrayList;
import java.util.List;
public class ContactDataGenerator
{
public static void main (String [] args) throws IOException {
int count = Integer.parseInt(args[0]);
File file = new File (args[1]);
List<ContactData> contacts = GenerateContacts (count);
save(contacts,file);
}
private static void save(List<ContactData> contacts, File file) throws IOException
{
Writer writer = new FileWriter(file);
for(ContactData contact: contacts)
{
writer.write(String.format("%s, %s, %s\n", contact.getFirstname(), contact.getLastname(), contact.getAddress()));
}
writer.close();
}
private static List<ContactData> GenerateContacts(int count)
{
List<ContactData> contacts = new ArrayList<>();
for(int i = 1; i<=count; i++)
{
contacts.add(new ContactData().setFirstname(String.format("First name %s", i))
.setLastname(String.format("Last name %s", i)).setAddress(String.format("Address %s", i)));
}
return contacts;
}
}
| [
"40866840+IrinaYukh@users.noreply.github.com"
] | 40866840+IrinaYukh@users.noreply.github.com |
d4392b092a62219977aef98fc63934cafce05840 | 16128b54ed0ef0bc7b8c2cf4d87058baa5517543 | /src/test/java/com/shinelon/credit/crawler/html/TargetHtmlTest.java | 0d3e738f2d869ee822a454488ffdba1ea482a805 | [] | no_license | shinelon/webmagic-crawler | 86549f0df01ac56a3b9fbe3dc942c689ef203b7f | 200f97e619a515a3b388e69a1ad5d2e003f406b3 | refs/heads/master | 2023-08-09T04:29:20.238295 | 2019-12-17T06:15:54 | 2019-12-17T06:15:54 | 159,316,541 | 0 | 2 | null | 2023-07-20T07:00:45 | 2018-11-27T10:18:50 | Java | UTF-8 | Java | false | false | 66,389 | java | /**
*TargetHtmlTest.java
*
* 2018年11月26日
*
* @author shinelon
*/
package com.shinelon.credit.crawler.html;
import org.apache.commons.lang3.StringUtils;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import us.codecraft.webmagic.selector.Html;
import us.codecraft.webmagic.selector.Selectable;
/**
* TargetHtmlTest.java
*
* @author syq
*
*/
public class TargetHtmlTest {
private static final Logger logger = LoggerFactory.getLogger(TargetHtmlTest.class);
private Html listHtml= new Html(TARGET_HTML_STR);
@Test
public void findContentTest() {
String content = listHtml.xpath("//div[@class=\"single-content\"]").get();
logger.info("content:{}",content);
Document doc = Jsoup.parse(content);
String text = doc.select("div").text();
logger.info("ticontenttle text:{}",text);
}
@Test
public void findTitleTest() {
String title = listHtml.xpath("//h1[@class=\"entry-title\"]").get();
logger.info("title:{}",title);
Document doc = Jsoup.parse(title);
String text = doc.select("h1").text();
logger.info("title text:{}",text);
}
@Test
public void findKeywordsTest() {
Selectable keywords = listHtml.xpath("/html/head/meta[7]");
logger.info("keywords:{}",keywords.get());
Document doc = Jsoup.parse(keywords.get());
String content = doc.select("meta").attr("content");
logger.info("keywords content:{}",content);
}
@Test
public void findBankNameTest() {
String keywords = "上海银行信用卡优惠,上海银行信用卡活动";
String[] split = StringUtils.split(keywords, ",");
int indexOf = StringUtils.indexOf(split[0], "信用卡");
String substring = StringUtils.substring(split[0], 0,indexOf);
logger.info("findBankName:{}",substring);
}
private static final String TARGET_HTML_STR="\r\n" +
"<!DOCTYPE html>\r\n" +
"<html lang=\"zh-CN\">\r\n" +
"<head>\r\n" +
"<meta charset=\"UTF-8\">\r\n" +
"<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no\">\r\n" +
"<meta http-equiv=\"Cache-Control\" content=\"no-transform\" />\r\n" +
"<meta http-equiv=\"Cache-Control\" content=\"no-siteapp\" />\r\n" +
"<meta name=\"baidu_union_verify\" content=\"840d7e94142d30e03eb831b802362791\">\r\n" +
"<title>上海银行信用卡移动支付每周享好礼 | 羊毛优惠</title>\r\n" +
"<meta name=\"description\" content=\"活动时间:\" />\r\n" +
"<meta name=\"keywords\" content=\"上海银行信用卡优惠,上海银行信用卡活动\" />\r\n" +
"<link rel=\"shortcut icon\" href=\"https://static.zrfan.com/wp-content/themes/begin/img/favicon.ico\">\r\n" +
"<link rel=\"apple-touch-icon\" sizes=\"114x114\" href=\"https://static.zrfan.com/wp-content/themes/begin/img/favicon.png\" />\r\n" +
"<link rel=\"profile\" href=\"http://gmpg.org/xfn/11\">\r\n" +
"<link rel=\"pingback\" href=\"//www.zrfan.com/xmlrpc.php\">\r\n" +
"<!--[if lt IE 9]>\r\n" +
"<script src=\"https://static.zrfan.com/wp-content/themes/begin/js/html5.js\"></script>\r\n" +
"<script src=\"https://static.zrfan.com/wp-content/themes/begin/js/css3-mediaqueries.js\"></script>\r\n" +
"<![endif]-->\r\n" +
"<link rel='stylesheet' id='dwqa-style-css' href='https://static.zrfan.com/wp-content/plugins/dw-question-answer/templates/assets/css/style.css?ver=180720161352' type='text/css' media='all' />\r\n" +
"<link rel='stylesheet' id='dwqa-rtl-css' href='https://static.zrfan.com/wp-content/plugins/dw-question-answer/templates/assets/css/rtl.css?ver=180720161352' type='text/css' media='all' />\r\n" +
"<link rel='stylesheet' id='begin-style-css' href='https://static.zrfan.com/wp-content/themes/begin/style.css?ver=4.7.11' type='text/css' media='all' />\r\n" +
"<link rel='stylesheet' id='fonts-css' href='https://static.zrfan.com/wp-content/themes/begin/css/fonts.css?ver=2017.02.04' type='text/css' media='all' />\r\n" +
"<link rel='stylesheet' id='dw-css' href='https://static.zrfan.com/wp-content/themes/begin/css/dw.css?ver=2017.02.04' type='text/css' media='all' />\r\n" +
"<script type='text/javascript' src='https://static.zrfan.com/wp-content/themes/begin/js/jquery.min.js?ver=1.10.1'></script>\r\n" +
"<script type='text/javascript' src='https://static.zrfan.com/wp-content/themes/begin/js/slides.js?ver=2017.02.04'></script>\r\n" +
"<script type='text/javascript' src='https://static.zrfan.com/wp-content/themes/begin/js/jquery.qrcode.min.js?ver=2017.02.04'></script>\r\n" +
"<script type='text/javascript' src='https://static.zrfan.com/wp-content/themes/begin/js/wow.js?ver=0.1.9'></script>\r\n" +
"<script type='text/javascript' src='https://static.zrfan.com/wp-content/themes/begin/js/sticky.js?ver=1.6.0'></script>\r\n" +
"<script type='text/javascript' src='https://static.zrfan.com/wp-content/themes/begin/js/jquery-ias.js?ver=2.2.1'></script>\r\n" +
"<script type='text/javascript' src='https://static.zrfan.com/wp-content/themes/begin/js/jquery.lazyload.js?ver=2017.02.04'></script>\r\n" +
"<script type='text/javascript' src='https://static.zrfan.com/wp-content/themes/begin/js/tipso.js?ver=1.0.1'></script>\r\n" +
"<script type='text/javascript'>\r\n" +
"/* <![CDATA[ */\r\n" +
"var wpl_ajax_url = \"https:\\/\\/www.zrfan.com\\/wp-admin\\/admin-ajax.php\";\r\n" +
"/* ]]> */\r\n" +
"</script>\r\n" +
"<script type='text/javascript' src='https://static.zrfan.com/wp-content/themes/begin/js/script.js?ver=2017.02.04'></script>\r\n" +
"<script type='text/javascript' src='https://static.zrfan.com/wp-content/themes/begin/js/flexisel.js?ver=2017.02.04'></script>\r\n" +
"<script type='text/javascript' src='https://static.zrfan.com/wp-content/themes/begin/js/fancybox.js?ver=2017.02.04'></script>\r\n" +
"<script type='text/javascript' src='https://static.zrfan.com/wp-content/themes/begin/js/comments-ajax-qt.js?ver=2017.02.04'></script>\r\n" +
"<link rel=\"canonical\" href=\"//www.zrfan.com/2460.html\" />\r\n" +
"<style>.single-content img{margin: 0 auto;}\r\n" +
"@media screen and (max-width: 550px) {\r\n" +
" .add-info {\r\n" +
" display: none;\r\n" +
" }\r\n" +
"}\r\n" +
"#site-nav .down-menu li {\r\n" +
" font-weight: bold;\r\n" +
" font-size: 15px;\r\n" +
"}\r\n" +
"@media screen and (max-width: 550px) {\r\n" +
" .add-info {\r\n" +
" display: none;\r\n" +
" }\r\n" +
"}\r\n" +
"\r\n" +
".stamp {width: 330px;height: 140px;padding: 0 10px;position: relative;overflow: hidden;margin:5px;}\r\n" +
".stamp:before {content: '';position: absolute;top:0;bottom:0;left:10px;right:10px;z-index: -1;}\r\n" +
".stamp:after {content: '';position: absolute;left: 10px;top: 10px;right: 10px;bottom: 10px;box-shadow: 0 0 20px 1px rgba(0, 0, 0, 0.5);z-index: -2;}\r\n" +
".stamp .par{float: left;padding: 16px 15px;width: 220px;border-right:2px dashed rgba(255,255,255,.3);text-align: left;}\r\n" +
".stamp .par p{color:#fff;}\r\n" +
".stamp .par span{font-size: 50px;color:#fff;margin-right: 5px;}\r\n" +
".stamp .par .sign{font-size: 34px;}\r\n" +
".stamp .par sub{position: relative;top:-5px;color:rgba(255,255,255,.8);}\r\n" +
".stamp .copy{display: inline-block;padding:21px 14px;width:80px;vertical-align: text-bottom;font-size: 30px;color:rgb(255,255,255);}\r\n" +
".stamp .copy p{font-size: 16px;margin-top: 15px;}\r\n" +
"\r\n" +
".stamp01{background: #F39B00;background: radial-gradient(rgba(0, 0, 0, 0) 0, rgba(0, 0, 0, 0) 5px, #F39B00 5px);background-size: 15px 15px;background-position: 9px 3px;float:left}\r\n" +
".stamp01:before{background-color:#F39B00;}\r\n" +
".stamp01 .copy a{background-color:#e07c00;color:#fff;font-size: 16px;text-decoration:none;padding:25px 10px;border-radius:35px;display: block;}\r\n" +
"\r\n" +
".container{\r\n" +
" width: 100%;\r\n" +
" height: 350px;\r\n" +
" border:3px black solid;\r\n" +
" }</style><script async src=\"//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js\"></script>\r\n" +
"<script>\r\n" +
" (adsbygoogle = window.adsbygoogle || []).push({\r\n" +
" google_ad_client: \"ca-pub-2207325541606966\",\r\n" +
" enable_page_level_ads: true\r\n" +
" });\r\n" +
"</script></head>\r\n" +
"<body class=\"post-template-default single single-post postid-15842 single-format-standard\">\r\n" +
"<div id=\"page\" class=\"hfeed site\">\r\n" +
" <header id=\"masthead\" class=\"site-header\">\r\n" +
"\r\n" +
" <nav id=\"top-header\">\r\n" +
" <div class=\"top-nav\">\r\n" +
" <div id=\"user-profile\">\r\n" +
" <div class=\"user-login\">欢迎光临!</div>\r\n" +
" \r\n" +
" <div class=\"nav-set\">\r\n" +
" <div class=\"nav-login\">\r\n" +
" <a href=\"#login\" class=\"flatbtn\" id=\"login-main\" ><i class=\"fa fa-sign-in\"></i>登录</a>\r\n" +
" </div>\r\n" +
" </div>\r\n" +
" <div class=\"clear\"></div>\r\n" +
"</div> \r\n" +
" <div class=\"menu-%e9%a1%b6%e9%83%a8-container\"><ul id=\"menu-%e9%a1%b6%e9%83%a8\" class=\"top-menu\"><li id=\"menu-item-8069\" class=\"menu-item menu-item-type-post_type menu-item-object-page menu-item-8069\"><a href=\"//www.zrfan.com/dada\">活动问答</a></li>\r\n" +
"<li id=\"menu-item-7908\" class=\"menu-item menu-item-type-post_type menu-item-object-page menu-item-7908\"><a href=\"//www.zrfan.com/blog\">最新优惠</a></li>\r\n" +
"<li id=\"menu-item-7845\" class=\"menu-item menu-item-type-post_type menu-item-object-page menu-item-7845\"><a href=\"//www.zrfan.com/phone\">充值优惠</a></li>\r\n" +
"<li id=\"menu-item-8159\" class=\"menu-item menu-item-type-post_type menu-item-object-page menu-item-8159\"><a href=\"//www.zrfan.com/qian\">还款优惠</a></li>\r\n" +
"</ul></div> </div>\r\n" +
" </nav><!-- #top-header -->\r\n" +
"\r\n" +
" <div id=\"menu-box\">\r\n" +
" <div id=\"top-menu\">\r\n" +
" <span class=\"nav-search\"><i class=\"fa fa-search\"></i></span>\r\n" +
" <span class=\"mobile-login\"><a href=\"#login\" id=\"login-mobile\" ><i class=\"fa fa-user\"></i></a></span>\r\n" +
" <div class=\"logo-sites\">\r\n" +
" <p class=\"site-title\">\r\n" +
" <a href=\"//www.zrfan.com/\"><img src=\"//www.zrfan.com/cdn/2017/02/20170207101722231.png\" title=\"羊毛优惠\" alt=\"羊毛优惠\" rel=\"home\" /><span class=\"site-name\">羊毛优惠</span></a>\r\n" +
" </p>\r\n" +
" </div><!-- .logo-site -->\r\n" +
"\r\n" +
" <div id=\"site-nav-wrap\">\r\n" +
" <div id=\"sidr-close\"><a href=\"#sidr-close\" class=\"toggle-sidr-close\">×</a></div>\r\n" +
" <nav id=\"site-nav\" class=\"main-nav\">\r\n" +
" <a href=\"#sidr-main\" id=\"navigation-toggle\" class=\"bars\"><i class=\"fa fa-bars\"></i></a>\r\n" +
" <div class=\"menu-%e4%b8%bb%e8%8f%9c%e5%8d%95-container\"><ul id=\"menu-%e4%b8%bb%e8%8f%9c%e5%8d%95\" class=\"down-menu nav-menu\"><li id=\"menu-item-7729\" class=\"menu-item menu-item-type-taxonomy menu-item-object-category menu-item-7729\"><a href=\"//www.zrfan.com/category/jingxuan/\"><i class=\"fa-star fa\"></i><span class=\"font-text\">精选</span></a></li>\r\n" +
"<li id=\"menu-item-12372\" class=\"menu-item menu-item-type-taxonomy menu-item-object-category menu-item-12372\"><a href=\"//www.zrfan.com/category/zhinan/\"><i class=\"fa-book fa\"></i><span class=\"font-text\">每日刷卡指南</span></a></li>\r\n" +
"<li id=\"menu-item-7733\" class=\"menu-item menu-item-type-taxonomy menu-item-object-category current-post-ancestor menu-item-has-children menu-item-7733\"><a href=\"//www.zrfan.com/category/bank/\"><i class=\"fa-credit-card-alt fa\"></i><span class=\"font-text\">银行卡</span></a>\r\n" +
"<ul class=\"sub-menu\">\r\n" +
" <li id=\"menu-item-7753\" class=\"menu-item menu-item-type-taxonomy menu-item-object-category menu-item-has-children menu-item-7753\"><a href=\"//www.zrfan.com/category/guoyou/\">四大国有银行</a>\r\n" +
" <ul class=\"sub-menu\">\r\n" +
" <li id=\"menu-item-7743\" class=\"menu-item menu-item-type-taxonomy menu-item-object-category menu-item-7743\"><a href=\"//www.zrfan.com/category/bank/gongshang/\">工商银行优惠活动</a></li>\r\n" +
" <li id=\"menu-item-7736\" class=\"menu-item menu-item-type-taxonomy menu-item-object-category menu-item-7736\"><a href=\"//www.zrfan.com/category/bank/zhonghang/\">中国银行优惠活动</a></li>\r\n" +
" <li id=\"menu-item-7740\" class=\"menu-item menu-item-type-taxonomy menu-item-object-category menu-item-7740\"><a href=\"//www.zrfan.com/category/bank/nongye/\">农业银行优惠活动</a></li>\r\n" +
" <li id=\"menu-item-7746\" class=\"menu-item menu-item-type-taxonomy menu-item-object-category menu-item-7746\"><a href=\"//www.zrfan.com/category/bank/jianshe/\">建设银行优惠活动</a></li>\r\n" +
" </ul>\r\n" +
"</li>\r\n" +
" <li id=\"menu-item-7752\" class=\"menu-item menu-item-type-taxonomy menu-item-object-category menu-item-has-children menu-item-7752\"><a href=\"//www.zrfan.com/category/gufen/\">全国股份制银行</a>\r\n" +
" <ul class=\"sub-menu\">\r\n" +
" <li id=\"menu-item-7735\" class=\"menu-item menu-item-type-taxonomy menu-item-object-category menu-item-7735\"><a href=\"//www.zrfan.com/category/bank/youchu/\">中国邮政储蓄银行</a></li>\r\n" +
" <li id=\"menu-item-7747\" class=\"menu-item menu-item-type-taxonomy menu-item-object-category menu-item-7747\"><a href=\"//www.zrfan.com/category/bank/zhaoshang/\">招商银行优惠活动</a></li>\r\n" +
" <li id=\"menu-item-7734\" class=\"menu-item menu-item-type-taxonomy menu-item-object-category menu-item-7734\"><a href=\"//www.zrfan.com/category/bank/zhongxin/\">中信银行优惠活动</a></li>\r\n" +
" <li id=\"menu-item-7737\" class=\"menu-item menu-item-type-taxonomy menu-item-object-category menu-item-7737\"><a href=\"//www.zrfan.com/category/bank/jiaotong/\">交通银行优惠活动</a></li>\r\n" +
" <li id=\"menu-item-7738\" class=\"menu-item menu-item-type-taxonomy menu-item-object-category menu-item-7738\"><a href=\"//www.zrfan.com/category/bank/guangda/\">光大银行优惠活动</a></li>\r\n" +
" <li id=\"menu-item-7745\" class=\"menu-item menu-item-type-taxonomy menu-item-object-category menu-item-7745\"><a href=\"//www.zrfan.com/category/bank/guangfa/\">广发银行优惠活动</a></li>\r\n" +
" <li id=\"menu-item-7739\" class=\"menu-item menu-item-type-taxonomy menu-item-object-category menu-item-7739\"><a href=\"//www.zrfan.com/category/bank/xingye/\">兴业银行优惠活动</a></li>\r\n" +
" <li id=\"menu-item-7748\" class=\"menu-item menu-item-type-taxonomy menu-item-object-category menu-item-7748\"><a href=\"//www.zrfan.com/category/bank/minsheng/\">民生银行优惠活动</a></li>\r\n" +
" <li id=\"menu-item-7749\" class=\"menu-item menu-item-type-taxonomy menu-item-object-category menu-item-7749\"><a href=\"//www.zrfan.com/category/bank/pufa/\">浦发银行优惠活动</a></li>\r\n" +
" <li id=\"menu-item-7742\" class=\"menu-item menu-item-type-taxonomy menu-item-object-category menu-item-7742\"><a href=\"//www.zrfan.com/category/bank/hauxia/\">华夏银行优惠活动</a></li>\r\n" +
" <li id=\"menu-item-7744\" class=\"menu-item menu-item-type-taxonomy menu-item-object-category menu-item-7744\"><a href=\"//www.zrfan.com/category/bank/pingan/\">平安银行优惠活动</a></li>\r\n" +
" </ul>\r\n" +
"</li>\r\n" +
" <li id=\"menu-item-7754\" class=\"menu-item menu-item-type-taxonomy menu-item-object-category menu-item-has-children menu-item-7754\"><a href=\"//www.zrfan.com/category/difang/\">地方性银行</a>\r\n" +
" <ul class=\"sub-menu\">\r\n" +
" <li id=\"menu-item-8367\" class=\"menu-item menu-item-type-taxonomy menu-item-object-category menu-item-8367\"><a href=\"//www.zrfan.com/category/bank/zheshang/\">浙商银行优惠活动</a></li>\r\n" +
" <li id=\"menu-item-7741\" class=\"menu-item menu-item-type-taxonomy menu-item-object-category menu-item-7741\"><a href=\"//www.zrfan.com/category/bank/beijing/\">北京银行优惠活动</a></li>\r\n" +
" <li id=\"menu-item-7929\" class=\"menu-item menu-item-type-taxonomy menu-item-object-category current-post-ancestor current-menu-parent current-post-parent menu-item-7929\"><a href=\"//www.zrfan.com/category/bank/shanghai/\">上海银行优惠活动</a></li>\r\n" +
" </ul>\r\n" +
"</li>\r\n" +
" <li id=\"menu-item-7755\" class=\"menu-item menu-item-type-taxonomy menu-item-object-category menu-item-has-children menu-item-7755\"><a href=\"//www.zrfan.com/category/waizi/\">外资银行</a>\r\n" +
" <ul class=\"sub-menu\">\r\n" +
" <li id=\"menu-item-7750\" class=\"menu-item menu-item-type-taxonomy menu-item-object-category menu-item-7750\"><a href=\"//www.zrfan.com/category/bank/zhada/\">渣打银行优惠活动</a></li>\r\n" +
" <li id=\"menu-item-8366\" class=\"menu-item menu-item-type-taxonomy menu-item-object-category menu-item-8366\"><a href=\"//www.zrfan.com/category/bank/%e6%b1%87%e4%b8%b0/\">汇丰银行优惠活动</a></li>\r\n" +
" </ul>\r\n" +
"</li>\r\n" +
" <li id=\"menu-item-7732\" class=\"menu-item menu-item-type-taxonomy menu-item-object-category menu-item-7732\"><a href=\"//www.zrfan.com/category/huafei/yinlian/\">银联</a></li>\r\n" +
"</ul>\r\n" +
"</li>\r\n" +
"<li id=\"menu-item-7727\" class=\"menu-item menu-item-type-taxonomy menu-item-object-category menu-item-7727\"><a href=\"//www.zrfan.com/category/lichai/\"><i class=\"fa-money fa\"></i><span class=\"font-text\">理财</span></a></li>\r\n" +
"<li id=\"menu-item-7731\" class=\"menu-item menu-item-type-taxonomy menu-item-object-category menu-item-7731\"><a href=\"//www.zrfan.com/category/huafei/\"><i class=\"fa-phone-square fa\"></i><span class=\"font-text\">话费</span></a></li>\r\n" +
"<li id=\"menu-item-7730\" class=\"menu-item menu-item-type-taxonomy menu-item-object-category menu-item-7730\"><a href=\"//www.zrfan.com/category/wangluozhifu/\"><i class=\"fa-internet-explorer fa\"></i><span class=\"font-text\">网付</span></a></li>\r\n" +
"<li id=\"menu-item-12683\" class=\"menu-item menu-item-type-taxonomy menu-item-object-category menu-item-has-children menu-item-12683\"><a href=\"//www.zrfan.com/category/youhuiquan/\"><i class=\"fa-youtube-play fa\"></i><span class=\"font-text\">优惠券</span></a>\r\n" +
"<ul class=\"sub-menu\">\r\n" +
" <li id=\"menu-item-12684\" class=\"menu-item menu-item-type-post_type menu-item-object-page menu-item-12684\"><a href=\"//www.zrfan.com/jdquan\">京东优惠券</a></li>\r\n" +
"</ul>\r\n" +
"</li>\r\n" +
"<li id=\"menu-item-7724\" class=\"menu-item menu-item-type-taxonomy menu-item-object-category menu-item-7724\"><a href=\"//www.zrfan.com/category/yongkazhinan/\"><i class=\"fa-graduation-cap fa\"></i><span class=\"font-text\">用卡指南</span></a></li>\r\n" +
"</ul></div> </nav><!-- #site-nav -->\r\n" +
" </div><!-- #site-nav-wrap -->\r\n" +
" <div class=\"clear\"></div>\r\n" +
" </div><!-- #top-menu -->\r\n" +
" </div><!-- #menu-box -->\r\n" +
"</header><!-- #masthead -->\r\n" +
"\r\n" +
"<div id=\"search-main\">\r\n" +
" <div class=\"searchbar\">\r\n" +
" <form method=\"get\" id=\"searchform\" action=\"//www.zrfan.com/\">\r\n" +
" <span>\r\n" +
" <input type=\"text\" value=\"\" name=\"s\" id=\"s\" placeholder=\"输入搜索内容\" required />\r\n" +
" <button type=\"submit\" id=\"searchsubmit\">搜索</button>\r\n" +
" </span>\r\n" +
"\r\n" +
" </form>\r\n" +
"</div> <div class=\"clear\"></div>\r\n" +
"</div> <nav class=\"breadcrumb\">\r\n" +
" <a class=\"crumbs\" href=\"//www.zrfan.com/\"><i class=\"fa fa-home\"></i>首页</a><i class=\"fa fa-angle-right\"></i><a href=\"//www.zrfan.com/category/bank/\">银行优惠活动</a><i class=\"fa fa-angle-right\"></i><a href=\"//www.zrfan.com/category/bank/shanghai/\" rel=\"category tag\">上海银行优惠活动</a><i class=\"fa fa-angle-right\"></i>正文 </nav>\r\n" +
" <div class=\"header-sub\">\r\n" +
" <div class=\"ad-pc ad-site\"><script async src=\"//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js\"></script>\r\n" +
"<!-- 评论 -->\r\n" +
"<ins class=\"adsbygoogle\"\r\n" +
" style=\"display:block\"\r\n" +
" data-ad-client=\"ca-pub-2207325541606966\"\r\n" +
" data-ad-slot=\"9555081399\"\r\n" +
" data-ad-format=\"auto\"></ins>\r\n" +
"<script>\r\n" +
"(adsbygoogle = window.adsbygoogle || []).push({});\r\n" +
"</script></div> <div class=\"clear\"></div>\r\n" +
" </div>\r\n" +
"\r\n" +
" <div id=\"content\" class=\"site-content\">\r\n" +
" <div id=\"primary\" class=\"content-area\">\r\n" +
" <main id=\"main\" class=\"site-main\" role=\"main\">\r\n" +
"\r\n" +
" \r\n" +
" <article id=\"post-15842\" class=\"post-15842 post type-post status-publish format-standard hentry category-shanghai tag-255 tag-256 rrs\">\r\n" +
" <header class=\"entry-header\">\r\n" +
" <h1 class=\"entry-title\">上海银行信用卡移动支付每周享好礼</h1> </header><!-- .entry-header -->\r\n" +
"\r\n" +
" <div class=\"entry-content\">\r\n" +
" <div class=\"single-content\">\r\n" +
" \r\n" +
" \r\n" +
" <p><a href=\"//www.zrfan.com/cdn/2018/11/20181125125857202.jpg\" class=\"fancybox\" data-fancybox-group=\"button\"><img class=\"aligncenter size-full wp-image-15843\" src=\"//www.zrfan.com/cdn/2018/11/20181125125857202.jpg\" alt=\"上海银行信用卡移动支付每周享好礼\" alt=\"\" width=\"500\" height=\"800\" /></a></p>\r\n" +
"<h2>活动时间:</h2>\r\n" +
"<p>2018年11月26日——2018年12月30日</p>\r\n" +
"<h2>活动内容:</h2>\r\n" +
"<p>11/26-12/2、12/3-12/9、12/10-12/16、12/17-12/23、12/24-12/30期间每周满3笔移动支付不限金额,享抽奖1次,每周最高享3次抽奖机会!</p>\r\n" +
"<h2>抽奖礼品:</h2>\r\n" +
"<p>康宁百丽餐具双耳饭碗三件套、K.S.菲奥纳真空焖烧罐、乐扣乐扣热水壶、福临门东町越光米2kg、欧丽薇兰特级初榨橄榄油500ml、哈根达斯单球冰淇淋权益、优酷土豆黄金会员权益(1个月)、腾讯视频VIP权益(1个月)、9积分、99积分、999积分、9999积分。</p>\r\n" +
"<p>注:</p>\r\n" +
"<p>1. <span style=\"color: #ff0000;\">每周每户最高享3次抽奖机会</span>,需至手机银行-首页—热门活动-达标抽奖参与;每周抽奖礼品动态调整,详见手机银行抽奖页面。</p>\r\n" +
"<p>2. 移动支付类型:支付宝快捷支付、微信快捷支付、云闪付支付;其中云闪付支付仅含二维码支付和手机闪付;其中二维码支付包括:上海银行手机银行二维码、云闪付APP二维码;手机闪付包括:Apple Pay、华为Pay、小米Pay。</p>\r\n" +
"<h2>活动细则:</h2>\r\n" +
"<p>1. 本活动适用于账户及卡片状态正常的上海银行个人信用卡持卡人(各类单标境外卡、单位信用卡除外),主附卡交易金额合并计算,附属卡交易归入主卡统计。</p>\r\n" +
"<p>2. 本活动限移动支付类型消费:支付宝快捷支付、微信快捷支付、云闪付支付。其中云闪付支付仅含二维码支付和手机闪付;其中二维码支付包括:上海银行手机银行二维码、云闪付APP二维码;手机闪付包括:Apple Pay、华为Pay、小米Pay。</p>\r\n" +
"<p>3. 交易统计时间、交易金额以上海银行信用卡系统记录的交易时间为准,因时差、商户及收单行结算交易延迟等原因造成的交易不符合活动条件,卡中心不承担任何责任。</p>\r\n" +
"<p>4. 若发生全额退货导致交易金额不符活动要求,该笔原始交易将不予以统计。</p>\r\n" +
"<p>5. 每周活动结束后,我行将于次周以短信通知达标客户,客户需在指定时间内至手机银行参与抽奖,其中手机银行绑定的手机号必须与办理信用卡预留手机号一致。逾期未领取视为自动放弃抽奖资格。如领奖过程有任何问题,详询在线客服。</p>\r\n" +
"<p>1) 积分奖励于客户领取后45日内优先导入客户(主卡人)名下任意一张计上海银行积分的有效信用卡;积分有效期至2019年12月31日。如客户名下仅有吉祥航空联名信用卡、联通联名信用卡、彩贝联名信用卡、上海银行唯品花联名信用卡、京东小白信用卡、美团点评美食联名信用卡,积分奖励将转为任意一张联名卡的积分。联名卡积分转化以具体联名卡转换规则为准。</p>\r\n" +
"<p>2) 实物礼品奖励(康宁百丽餐具双耳饭碗三件套、K.S.菲奥纳真空焖烧罐、乐扣乐扣热水壶、福临门东町越光米2kg、欧丽薇兰特级初榨橄榄油500ml)于客户领取后45日内,由指定供应商配送至客户领奖时登记的地址(未登记地址的按客户账单地址配送)。如因客户的信息登记错误导致礼品未收到,由客户自行承担。</p>\r\n" +
"<p>3) 电子权益(优酷视频、腾讯视频、哈根达斯单球)于客户领取后45日内发送电子码至达标客户的信用卡预留手机号,若因客户手机号码问题导致未收到发码短信、因客户本人未妥善保存电子码导致券码泄露或过期未使用等情况,责任由客户自行承担,我行将不予补发,请在有效期内使用。</p>\r\n" +
"<p>6. 上海银行非本次礼品的提供商,如有任何礼品质量或与礼品有关的问题,我行将协助持卡人与商家协商解决。奖品以客户实际抽取为准,不得调换。所赠积分及实物礼品不可兑换现金或同等价值的其他礼品。</p>\r\n" +
"<p>7. 客户若未收到奖励或对奖励有异议,可于2019年3月31日前致电上海银行客服热线95594反馈,逾期将视为放弃反馈权利,我行将不再受理。</p>\r\n" +
"<p>8. 客户如有以下任一情况:所持信用卡被停用或管制、自行注销信用卡、拒不偿还上海银行信用卡欠款、在信用卡使用中存在欺诈或舞弊行为及违反本活动办法及其他相关规定的,卡中心有权取消其参加本活动的资格并无须另行通知持卡人。</p>\r\n" +
"<p>9. 法律许可范围内,卡中心有权修订本活动条款及细则(包括但不限于参加资格、消费时间及奖励方式等)、暂停或取消本活动,并经相关途径(如我行官方网站、短信、微信、各分支行网点等)公告后生效。</p>\r\n" +
"<p>10. 其他未尽事宜,仍受《上海银行信用卡章程》、《上海银行信用卡领用合约》及其他相关文件约束。</p>\r\n" +
"<p>11. 本行员工不得参加本次抽奖活动。</p>\r\n" +
" </div>\r\n" +
"\r\n" +
" \r\n" +
" \r\n" +
" <span class=\"content-more\"><a href=\"http://www.bosc.cn/zh/xyk/xyk_ywdt/78848.shtml\" target=\"_blank\" rel=\"nofollow\">直达链接</a></span>\r\n" +
" \r\n" +
" <div class=\"s-weixin\">\r\n" +
" <ul class=\"weimg1\">\r\n" +
" <li>\r\n" +
" <strong>QQ群</strong>\r\n" +
" </li>\r\n" +
" <li></li>\r\n" +
" <li>\r\n" +
" <img src=\"//www.zrfan.com/cdn/2017/12/20171222113807593.png\" alt=\"weinxin\" />\r\n" +
" </li>\r\n" +
" </ul>\r\n" +
" <ul class=\"weimg2\">\r\n" +
" <li>\r\n" +
" <strong>微信公众号</strong>\r\n" +
" </li>\r\n" +
" <li></li>\r\n" +
" <li>\r\n" +
" <img src=\"//www.zrfan.com/cdn/2017/02/20170220133517262.jpg\" alt=\"weinxin\" />\r\n" +
" </li>\r\n" +
" </ul>\r\n" +
" <div class=\"clear\"></div>\r\n" +
"</div>\r\n" +
" \r\n" +
" <div class=\"clear\"></div>\r\n" +
"<div id=\"social\">\r\n" +
" <div class=\"social-main\">\r\n" +
" <span class=\"like\">\r\n" +
" <a href=\"javascript:;\" data-action=\"ding\" data-id=\"15842\" title=\"点赞\" class=\"favorite\"><i class=\"fa fa-thumbs-up\"></i>赞 <i class=\"count\">\r\n" +
" 0</i>\r\n" +
" </a>\r\n" +
" </span>\r\n" +
" <div class=\"shang-p\">\r\n" +
" <div class=\"shang-empty\"><span></span></div>\r\n" +
" <span class=\"tipso_style\" id=\"tip-p\" data-tipso='\r\n" +
" <span id=\"shang\">\r\n" +
" <span class=\"shang-main\">\r\n" +
" <h4><i class=\"fa fa-heart\" aria-hidden=\"true\"></i> 您可以选择一种方式赞助本站</h4> <span class=\"shang-img\">\r\n" +
" <img src=\"//www.zrfan.com/cdn/2017/02/20170206133025703.jpg\" alt=\"alipay\"/>\r\n" +
" <h4>支付宝扫一扫赞助</h4> </span>\r\n" +
" \r\n" +
" <span class=\"shang-img\">\r\n" +
" <img src=\"//www.zrfan.com/cdn/2017/02/20170206133040156.png\" alt=\"weixin\"/>\r\n" +
" <h4>微信钱包扫描赞助</h4> </span>\r\n" +
" <span class=\"clear\"></span>\r\n" +
" </span>\r\n" +
" </span>'>\r\n" +
" <span class=\"shang-s\"><a title=\"赞助本站\">赏</a></span>\r\n" +
" </span>\r\n" +
" </div>\r\n" +
" <div class=\"share-sd\">\r\n" +
" <span class=\"share-s\"><a href=\"javascript:void(0)\" id=\"share-s\" title=\"分享\"><i class=\"fa fa-share-alt\"></i>分享</a></span>\r\n" +
" <div id=\"share\">\r\n" +
" <ul class=\"bdsharebuttonbox\">\r\n" +
" <li><a title=\"更多\" class=\"bds_more fa fa-plus-square\" data-cmd=\"more\" onclick=\"return false;\" href=\"#\"></a></li>\r\n" +
" <li><a title=\"分享到QQ空间\" class=\"fa fa-qq\" data-cmd=\"qzone\" onclick=\"return false;\" href=\"#\"></a></li>\r\n" +
" <li><a title=\"分享到新浪微博\" class=\"fa fa-weibo\" data-cmd=\"tsina\" onclick=\"return false;\" href=\"#\"></a></li>\r\n" +
" <li><a title=\"分享到腾讯微博\" class=\"fa fa-pinterest-square\" data-cmd=\"tqq\" onclick=\"return false;\" href=\"#\"></a></li>\r\n" +
" <li><a title=\"分享到人人网\" class=\"fa fa-renren\" data-cmd=\"renren\" onclick=\"return false;\" href=\"#\"></a></li>\r\n" +
" <li><a title=\"分享到微信\" class=\"fa fa-weixin\" data-cmd=\"weixin\" onclick=\"return false;\" href=\"#\"></a></li>\r\n" +
" </ul>\r\n" +
"</div> </div>\r\n" +
" <div class=\"clear\"></div>\r\n" +
" </div>\r\n" +
"</div> \r\n" +
" <div class=\"ad-pc ad-site\"><script async src=\"//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js\"></script>\r\n" +
"<!-- 优惠文章页 -->\r\n" +
"<ins class=\"adsbygoogle\"\r\n" +
" style=\"display:block\"\r\n" +
" data-ad-client=\"ca-pub-2207325541606966\"\r\n" +
" data-ad-slot=\"4457451393\"\r\n" +
" data-ad-format=\"auto\"></ins>\r\n" +
"<script>\r\n" +
"(adsbygoogle = window.adsbygoogle || []).push({});\r\n" +
"</script></div>\r\n" +
" \r\n" +
" <footer class=\"single-footer\">\r\n" +
" <ul class=\"single-meta\"><li class=\"print\"><a href=\"javascript:printme()\" target=\"_self\" title=\"打印\"><i class=\"fa fa-print\"></i></a></li><li class=\"comment\"><a href=\"//www.zrfan.com/2460.html#respond\" rel=\"external nofollow\"><i class=\"fa fa-comment-o\"></i> 发表评论</a></li><li class=\"views\"><i class=\"fa fa-eye\"></i> 95</li><li class=\"r-hide\"><a href=\"javascript:pr()\" title=\"侧边栏\"><i class=\"fa fa-caret-left\"></i> <i class=\"fa fa-caret-right\"></i></a></li></ul><ul id=\"fontsize\"><li>A+</li></ul><div class=\"single-cat-tag\"><div class=\"single-cat\">所属分类:<a href=\"//www.zrfan.com/category/bank/shanghai/\" rel=\"category tag\">上海银行优惠活动</a></div></div> </footer><!-- .entry-footer -->\r\n" +
"\r\n" +
" <div class=\"clear\"></div>\r\n" +
" </div><!-- .entry-content -->\r\n" +
"\r\n" +
" </article><!-- #post -->\r\n" +
"\r\n" +
"<div class=\"single-tag\"><ul class=\"wow fadeInUp\" data-wow-delay=\"0.3s\"><li><a href=\"//www.zrfan.com/tag/%e4%b8%8a%e6%b5%b7%e9%93%b6%e8%a1%8c%e4%bf%a1%e7%94%a8%e5%8d%a1%e4%bc%98%e6%83%a0/\" rel=\"tag\">上海银行信用卡优惠</a></li><li><a href=\"//www.zrfan.com/tag/%e4%b8%8a%e6%b5%b7%e9%93%b6%e8%a1%8c%e4%bf%a1%e7%94%a8%e5%8d%a1%e6%b4%bb%e5%8a%a8/\" rel=\"tag\">上海银行信用卡活动</a></li></ul></div>\r\n" +
" <div class=\"authorbio wow fadeInUp\" data-wow-delay=\"0.3s\">\r\n" +
" <img src=\"https://secure.gravatar.com/avatar/4022dc143931b70a6085968c674159d5?s=128&d=mm\" alt=\"avatar\" class=\"avatar avatar-128\" height=\"128\" width=\"128\">\r\n" +
" <ul class=\"spostinfo\">\r\n" +
" <li>\r\n" +
" <li><strong>版权声明:</strong>本页面文章,于15小时前,由 <b>匿名网友</b> 整理投稿,共 1715 字。</li>\r\n" +
" <li class=\"reprinted\"><strong>转载请注明:</strong><a href=\"//www.zrfan.com/2460.html\" rel=\"bookmark\" title=\"本文固定链接 https://www.zrfan.com/2460.html\">上海银行信用卡移动支付每周享好礼 | 羊毛优惠,并标明原文出处</a></li>\r\n" +
" </ul>\r\n" +
" <div class=\"clear\"></div>\r\n" +
"</div>\r\n" +
" \r\n" +
" \r\n" +
" <div id=\"related-img\" class=\"wow fadeInUp\" data-wow-delay=\"0.3s\">\r\n" +
" \r\n" +
" <div class=\"r4\">\r\n" +
" <div class=\"related-site\">\r\n" +
" <figure class=\"related-site-img\">\r\n" +
" <a href=\"//www.zrfan.com/2453.html\"><img src=\"//www.zrfan.com/wp-content/themes/begin/timthumb.php?src=https://www.zrfan.com/cdn/2018/11/20181122124003807.jpg&w=280&h=210&a=&zc=1\" alt=\"上海银行信用卡美团外卖下午茶随机立减最高99元\" /></a> </figure>\r\n" +
" <div class=\"related-title\"><a href=\"//www.zrfan.com/2453.html\">上海银行信用卡美团外卖下午茶随机立减最高99元</a></div>\r\n" +
" </div>\r\n" +
" </div>\r\n" +
"\r\n" +
" \r\n" +
" <div class=\"r4\">\r\n" +
" <div class=\"related-site\">\r\n" +
" <figure class=\"related-site-img\">\r\n" +
" <a href=\"//www.zrfan.com/2452.html\"><img src=\"//www.zrfan.com/wp-content/themes/begin/timthumb.php?src=https://www.zrfan.com/cdn/2018/11/20181122123701317.jpg&w=280&h=210&a=&zc=1\" alt=\"上海银行信用卡猫眼电影满50-25元(周五)\" /></a> </figure>\r\n" +
" <div class=\"related-title\"><a href=\"//www.zrfan.com/2452.html\">上海银行信用卡猫眼电影满50-25元(周五)</a></div>\r\n" +
" </div>\r\n" +
" </div>\r\n" +
"\r\n" +
" \r\n" +
" <div class=\"r4\">\r\n" +
" <div class=\"related-site\">\r\n" +
" <figure class=\"related-site-img\">\r\n" +
" <a href=\"//www.zrfan.com/2430.html\"><img src=\"//www.zrfan.com/wp-content/themes/begin/timthumb.php?src=https://www.zrfan.com/cdn/2018/11/20181116123955937.jpg&w=280&h=210&a=&zc=1\" alt=\"上海银行信用卡周六、周日至满记甜品、面包新语等品牌满50-20元\" /></a> </figure>\r\n" +
" <div class=\"related-title\"><a href=\"//www.zrfan.com/2430.html\">上海银行信用卡周六、周日至满记甜品、面包新语等品牌满50-20元</a></div>\r\n" +
" </div>\r\n" +
" </div>\r\n" +
"\r\n" +
" \r\n" +
" <div class=\"r4\">\r\n" +
" <div class=\"related-site\">\r\n" +
" <figure class=\"related-site-img\">\r\n" +
" <a href=\"//www.zrfan.com/2403.html\"><img src=\"//www.zrfan.com/wp-content/themes/begin/timthumb.php?src=https://www.zrfan.com/cdn/2018/11/20181108125936428.jpg&w=280&h=210&a=&zc=1\" alt=\"上海银行信用卡双十一尽情刷\" /></a> </figure>\r\n" +
" <div class=\"related-title\"><a href=\"//www.zrfan.com/2403.html\">上海银行信用卡双十一尽情刷</a></div>\r\n" +
" </div>\r\n" +
" </div>\r\n" +
"\r\n" +
" <div class=\"clear\"></div>\r\n" +
"</div> \r\n" +
" <div id=\"single-widget\">\r\n" +
" <div class=\"wow fadeInUp\" data-wow-delay=\"0.3s\">\r\n" +
" <aside id=\"random_post-3\" class=\"widget widget_random_post wow fadeInUp\" data-wow-delay=\"0.3s\"><h3 class=\"widget-title\"><span class=\"s-icon\"></span>猜您喜欢</h3>\r\n" +
"<div id=\"random_post_widget\">\r\n" +
" <ul>\r\n" +
" <li><a href=\"//www.zrfan.com/1848.html\" rel=\"bookmark\">上海银行信用卡网点享1元充10元话费</a></li>\r\n" +
" <li><a href=\"//www.zrfan.com/907.html\" rel=\"bookmark\">上海银行信用卡周五格瓦拉观影买一赠一、立减5元</a></li>\r\n" +
" <li><a href=\"//www.zrfan.com/880.html\" rel=\"bookmark\">上海银行信用卡五月日日刷,最高可得50w积分,还有1积分哈根达斯</a></li>\r\n" +
" <li><a href=\"//www.zrfan.com/2033.html\" rel=\"bookmark\">上海银行信用卡周三星巴克买一赠一</a></li>\r\n" +
" <li><a href=\"//www.zrfan.com/1202.html\" rel=\"bookmark\">上海银行信用卡周周刷9月</a></li>\r\n" +
" </ul>\r\n" +
"</div>\r\n" +
"\r\n" +
"<div class=\"clear\"></div></aside> <aside id=\"recent-posts-2\" class=\"widget widget_recent_entries wow fadeInUp\" data-wow-delay=\"0.3s\"> <h3 class=\"widget-title\"><span class=\"s-icon\"></span>最新优惠</h3> <ul>\r\n" +
" <li>\r\n" +
" <a href=\"//www.zrfan.com/2461.html\">2018-11-26日周一刷卡指南</a>\r\n" +
" </li>\r\n" +
" <li>\r\n" +
" <a href=\"//www.zrfan.com/2460.html\">上海银行信用卡移动支付每周享好礼</a>\r\n" +
" </li>\r\n" +
" <li>\r\n" +
" <a href=\"//www.zrfan.com/2459.html\">平安银行信用卡拼搏吧我的团</a>\r\n" +
" </li>\r\n" +
" <li>\r\n" +
" <a href=\"//www.zrfan.com/2458.html\">2018-11-25日周日刷卡指南</a>\r\n" +
" </li>\r\n" +
" <li>\r\n" +
" <a href=\"//www.zrfan.com/2457.html\">工商银行信用卡微信百大商户随机减</a>\r\n" +
" </li>\r\n" +
" </ul>\r\n" +
" <div class=\"clear\"></div></aside> </div>\r\n" +
" <div class=\"clear\"></div>\r\n" +
"</div>\r\n" +
"\r\n" +
" \r\n" +
" <nav class=\"nav-single wow fadeInUp\" data-wow-delay=\"0.3s\">\r\n" +
" <a href=\"//www.zrfan.com/2453.html\" rel=\"prev\"><span class=\"meta-nav\"><span class=\"post-nav\"><i class=\"fa fa-angle-left\"></i> 上一篇</span><br/>上海银行信用卡美团外卖下午茶随机立减最高99元</span></a><span class='meta-nav'><span class='post-nav'>没有了<br/></span>已是最新文章</span> <div class=\"clear\"></div>\r\n" +
" </nav>\r\n" +
"\r\n" +
" \r\n" +
" <nav class=\"navigation post-navigation\" role=\"navigation\">\r\n" +
" <h2 class=\"screen-reader-text\">文章导航</h2>\r\n" +
" <div class=\"nav-links\"><div class=\"nav-previous\"><a href=\"//www.zrfan.com/2459.html\" rel=\"prev\"><span class=\"meta-nav-r\" aria-hidden=\"true\"><i class=\"fa fa-angle-left\"></i></span></a></div><div class=\"nav-next\"><a href=\"//www.zrfan.com/2461.html\" rel=\"next\"><span class=\"meta-nav-l\" aria-hidden=\"true\"><i class=\"fa fa-angle-right\"></i></span></a></div></div>\r\n" +
" </nav>\r\n" +
" \r\n" +
"<!-- 引用 -->\r\n" +
"\r\n" +
"\r\n" +
"<div class=\"scroll-comments\"></div>\r\n" +
"\r\n" +
"<div id=\"comments\" class=\"comments-area\">\r\n" +
"\r\n" +
" \r\n" +
" <div id=\"respond\" class=\"comment-respond wow fadeInUp\" data-wow-delay=\"0.3s\">\r\n" +
" <h3 id=\"reply-title\" class=\"comment-reply-title\">发表评论<small><a rel=\"nofollow\" id=\"cancel-comment-reply-link\" href=\"/2460.html#respond\" style=\"display:none;\">取消回复</a></small></h3>\r\n" +
"\r\n" +
" \r\n" +
" <form action=\"//www.zrfan.com/wp-comments-post.php\" method=\"post\" id=\"commentform\">\r\n" +
" \r\n" +
" <p class=\"emoji-box\"><script type=\"text/javascript\">\r\n" +
"/* <![CDATA[ */\r\n" +
" function grin(tag) {\r\n" +
" var myField;\r\n" +
" tag = ' ' + tag + ' ';\r\n" +
" if (document.getElementById('comment') && document.getElementById('comment').type == 'textarea') {\r\n" +
" myField = document.getElementById('comment');\r\n" +
" } else {\r\n" +
" return false;\r\n" +
" }\r\n" +
" if (document.selection) {\r\n" +
" myField.focus();\r\n" +
" sel = document.selection.createRange();\r\n" +
" sel.text = tag;\r\n" +
" myField.focus();\r\n" +
" }\r\n" +
" else if (myField.selectionStart || myField.selectionStart == '0') {\r\n" +
" var startPos = myField.selectionStart;\r\n" +
" var endPos = myField.selectionEnd;\r\n" +
" var cursorPos = endPos;\r\n" +
" myField.value = myField.value.substring(0, startPos)\r\n" +
" + tag\r\n" +
" + myField.value.substring(endPos, myField.value.length);\r\n" +
" cursorPos += tag.length;\r\n" +
" myField.focus();\r\n" +
" myField.selectionStart = cursorPos;\r\n" +
" myField.selectionEnd = cursorPos;\r\n" +
" }\r\n" +
" else {\r\n" +
" myField.value += tag;\r\n" +
" myField.focus();\r\n" +
" }\r\n" +
" }\r\n" +
"/* ]]> */\r\n" +
"</script>\r\n" +
"\r\n" +
"<a href=\"javascript:grin(':?:')\"><img src=\"https://static.zrfan.com/wp-content/themes/begin/img/smilies/icon_question.gif\" alt=\":?:\" title=\"疑问\" /></a>\r\n" +
"<a href=\"javascript:grin(':razz:')\"><img src=\"https://static.zrfan.com/wp-content/themes/begin/img/smilies/icon_razz.gif\" alt=\":razz:\" title=\"调皮\" /></a>\r\n" +
"<a href=\"javascript:grin(':sad:')\"><img src=\"https://static.zrfan.com/wp-content/themes/begin/img/smilies/icon_sad.gif\" alt=\":sad:\" title=\"难过\" /></a>\r\n" +
"<a href=\"javascript:grin(':evil:')\"><img src=\"https://static.zrfan.com/wp-content/themes/begin/img/smilies/icon_evil.gif\" alt=\":evil:\" title=\"抠鼻\" /></a>\r\n" +
"<a href=\"javascript:grin(':!:')\"><img src=\"https://static.zrfan.com/wp-content/themes/begin/img/smilies/icon_exclaim.gif\" alt=\":!:\" title=\"吓\" /></a>\r\n" +
"<a href=\"javascript:grin(':smile:')\"><img src=\"https://static.zrfan.com/wp-content/themes/begin/img/smilies/icon_smile.gif\" alt=\":smile:\" title=\"微笑\" /></a>\r\n" +
"<a href=\"javascript:grin(':oops:')\"><img src=\"https://static.zrfan.com/wp-content/themes/begin/img/smilies/icon_redface.gif\" alt=\":oops:\" title=\"憨笑\" /></a>\r\n" +
"<a href=\"javascript:grin(':grin:')\"><img src=\"https://static.zrfan.com/wp-content/themes/begin/img/smilies/icon_biggrin.gif\" alt=\":grin:\" title=\"坏笑\" /></a>\r\n" +
"<a href=\"javascript:grin(':eek:')\"><img src=\"https://static.zrfan.com/wp-content/themes/begin/img/smilies/icon_surprised.gif\" alt=\":eek:\" title=\"惊讶\" /></a>\r\n" +
"<a href=\"javascript:grin(':shock:')\"><img src=\"https://static.zrfan.com/wp-content/themes/begin/img/smilies/icon_eek.gif\" alt=\":shock:\" title=\"发呆\" /></a>\r\n" +
"<a href=\"javascript:grin(':???:')\"><img src=\"https://static.zrfan.com/wp-content/themes/begin/img/smilies/icon_confused.gif\" alt=\":???:\" title=\"撇嘴\" /></a>\r\n" +
"<a href=\"javascript:grin(':cool:')\"><img src=\"https://static.zrfan.com/wp-content/themes/begin/img/smilies/icon_cool.gif\" alt=\":cool:\" title=\"大兵\" /></a>\r\n" +
"<a href=\"javascript:grin(':lol:')\"><img src=\"https://static.zrfan.com/wp-content/themes/begin/img/smilies/icon_lol.gif\" alt=\":lol:\" title=\"偷笑\" /></a>\r\n" +
"<a href=\"javascript:grin(':mad:')\"><img src=\"https://static.zrfan.com/wp-content/themes/begin/img/smilies/icon_mad.gif\" alt=\":mad:\" title=\"咒骂\" /></a>\r\n" +
"<a href=\"javascript:grin(':twisted:')\"><img src=\"https://static.zrfan.com/wp-content/themes/begin/img/smilies/icon_twisted.gif\" alt=\":twisted:\" title=\"发怒\" /></a>\r\n" +
"<a href=\"javascript:grin(':roll:')\"><img src=\"https://static.zrfan.com/wp-content/themes/begin/img/smilies/icon_rolleyes.gif\" alt=\":roll:\" title=\"白眼\" /></a>\r\n" +
"<a href=\"javascript:grin(':wink:')\"><img src=\"https://static.zrfan.com/wp-content/themes/begin/img/smilies/icon_wink.gif\" alt=\":wink:\" title=\"鼓掌\" /></a>\r\n" +
"<a href=\"javascript:grin(':idea:')\"><img src=\"https://static.zrfan.com/wp-content/themes/begin/img/smilies/icon_idea.gif\" alt=\":idea:\" title=\"酷\" /></a>\r\n" +
"<a href=\"javascript:grin(':arrow:')\"><img src=\"https://static.zrfan.com/wp-content/themes/begin/img/smilies/icon_arrow.gif\" alt=\":arrow:\" title=\"擦汗\" /></a>\r\n" +
"<a href=\"javascript:grin(':neutral:')\"><img src=\"https://static.zrfan.com/wp-content/themes/begin/img/smilies/icon_neutral.gif\" alt=\":neutral:\" title=\"亲亲\" /></a>\r\n" +
"<a href=\"javascript:grin(':cry:')\"><img src=\"https://static.zrfan.com/wp-content/themes/begin/img/smilies/icon_cry.gif\" alt=\":cry:\" title=\"大哭\" /></a>\r\n" +
"<a href=\"javascript:grin(':mrgreen:')\"><img src=\"https://static.zrfan.com/wp-content/themes/begin/img/smilies/icon_mrgreen.gif\" alt=\":mrgreen:\" title=\"呲牙\" /></a>\r\n" +
"<br /></p>\r\n" +
" <p class=\"comment-form-comment\"><textarea id=\"comment\" name=\"comment\" rows=\"4\" tabindex=\"1\"></textarea></p>\r\n" +
"\r\n" +
" <p class=\"comment-tool\">\r\n" +
" <a class=\"tool-img\" href='javascript:embedImage();' title=\"插入图片\"><i class=\"icon-img\"></i><i class=\"fa fa-picture-o\"></i></a>\r\n" +
" <a class=\"emoji\" href=\"\" title=\"插入表情\"><i class=\"fa fa-meh-o\"></i></a>\r\n" +
" </p>\r\n" +
"\r\n" +
" \r\n" +
" <div id=\"comment-author-info\">\r\n" +
" <p class=\"comment-form-author\">\r\n" +
" <label for=\"author\">昵称<span class=\"required\">*</span></label>\r\n" +
" <input type=\"text\" name=\"author\" id=\"author\" class=\"commenttext\" value=\"\" tabindex=\"2\" />\r\n" +
" </p>\r\n" +
" <p class=\"comment-form-email\">\r\n" +
" <label for=\"email\">邮箱<span class=\"required\">*</span></label>\r\n" +
" <input type=\"text\" name=\"email\" id=\"email\" class=\"commenttext\" value=\"\" tabindex=\"3\" />\r\n" +
" </p>\r\n" +
" <p class=\"comment-form-url\">\r\n" +
" <label for=\"url\">网址</label>\r\n" +
" <input type=\"text\" name=\"url\" id=\"url\" class=\"commenttext\" value=\"\" tabindex=\"4\" />\r\n" +
" </p>\r\n" +
" </div>\r\n" +
" \r\n" +
" <div class=\"qaptcha\"></div>\r\n" +
"\r\n" +
" <div class=\"clear\"></div>\r\n" +
" <p class=\"form-submit\">\r\n" +
" <input id=\"submit\" name=\"submit\" type=\"submit\" tabindex=\"5\" value=\"提交评论\"/>\r\n" +
" <input type='hidden' name='comment_post_ID' value='15842' id='comment_post_ID' />\r\n" +
"<input type='hidden' name='comment_parent' id='comment_parent' value='0' />\r\n" +
" </p>\r\n" +
"\r\n" +
" <span class=\"mail-notify\">\r\n" +
" <input type=\"checkbox\" name=\"comment_mail_notify\" id=\"comment_mail_notify\" class=\"notify\" value=\"comment_mail_notify\" />\r\n" +
" <label for=\"comment_mail_notify\"><span>有回复时邮件通知我</span></label>\r\n" +
" </span>\r\n" +
" </form>\r\n" +
"\r\n" +
" </div>\r\n" +
" \r\n" +
" \r\n" +
" \r\n" +
"</div>\r\n" +
"<!-- #comments --> \r\n" +
" \r\n" +
" </main><!-- .site-main -->\r\n" +
" </div><!-- .content-area -->\r\n" +
"\r\n" +
"<div id=\"sidebar\" class=\"widget-area all-sidebar\">\r\n" +
"\r\n" +
" \r\n" +
" \r\n" +
" <aside id=\"hot_commend-3\" class=\"widget widget_hot_commend wow fadeInUp\" data-wow-delay=\"0.3s\"><h3 class=\"widget-title\"><i class=\"fa fa-bars\"></i>优惠推荐</h3>\r\n" +
"<div id=\"hot\" class=\"hot_commend\">\r\n" +
" <ul>\r\n" +
" <li>\r\n" +
" <span class=\"thumbnail\">\r\n" +
" <a href=\"//www.zrfan.com/1698.html\"><img src=\"//www.zrfan.com/wp-content/themes/begin/timthumb.php?src=https://www.zrfan.com/cdn/2018/04/20180416031209859.jpg&w=280&h=210&a=&zc=1\" alt=\"喜讯!年轻人的第一张交行白金卡-优逸白金信用卡\" /></a> </span>\r\n" +
" <span class=\"hot-title\"><a href=\"//www.zrfan.com/1698.html\" rel=\"bookmark\">喜讯!年轻人的第一张交行白金卡-优逸白金信用卡</a></span>\r\n" +
" <span class=\"views\"><i class=\"fa fa-eye\"></i> 5,943</span> <i class=\"fa fa-thumbs-o-up\"> 0</i>\r\n" +
" </li>\r\n" +
" <li>\r\n" +
" <span class=\"thumbnail\">\r\n" +
" <a href=\"//www.zrfan.com/1669.html\"><img src=\"//www.zrfan.com/wp-content/themes/begin/timthumb.php?src=https://www.zrfan.com/cdn/2018/04/20180406105915422.jpg&w=280&h=210&a=&zc=1\" alt=\"x丝三白之白麒麟,境外活动狂薅积分里程\" /></a> </span>\r\n" +
" <span class=\"hot-title\"><a href=\"//www.zrfan.com/1669.html\" rel=\"bookmark\">x丝三白之白麒麟,境外活动狂薅积分里程</a></span>\r\n" +
" <span class=\"views\"><i class=\"fa fa-eye\"></i> 3,939</span> <i class=\"fa fa-thumbs-o-up\"> 5</i>\r\n" +
" </li>\r\n" +
" <li>\r\n" +
" <span class=\"thumbnail\">\r\n" +
" <a href=\"//www.zrfan.com/603.html\"><img src=\"//www.zrfan.com/wp-content/themes/begin/timthumb.php?src=https://www.zrfan.com/cdn/2017/02/20170203122937559.jpg&w=280&h=210&a=&zc=1\" alt=\"我是如何天天免费喝星巴克的?\" /></a> </span>\r\n" +
" <span class=\"hot-title\"><a href=\"//www.zrfan.com/603.html\" rel=\"bookmark\">我是如何天天免费喝星巴克的?</a></span>\r\n" +
" <span class=\"views\"><i class=\"fa fa-eye\"></i> 13,808</span> <i class=\"fa fa-thumbs-o-up\"> 5</i>\r\n" +
" </li>\r\n" +
" <li>\r\n" +
" <span class=\"thumbnail\">\r\n" +
" <a href=\"//www.zrfan.com/595.html\"><img src=\"https://static.zrfan.com/wp-content/themes/begin/img/random/18.jpg\" alt=\"信用卡还款优惠券、白条还款优惠券汇总\" /></a> </span>\r\n" +
" <span class=\"hot-title\"><a href=\"//www.zrfan.com/595.html\" rel=\"bookmark\">信用卡还款优惠券、白条还款优惠券汇总</a></span>\r\n" +
" <span class=\"views\"><i class=\"fa fa-eye\"></i> 11,728</span> <i class=\"fa fa-thumbs-o-up\"> 1</i>\r\n" +
" </li>\r\n" +
" <li>\r\n" +
" <span class=\"thumbnail\">\r\n" +
" <a href=\"//www.zrfan.com/414.html\"><img src=\"//www.zrfan.com/wp-content/themes/begin/timthumb.php?src=https://www.zrfan.com/cdn/2016/12/20161226171759465.jpg&w=280&h=210&a=&zc=1\" alt=\"羊毛优惠使用指南\" /></a> </span>\r\n" +
" <span class=\"hot-title\"><a href=\"//www.zrfan.com/414.html\" rel=\"bookmark\">羊毛优惠使用指南</a></span>\r\n" +
" <span class=\"views\"><i class=\"fa fa-eye\"></i> 9,447</span> <i class=\"fa fa-thumbs-o-up\"> 4</i>\r\n" +
" </li>\r\n" +
" </ul>\r\n" +
"</div>\r\n" +
"\r\n" +
"<div class=\"clear\"></div></aside><aside id=\"about-3\" class=\"widget widget_about wow fadeInUp\" data-wow-delay=\"0.3s\"><h3 class=\"widget-title\"><i class=\"fa fa-bars\"></i>关于本站</h3>\r\n" +
"<div id=\"feed_widget\">\r\n" +
" <div class=\"feed-about\">\r\n" +
" <div class=\"about-main\">\r\n" +
" <div class=\"about-img\">\r\n" +
" <img src=\"https://img.zrfan.com/cdn/2017/02/weixin.jpg\" alt=\"QR Code\"/>\r\n" +
" </div>\r\n" +
" <div class=\"about-name\">羊毛优惠</div>\r\n" +
" <div class=\"about-the\">纯人工为您找寻各种银行信用卡优惠活动信息!每天薅羊毛,幸福多一点!</div>\r\n" +
" </div>\r\n" +
" <div class=\"clear\"></div>\r\n" +
" <ul>\r\n" +
" <li class=\"weixin\">\r\n" +
" <span class=\"tipso_style\" id=\"tip-w\" data-tipso='<span class=\"weixin-qr\"><img src=\"https://img.zrfan.com/cdn/2017/02/weixin.jpg\" alt=\" weixin\"/></span>'><a title=\"微信\"><i class=\"fa fa-weixin\"></i></a></span>\r\n" +
" </li>\r\n" +
" <li class=\"tqq\"><a target=blank rel=\"external nofollow\" href=http://wpa.qq.com/msgrd?V=3&uin=2969451814&Site=QQ&Menu=yes title=\"QQ在线\"><i class=\"fa fa-qq\"></i></a></li>\r\n" +
" <li class=\"tsina\"><a title=\"\" href=\"输入链接地址\" target=\"_blank\" rel=\"external nofollow\"><i class=\"fa fa-weibo\"></i></a></li>\r\n" +
" <li class=\"feed\"><a title=\"\" href=\"//www.zrfan.com/feed/\" target=\"_blank\" rel=\"external nofollow\"><i class=\"fa fa-rss\"></i></a></li>\r\n" +
" </ul>\r\n" +
" <div class=\"about-inf\">\r\n" +
" <span class=\"about-pn\">文章 1703</span>\r\n" +
" <span class=\"about-cn\">浏览 3936574</span>\r\n" +
" </div>\r\n" +
" </div>\r\n" +
"</div>\r\n" +
"\r\n" +
"<div class=\"clear\"></div></aside><aside id=\"advert-3\" class=\"widget widget_advert wow fadeInUp\" data-wow-delay=\"0.3s\">\r\n" +
"<div id=\"advert_widget\">\r\n" +
" <script async src=\"//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js\"></script>\r\n" +
"<!-- 全站右侧 -->\r\n" +
"<ins class=\"adsbygoogle\"\r\n" +
" style=\"display:inline-block;width:300px;height:250px\"\r\n" +
" data-ad-client=\"ca-pub-2207325541606966\"\r\n" +
" data-ad-slot=\"7410917797\"></ins>\r\n" +
"<script>\r\n" +
"(adsbygoogle = window.adsbygoogle || []).push({});\r\n" +
"</script></div>\r\n" +
"\r\n" +
"<div class=\"clear\"></div></aside> \r\n" +
" </div>\r\n" +
"\r\n" +
"<div class=\"clear\"></div> </div><!-- .site-content -->\r\n" +
"\r\n" +
" <div class=\"clear\"></div>\r\n" +
" \r\n" +
" <div id=\"footer-widget-box\" class=\"site-footer wow fadeInUp\" data-wow-delay=\"0.3s\">\r\n" +
" <div class=\"footer-widget\">\r\n" +
" <aside id=\"nav_menu-2\" class=\"widget widget_nav_menu wow fadeInUp\" data-wow-delay=\"0.3s\"><h3 class=\"widget-title\"><span class=\"s-icon\"></span>更多精彩</h3><div class=\"menu-%e5%ba%95%e9%83%a8-container\"><ul id=\"menu-%e5%ba%95%e9%83%a8\" class=\"menu\"><li id=\"menu-item-7798\" class=\"menu-item menu-item-type-post_type menu-item-object-page menu-item-7798\"><a href=\"//www.zrfan.com/new\">最新刷卡指南</a></li>\r\n" +
"<li id=\"menu-item-7803\" class=\"menu-item menu-item-type-post_type menu-item-object-page menu-item-7803\"><a href=\"//www.zrfan.com/random-articles\">随机文章</a></li>\r\n" +
"<li id=\"menu-item-7797\" class=\"menu-item menu-item-type-post_type menu-item-object-page menu-item-7797\"><a href=\"//www.zrfan.com/archive\">文章归档</a></li>\r\n" +
"<li id=\"menu-item-7802\" class=\"menu-item menu-item-type-post_type menu-item-object-page menu-item-7802\"><a href=\"//www.zrfan.com/site-collection\">银行大全</a></li>\r\n" +
"<li id=\"menu-item-7800\" class=\"menu-item menu-item-type-post_type menu-item-object-page menu-item-7800\"><a href=\"//www.zrfan.com/hot-tag\">热门标签</a></li>\r\n" +
"<li id=\"menu-item-7794\" class=\"menu-item menu-item-type-post_type menu-item-object-page menu-item-7794\"><a href=\"//www.zrfan.com/about\">关于本站</a></li>\r\n" +
"<li id=\"menu-item-7801\" class=\"menu-item menu-item-type-post_type menu-item-object-page menu-item-7801\"><a href=\"//www.zrfan.com/contact\">联系方式</a></li>\r\n" +
"<li id=\"menu-item-7806\" class=\"menu-item menu-item-type-post_type menu-item-object-page menu-item-7806\"><a href=\"//www.zrfan.com/suiji\">随便看看</a></li>\r\n" +
"</ul></div><div class=\"clear\"></div></aside> <div class=\"clear\"></div>\r\n" +
" </div>\r\n" +
"</div>\r\n" +
"\r\n" +
" <footer id=\"colophon\" class=\"site-footer wow fadeInUp\" data-wow-delay=\"0.3s\" role=\"contentinfo\">\r\n" +
" <div class=\"site-info\">\r\n" +
" Copyright © 羊毛优惠 保留所有权利 豫ICP备14007442号-2 本站部分内容收集于互联网,如果有侵权内容、不妥之处,请联系我们删除。敬请谅解! <span class=\"add-info\">\r\n" +
" <script src=\"https://s4.cnzz.com/z_stat.php?id=1260529009&web_id=1260529009\" language=\"JavaScript\"></script>\r\n" +
"<script type=\"text/javascript\" src=\"//res.zgboke.com/wp-content/themes/begin/diy/wp-dialog/Dialog.js?skin=default\"></script> </span>\r\n" +
" </div><!-- .site-info -->\r\n" +
" </footer><!-- .site-footer -->\r\n" +
"<div id=\"login\">\r\n" +
" \r\n" +
" <div id=\"login-tab\" class=\"login-tab-product\">\r\n" +
" <h2 class=\"login-tab-hd\">\r\n" +
" <span class=\"login-tab-hd-con\"><a href=\"javascript:\">登录</a></span>\r\n" +
" <span class=\"login-tab-hd-con\"><a href=\"javascript:\">找回密码</a></span>\r\n" +
" </h2>\r\n" +
" \r\n" +
" <div class=\"login-tab-bd login-dom-display\">\r\n" +
" <div class=\"login-tab-bd-con login-current\">\r\n" +
" <div id=\"tab1_login\" class=\"tab_content_login\">\r\n" +
" <form method=\"post\" action=\"//www.zrfan.com/wp-login.php\" class=\"wp-user-form\">\r\n" +
" <div class=\"username\">\r\n" +
" <label for=\"user_login\">用户名</label>\r\n" +
" <input type=\"text\" name=\"log\" value=\"\" size=\"20\" id=\"user_login\" tabindex=\"11\" />\r\n" +
" </div>\r\n" +
" <div class=\"password\">\r\n" +
" <label for=\"user_pass\">密码</label>\r\n" +
" <input type=\"password\" name=\"pwd\" value=\"\" size=\"20\" id=\"user_pass\" tabindex=\"12\" />\r\n" +
" </div>\r\n" +
" <div class=\"login_fields\">\r\n" +
" <div class=\"rememberme\">\r\n" +
" <label for=\"rememberme\">\r\n" +
" <input type=\"checkbox\" name=\"rememberme\" value=\"forever\" checked=\"checked\" id=\"rememberme\" tabindex=\"13\" />记住我的登录信息 </label>\r\n" +
" </div>\r\n" +
" <input type=\"submit\" name=\"user-submit\" value=\"登录\" tabindex=\"14\" class=\"user-submit\" />\r\n" +
" <input type=\"hidden\" name=\"redirect_to\" value=\"/2460.html\" />\r\n" +
" <input type=\"hidden\" name=\"user-cookie\" value=\"1\" />\r\n" +
" <div class=\"login-form\"></div>\r\n" +
" </div>\r\n" +
" </form>\r\n" +
" </div>\r\n" +
" </div>\r\n" +
"\r\n" +
" \r\n" +
" <div class=\"login-tab-bd-con\">\r\n" +
" <div id=\"tab3_login\" class=\"tab_content_login\">\r\n" +
" <p class=\"message\">输入用户名或电子邮箱地址,您会收到一封新密码链接的电子邮件。</p>\r\n" +
" <form method=\"post\" action=\"//www.zrfan.com/wp-login.php?action=lostpassword\" class=\"wp-user-form\">\r\n" +
" <div class=\"username\">\r\n" +
" <label for=\"user_login\" class=\"hide\">用户名或电子邮件地址</label>\r\n" +
" <input type=\"text\" name=\"user_login\" value=\"\" size=\"20\" id=\"user_login\" tabindex=\"1001\" />\r\n" +
" </div>\r\n" +
" <div class=\"login_fields\">\r\n" +
" <div class=\"login-form\"></div>\r\n" +
" <input type=\"submit\" name=\"user-submit\" value=\"获取新密码\" class=\"user-submit\" tabindex=\"1002\" />\r\n" +
" <input type=\"hidden\" name=\"redirect_to\" value=\"/2460.html?reset=true\" />\r\n" +
" <input type=\"hidden\" name=\"user-cookie\" value=\"1\" />\r\n" +
" </div>\r\n" +
" </form>\r\n" +
" </div>\r\n" +
" </div>\r\n" +
" </div>\r\n" +
" </div>\r\n" +
"\r\n" +
" </div>\r\n" +
"<script>window._bd_share_config={\"common\":{\"bdSnsKey\":{},\"bdText\":\"\",\"bdMini\":\"2\",\"bdMiniList\":false,\"bdPic\":\"\",\"bdStyle\":\"1\",\"bdSize\":\"16\"},\"share\":{\"bdSize\":16}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='//www.zrfan.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];</script>\r\n" +
"\r\n" +
"<ul id=\"scroll\">\r\n" +
" <li class=\"log log-no\"><a class=\"log-button\" title=\"文章目录\"><i class=\"fa fa-bars\"></i></a><div class=\"log-prompt\"><div class=\"log-arrow\">文章目录</div></div></li>\r\n" +
" <li><a class=\"scroll-h\" title=\"返回顶部\"><i class=\"fa fa-angle-up\"></i></a></li>\r\n" +
" <li><a class=\"scroll-c\" title=\"评论\"><i class=\"fa fa-comment-o\"></i></a></li> <li><a class=\"scroll-b\" title=\"转到底部\"><i class=\"fa fa-angle-down\"></i></a></li>\r\n" +
" <li class=\"gb2-site\"><a id=\"gb2big5\"><span>繁</span></a></li> <li class=\"qqonline\">\r\n" +
" <div class=\"online\"><a href=\"javascript:void(0)\" ><i class=\"fa fa-qq\"></i></a></div>\r\n" +
" <div class=\"qqonline-box\">\r\n" +
" <div class=\"qqonline-main\">\r\n" +
" <div class=\"nline-wiexin\">\r\n" +
" <h4>微信</h4>\r\n" +
" <img title=\"微信\" alt=\"微信\" src=\"//www.zrfan.com/cdn/2017/02/weixin.jpg\"/>\r\n" +
" </div>\r\n" +
" <div class=\"nline-qq\"><a target=\"_blank\" rel=\"external nofollow\" href=\"http://wpa.qq.com/msgrd?v=3&uin=2969451814&site=qq&menu=yes\"><i class=\"fa fa-qq\"></i>在线咨询</a></div>\r\n" +
" </div>\r\n" +
" <span class=\"qq-arrow\"></span>\r\n" +
" </div>\r\n" +
"</li> <li class=\"qr-site\"><a href=\"javascript:void(0)\" class=\"qr\" title=\"本页二维码\"><i class=\"fa fa-qrcode\"></i><span class=\"qr-img\"><span id=\"output\"><img class=\"alignnone\" src=\"//www.zrfan.com/cdn/2017/02/C_130.png\" alt=\"icon\"/></span><span class=\"arrow arrow-z\"><i class=\"fa fa-caret-right\"></i></span><span class=\"arrow arrow-y\"><i class=\"fa fa-caret-right\"></i></span></span></a></li>\r\n" +
" <script type=\"text/javascript\">$(document).ready(function(){if(!+[1,]){present=\"table\";} else {present=\"canvas\";}$('#output').qrcode({render:present,text:window.location.href,width:\"150\",height:\"150\"});});</script>\r\n" +
" </ul>\r\n" +
"\r\n" +
"</div><!-- .site -->\r\n" +
"\r\n" +
"<script type=\"text/javascript\" src=\"https://static.zrfan.com/wp-content/themes/begin/js/jquery-ui.min.js\"></script>\r\n" +
"<script type=\"text/javascript\" src=\"https://static.zrfan.com/wp-content/themes/begin/js/qaptcha.jquery.js\"></script>\r\n" +
"<script type=\"text/javascript\">var QaptchaJqueryPage=\"//www.zrfan.com/wp-content/themes/begin/inc/function/qaptcha.jquery.php\"</script>\r\n" +
"<script type=\"text/javascript\">$(document).ready(function(){$('.qaptcha').QapTcha();});</script>\r\n" +
"<script type='text/javascript'>\r\n" +
"/* <![CDATA[ */\r\n" +
"var viewsCacheL10n = {\"admin_ajax_url\":\"https:\\/\\/www.zrfan.com\\/wp-admin\\/admin-ajax.php\",\"post_id\":\"15842\"};\r\n" +
"/* ]]> */\r\n" +
"</script>\r\n" +
"<script type='text/javascript' src='https://static.zrfan.com/wp-content/plugins/wp-postviews/postviews-cache.js?ver=1.68'></script>\r\n" +
"<script type='text/javascript' src='https://static.zrfan.com/wp-content/themes/begin/js/superfish.js?ver=2017.02.04'></script>\r\n" +
"<script type='text/javascript' src='https://static.zrfan.com/wp-content/themes/begin/js/gb2big5.js?ver=2017.02.04'></script>\r\n" +
"<script type='text/javascript' src='https://static.zrfan.com/wp-content/themes/begin/js/carousel.min.js?ver=2017.02.04'></script>\r\n" +
"<script type=\"text/javascript\">var ias=$.ias({container:\"#comments\",item:\".comment-list\",pagination:\".scroll-links\",next:\".scroll-links .nav-previous a\",});ias.extension(new IASTriggerExtension({text:'<i class=\"fa fa-chevron-circle-down\"></i>更多',offset: 0,}));ias.extension(new IASSpinnerExtension());ias.extension(new IASNoneLeftExtension({text:'已是最后',}));ias.on('rendered',function(items){$(\"img\").lazyload({effect: \"fadeIn\",failure_limit: 10});});</script>\r\n" +
"\r\n" +
"</body>\r\n" +
"</html>\r\n" +
"<!-- Dynamic page generated in 0.516 seconds. -->\r\n" +
"<!-- Cached page generated by WP-Super-Cache on 2018-11-26 12:14:40 -->\r\n" +
"\r\n" +
"<!-- super cache -->";
}
| [
"syq_sunshine@163.com"
] | syq_sunshine@163.com |
89e21130fada41cf39c096436b80d9e1e0f3df69 | d9fac47c932274973b799805f3ddb56afb9392c5 | /src/main/java/org/dimdev/dimdoors/shared/blocks/BlockFloatingRift.java | 29aa8a19482f92031422b9e7ba261599e9b5a796 | [
"MIT"
] | permissive | CreepyCre/DimDoors | f158f7140f6acb42591e6b8abced6cc8ae0dab5d | a3f5937771dbd59bb81f4c463f8cd101011d4f50 | refs/heads/master | 2021-06-17T01:23:28.007061 | 2020-04-30T22:41:49 | 2020-04-30T22:41:49 | 333,097,195 | 0 | 0 | MIT | 2021-01-26T13:42:07 | 2021-01-26T13:42:06 | null | UTF-8 | Java | false | false | 4,519 | java | package org.dimdev.dimdoors.shared.blocks;
import java.util.*;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.AxisAlignedBB;
import org.dimdev.dimdoors.DimDoors;
import org.dimdev.dimdoors.client.ParticleRiftEffect;
import org.dimdev.dimdoors.shared.ModConfig;
import org.dimdev.dimdoors.shared.items.ModItems;
import org.dimdev.dimdoors.shared.tileentities.TileEntityFloatingRift;
import org.dimdev.ddutils.blocks.BlockSpecialAir;
import net.minecraft.block.ITileEntityProvider;
import net.minecraft.block.material.MapColor;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.fml.client.FMLClientHandler;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
public class BlockFloatingRift extends BlockSpecialAir implements ITileEntityProvider, IRiftProvider<TileEntityFloatingRift> {
public static final String ID = "rift";
public BlockFloatingRift() {
setRegistryName(new ResourceLocation(DimDoors.MODID, ID));
setUnlocalizedName(ID);
setTickRandomly(true);
setResistance(6000000.0F); // Same as bedrock
setLightLevel(0.5f);
}
@Override
public TileEntityFloatingRift createNewTileEntity(World world, int meta) {
return new TileEntityFloatingRift();
}
@Override
@SuppressWarnings("deprecation")
public MapColor getMapColor(IBlockState state, IBlockAccess world, BlockPos pos) {
return MapColor.BLUE;
}
// Unregister the rift on break
@Override
public void breakBlock(World world, BlockPos pos, IBlockState state) {
TileEntityFloatingRift rift = (TileEntityFloatingRift) world.getTileEntity(pos);
rift.unregister();
super.breakBlock(world, pos, state);
}
@Override
public AxisAlignedBB getCollisionBoundingBox(IBlockState blockState, IBlockAccess world, BlockPos pos) {
if (ModConfig.general.riftBoundingBoxInCreative) {
EntityPlayer player = DimDoors.proxy.getLocalPlayer();
if (player != null && player.isCreative()) {
return blockState.getBoundingBox(world, pos);
}
}
return null;
}
@Override
public TileEntityFloatingRift getRift(World world, BlockPos pos, IBlockState state) {
return (TileEntityFloatingRift) world.getTileEntity(pos);
}
public void dropWorldThread(World world, BlockPos pos, Random random) {
if (!world.getBlockState(pos).equals(Blocks.AIR)) {
ItemStack thread = new ItemStack(ModItems.WORLD_THREAD, 1);
world.spawnEntity(new EntityItem(world, pos.getX(), pos.getY(), pos.getZ(), thread));
}
}
// Render rift effects
@Override
@SideOnly(Side.CLIENT)
public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random rand) {
TileEntity tileEntity = world.getTileEntity(pos);
// randomDisplayTick can be called before the tile entity is created in multiplayer
if (!(tileEntity instanceof TileEntityFloatingRift)) return;
TileEntityFloatingRift rift = (TileEntityFloatingRift) tileEntity;
// TODO: direction of particles should be rift orientation, speed should depend on size
double speed = 0.1d; // rift.size / 1400f;
if (rift.closing) { // Renders an opposite color effect if it is being closed by the rift remover
FMLClientHandler.instance().getClient().effectRenderer.addEffect(new ParticleRiftEffect(
world,
pos.getX() + .5, pos.getY() + 1.5, pos.getZ() + .5,
rand.nextGaussian() * speed, rand.nextGaussian() * speed, rand.nextGaussian() * speed,
0.8f, 0.4f, 0.55f, 2000, 2000));
}
FMLClientHandler.instance().getClient().effectRenderer.addEffect(new ParticleRiftEffect(
world,
pos.getX() + .5, pos.getY() + 1.5, pos.getZ() + .5,
rand.nextGaussian() * speed, rand.nextGaussian() * speed, rand.nextGaussian() * speed,
0.0f, 0.7f, 0.55f, rift.stabilized ? 750 : 2000, rift.stabilized ? 750 : 2000));
}
}
| [
"runemoro@users.noreply.github.com"
] | runemoro@users.noreply.github.com |
1163e027aa6c622f739bc57baa7e7896e874c7c3 | 8c9bbfcfe2b13856a98a8f61c1005f178c728ae4 | /src/test/java/stepDefinitions/MyAccountLoginStepDefinitions.old.java | 4a964df6149922758196ae347be0ab26ec08136f | [] | no_license | APG-PPTG/Cucumber | c58b1e9c627161efb2816044b5ac044a219aca28 | 322b7b11d6ea67a1b6c08fdc225f27c0e435e391 | refs/heads/master | 2023-04-01T04:28:53.903170 | 2023-03-16T18:01:28 | 2023-03-16T18:01:28 | 338,462,781 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,282 | java | package stepDefinitions;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;
import cucumber.api.java.en.And;
import cucumber.api.java.en.Given;
import cucumber.api.java.en.Then;
import cucumber.api.java.en.When;
import junit.framework.Assert;
public class MyAccountLoginStepDefinitions {
public WebDriver driver = null;
@Given("^open browser$")
public void open_browser() throws Throwable {
System.setProperty("webdriver.chrome.driver", "D:\\Selenium\\SeleniumWebDriverDrivers\\BrowserDriver\\chromedriver_win32_l\\chromedriver.exe");
ChromeOptions options = new ChromeOptions();
options.addArguments("--remote-allow-origins=*");
driver = new ChromeDriver(options);
//driver = new ChromeDriver();
driver.manage().window().maximize();
}
@When("^Enter the url \"([^\"]*)\"$")
public void enter_the_url(String url) throws Throwable {
driver.get(url);
}
@And("^Click on My Account Menu$")
public void click_on_My_Account_Menu() throws Throwable {
//driver.findElement(By.linkText("My Account")).click();
System.out.println("Pass");
}
/*@And("^Enter registered username and password$")
public void enter_registered_username_and_password() throws Throwable {
driver.findElement(By.id("username")).sendKeys("pavanoltraining");
driver.findElement(By.id("password")).sendKeys("Test@selenium123");
}*/
@When("^Enter registered username \"([^\"]*)\" and password \"([^\"]*)\"$")
public void enter_registered_username_and_password(String user, String pwd) throws Throwable {
driver.findElement(By.id("username")).sendKeys(user);
driver.findElement(By.id("password")).sendKeys(pwd);
}
@And("^Click on login button$")
public void click_on_login_button() throws Throwable {
driver.findElement(By.name("login")).click();
}
@Then("^Verify Login$")
public void verify_Login() throws Throwable {
String capText = driver.findElement(By.xpath("//strong[contains(text(),'Error')]")).getText();
if(capText.contains("ERROR")) {
driver.close();
Assert.assertTrue("Invalid Input - Error Page", true);
}
else {
driver.close();
Assert.assertTrue(false);
}
}
} | [
"gomesme.peter@gmail.com"
] | gomesme.peter@gmail.com |
ea8e9d72590034f3d288908c2067a983901faf11 | 946da782892e4612b67b8b843c9d9ac56df7bcd0 | /src/episode_27/VBOModels.java | 45fce2ba840d52f9690d446acaba694d59043f73 | [
"BSD-3-Clause",
"LicenseRef-scancode-jdom",
"BSD-2-Clause",
"BSD-2-Clause-Views"
] | permissive | hunterg325/YouTube-tutorials | 46789c5b5623ec559febb9ad24aa73846bfd35ca | be8c78051c4cc4997d5998b009ed52a33191789a | refs/heads/master | 2021-01-16T18:50:25.844734 | 2012-09-24T15:36:43 | 2012-09-24T15:36:43 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,474 | java | /*
* Copyright (c) 2012, Oskar Veerhoek
* 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.
*
* 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.
*
* The views and conclusions contained in the software and documentation are those
* of the authors and should not be interpreted as representing official policies,
* either expressed or implied, of the FreeBSD Project.
*/
package episode_27;
import org.lwjgl.LWJGLException;
import org.lwjgl.input.Mouse;
import org.lwjgl.opengl.Display;
import org.lwjgl.opengl.DisplayMode;
import utility.*;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import static org.lwjgl.opengl.GL11.*;
import static org.lwjgl.opengl.GL15.*;
import static org.lwjgl.opengl.GL20.glDeleteProgram;
import static org.lwjgl.opengl.GL20.glUseProgram;
public class VBOModels {
private static EulerCamera cam;
private static int shaderProgram;
private static int vboVertexHandle;
private static int vboNormalHandle;
private static Model model;
public static final String MODEL_LOCATION = "res/models/bunny.obj";
public static final String VERTEX_SHADER_LOCATION = "res/shaders/vertex_phong_lighting.vs";
public static final String FRAGMENT_SHADER_LOCATION = "res/shaders/vertex_phong_lighting.fs";
public static void main(String[] args) {
setUpDisplay();
setUpVBOs();
setUpCamera();
setUpShaders();
setUpLighting();
while (!Display.isCloseRequested()) {
render();
checkInput();
Display.update();
Display.sync(60);
}
cleanUp();
System.exit(0);
}
private static void checkInput() {
cam.processMouse(1, 80, -80);
cam.processKeyboard(16, 1, 1, 1);
if (Mouse.isButtonDown(0))
Mouse.setGrabbed(true);
else if (Mouse.isButtonDown(1))
Mouse.setGrabbed(false);
}
private static void cleanUp() {
glDeleteProgram(shaderProgram);
glDeleteBuffers(vboVertexHandle);
glDeleteBuffers(vboNormalHandle);
Display.destroy();
}
private static void render() {
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glLoadIdentity();
cam.applyTranslations();
glUseProgram(shaderProgram);
glLight(GL_LIGHT0, GL_POSITION, BufferTools.asFlippedFloatBuffer(cam.getX(), cam.getY(), cam.getZ(), 1));
glBindBuffer(GL_ARRAY_BUFFER, vboVertexHandle);
glVertexPointer(3, GL_FLOAT, 0, 0L);
glBindBuffer(GL_ARRAY_BUFFER, vboNormalHandle);
glNormalPointer(GL_FLOAT, 0, 0L);
glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_NORMAL_ARRAY);
glColor3f(0.4f, 0.27f, 0.17f);
glMaterialf(GL_FRONT, GL_SHININESS, 10f);
glDrawArrays(GL_TRIANGLES, 0, model.faces.size() * 3);
glDisableClientState(GL_VERTEX_ARRAY);
glDisableClientState(GL_NORMAL_ARRAY);
glBindBuffer(GL_ARRAY_BUFFER, 0);
glUseProgram(0);
}
private static void setUpLighting() {
glShadeModel(GL_SMOOTH);
glEnable(GL_DEPTH_TEST);
glEnable(GL_LIGHTING);
glEnable(GL_LIGHT0);
glLightModel(GL_LIGHT_MODEL_AMBIENT, BufferTools.asFlippedFloatBuffer(new float[]{0.05f,
0.05f, 0.05f, 1f}));
glLight(GL_LIGHT0, GL_POSITION,
BufferTools.asFlippedFloatBuffer(new float[]{0, 0, 0, 1}));
glEnable(GL_CULL_FACE);
glCullFace(GL_BACK);
glEnable(GL_COLOR_MATERIAL);
glColorMaterial(GL_FRONT, GL_DIFFUSE);
}
private static void setUpVBOs() {
int[] vbos;
try {
model = OBJLoader.loadModel(new File(MODEL_LOCATION));
vbos = OBJLoader.createVBO(model);
vboVertexHandle = vbos[0];
vboNormalHandle = vbos[1];
} catch (FileNotFoundException e) {
e.printStackTrace();
cleanUp();
System.exit(1);
} catch (IOException e) {
e.printStackTrace();
cleanUp();
System.exit(1);
}
// vboVertexHandle = glGenBuffers();
// vboNormalHandle = glGenBuffers();
// model = null;
// try {
// model = OBJLoader.loadModel(new File(MODEL_LOCATION));
// } catch (FileNotFoundException e){
// e.printStackTrace();
// cleanUp();
// System.exit(1);
// } catch (IOException e) {
// e.printStackTrace();
// cleanUp();
// System.exit(1);
// }
// FloatBuffer vertices = reserveData(model.faces.size() * 9);
// FloatBuffer normals = reserveData(model.faces.size() * 9);
// for (Face face : model.faces) {
// vertices.put(asFloats(model.vertices.get((int) face.vertex.x - 1)));
// vertices.put(asFloats(model.vertices.get((int) face.vertex.y - 1)));
// vertices.put(asFloats(model.vertices.get((int) face.vertex.z - 1)));
// normals.put(asFloats(model.normals.get((int) face.normal.x - 1)));
// normals.put(asFloats(model.normals.get((int) face.normal.y - 1)));
// normals.put(asFloats(model.normals.get((int) face.normal.z - 1)));
// }
// vertices.flip();
// normals.flip();
// glBindBuffer(GL_ARRAY_BUFFER, vboVertexHandle);
// glBufferData(GL_ARRAY_BUFFER, vertices, GL_STATIC_DRAW);
// glBindBuffer(GL_ARRAY_BUFFER, vboNormalHandle);
// glBufferData(GL_ARRAY_BUFFER, normals, GL_STATIC_DRAW);
// glBindBuffer(GL_ARRAY_BUFFER, 0);
}
private static void setUpShaders() {
shaderProgram = ShaderLoader.loadShaderPair(VERTEX_SHADER_LOCATION, FRAGMENT_SHADER_LOCATION);
}
private static void setUpCamera() {
cam = new EulerCamera((float) Display.getWidth()
/ (float) Display.getHeight(), -2.19f, 1.36f, 11.45f);
cam.setFov(70);
cam.applyPerspectiveMatrix();
}
private static void setUpDisplay() {
try {
Display.setDisplayMode(new DisplayMode(640, 480));
Display.setVSyncEnabled(true);
Display.setTitle("VBO Model Demo");
Display.create();
} catch (LWJGLException e) {
System.err.println("The display wasn't initialized correctly. :(");
Display.destroy();
System.exit(1);
}
}
}
| [
"support@thecodinguniverse.com"
] | support@thecodinguniverse.com |
c17b23a28b96c25603bf1ac0846cf0025fbf1152 | b383d4178c38392d901dfcd2875b36ce4dc872f9 | /biz.aQute.repository/src/aQute/maven/dto/BuildBaseDTO.java | 895799dbf348a5e2b8c9dd75f8316d05168a2b6e | [
"Apache-2.0"
] | permissive | atlassian/bnd | 6cc323f9f1a66d1693772b97746c692159c5b453 | 1544d4ba2c9fc2f60945d4712502d641235d5512 | refs/heads/master | 2023-08-21T14:22:00.971810 | 2016-04-28T00:23:50 | 2016-04-28T00:28:53 | 57,100,267 | 0 | 1 | Apache-2.0 | 2023-08-15T17:43:08 | 2016-04-26T05:24:14 | Java | UTF-8 | Java | false | false | 1,983 | java | package aQute.maven.dto;
import aQute.bnd.util.dto.DTO;
/**
* Generic informations for a build.
*
*/
public class BuildBaseDTO extends DTO {
/**
* The default goal (or phase in Maven 2) to execute when none is specified
* for the project. Note that in case of a multi-module build, only the
* default goal of the top-level project is relevant, i.e. the default goals
* of child modules are ignored. Since Maven 3, multiple goals/phases can be
* separated by whitespace.
*
*/
public String defaultGoal;
/**
* This element describes all of the classpath resources such as properties
* files associated with a project. These resources are often included in
* the final package. The default value is <code>src/main/resources</code>.
*
*/
public ResourceDTO[] resources;
/**
* This element describes all of the classpath resources such as properties
* files associated with a project's unit tests. The default value is
* <code>src/test/resources</code>.
*
*/
public ResourceDTO[] testResources;
/**
* The directory where all files generated by the build are placed. The
* default value is <code>target</code>.
*
*/
public String directory;
/**
* The filename (excluding the extension, and with no path information) that
* the produced artifact will be called. The default value is
* <code>${artifactId}-${version}</code>.
*
*/
public String finalName;
/**
* The list of filter properties files that are used when filtering is
* enabled.<
*/
public String[] filters;
/**
* Default plugin information to be made available for reference by projects
* derived from this one. This plugin configuration will not be resolved or
* bound to the lifecycle unless referenced. Any local configuration for a
* given plugin will override the plugin's entire definition here.
*
*/
public PluginManagementDTO pluginManagement;
/**
* The list of plugins to use
*
*/
public PluginDTO plugins;
}
| [
"bj@bjhargrave.com"
] | bj@bjhargrave.com |
cdfc94b6523b86310528f01293b94da76602bf94 | cec522fed36a26b903aaf95a68588528a76ff92b | /app/src/main/java/com/raul/rsd/android/popularmovies/AppModule.java | ca8b758d004741f019063b70482389b1af353d90 | [
"Apache-2.0"
] | permissive | rsd-raul/PopularMovies | d7024e40cb09c7a025d0336474e25c57a0d734e0 | 6ef857330e7fb750ae276171aca3ca052b241e12 | refs/heads/master | 2021-01-18T13:08:04.340753 | 2017-03-28T20:03:36 | 2017-03-28T20:03:36 | 80,721,508 | 2 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,750 | java | package com.raul.rsd.android.popularmovies;
import android.app.Application;
import android.content.ContentResolver;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import com.mikepenz.fastadapter.IItem;
import com.mikepenz.fastadapter.commons.adapters.FastItemAdapter;
import com.raul.rsd.android.popularmovies.adapters.MovieItem;
import com.raul.rsd.android.popularmovies.data.MoviesAsyncHandler;
import com.raul.rsd.android.popularmovies.data.MoviesAsyncHandler.*;
import com.raul.rsd.android.popularmovies.data.MoviesDbHelper;
import javax.inject.Named;
import javax.inject.Singleton;
import dagger.Module;
import dagger.Provides;
@Module
public class AppModule {
private Application app;
public AppModule(Application app) {
this.app = app;
}
@Provides
@Singleton
Context contextProvider() {
return app;
}
@Provides
@Named("writable")
SQLiteDatabase writableDatabaseProvider(MoviesDbHelper databaseHelper){
return databaseHelper.getWritableDatabase();
}
@Provides
@Named("readable")
SQLiteDatabase readableDatabaseProvider(MoviesDbHelper databaseHelper){
return databaseHelper.getReadableDatabase();
}
@Provides
ContentResolver contentResolverProvider(){
return app.getContentResolver();
}
@Provides
MoviesAsyncQueryHandler moviesAsyncQueryHandlerProvider(MoviesAsyncHandler mah, ContentResolver cr){
return mah.getHandler(cr);
}
@Provides
FastItemAdapter<IItem> fastItemAdapterProvider(){
return new FastItemAdapter<>();
}
@Provides
FastItemAdapter<MovieItem> fastItemAdapterForMovieProvider(){
return new FastItemAdapter<>();
}
} | [
"rsd_raul@yahoo.es"
] | rsd_raul@yahoo.es |
fd9f435da05e1fcd5c16b7d56db9739fc736d7ad | 81f92846344bab3f914acca2ea608862338364a8 | /src/main/java/io/vertx/ext/warp10/impl/VertxMetricsImpl.java | 2ba172c8a4e5f796c63964046497e67363d99348 | [
"Apache-2.0"
] | permissive | slambour/vertx-warp10-metrics | e05f9e65373de9eeb940e5fdb9f5577555bb1a26 | 77a0e2a5984e2e28ab8dcaa3477c16353f7d6528 | refs/heads/master | 2021-01-15T15:31:29.836218 | 2016-09-02T14:33:42 | 2016-09-02T14:33:42 | 59,279,301 | 5 | 1 | null | null | null | null | UTF-8 | Java | false | false | 4,544 | java | //
// Copyright 2016 Cityzen Data
//
// 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 io.vertx.ext.warp10.impl;
import io.vertx.core.Context;
import io.vertx.core.Verticle;
import io.vertx.core.Vertx;
import io.vertx.core.datagram.DatagramSocket;
import io.vertx.core.datagram.DatagramSocketOptions;
import io.vertx.core.eventbus.EventBus;
import io.vertx.core.http.HttpClient;
import io.vertx.core.http.HttpClientOptions;
import io.vertx.core.http.HttpServer;
import io.vertx.core.http.HttpServerOptions;
import io.vertx.core.metrics.impl.DummyVertxMetrics;
import io.vertx.core.net.*;
import io.vertx.core.spi.metrics.*;
import io.vertx.ext.warp10.MetricsType;
import io.vertx.ext.warp10.VertxWarp10Options;
import io.vertx.ext.warp10.metrics.*;
import io.warp10.sensision.Sensision;
import java.util.HashMap;
import java.util.Map;
/**
* @author Sébastien lambour
*/
public class VertxMetricsImpl extends DummyVertxMetrics {
private final Vertx vertx;
private final VertxWarp10Options options;
private final EventBusMetricsImpl eventBusMetrics;
public static final String SENSISION_CLASS_PREFIX = "io.vertx.metrics.warp10.";
public static final String SENSISION_CLASS_VERTICLE_DEPLOYED = SENSISION_CLASS_PREFIX + "verticle.deployed";
public static final String SENSISION_CLASS_VERTICLE_UNDEPLOYED = SENSISION_CLASS_PREFIX + "verticle.undeployed";
public static final String SENSISION_LABEL_CLUSTER_NAME = "cluster";
public final Map<String, String> defaultLabels = new HashMap<>();
/**
* @param vertx the {@link Vertx} managed instance
* @param options Vertx Warp10 options
*/
public VertxMetricsImpl(Vertx vertx, VertxWarp10Options options) {
this.vertx = vertx;
this.options = options;
String clusterName = options.getClusterName();
if (clusterName!=null && !clusterName.isEmpty()) {
this.defaultLabels.put(SENSISION_LABEL_CLUSTER_NAME, clusterName);
}
eventBusMetrics = new EventBusMetricsImpl(defaultLabels, !this.options.isMetricsTypeDisabled(MetricsType.HTTP_SERVER));
}
@Override
public void eventBusInitialized(EventBus bus) {
// Finish setup
}
@Override
public void close() {
}
@Override
public void verticleDeployed(Verticle verticle) {
Sensision.event(SENSISION_CLASS_VERTICLE_DEPLOYED, defaultLabels, verticle.getClass().getSimpleName());
}
@Override
public void verticleUndeployed(Verticle verticle) {
Sensision.event(SENSISION_CLASS_VERTICLE_UNDEPLOYED, defaultLabels, verticle.getClass().getSimpleName());
}
@Override
public HttpServerMetrics<Long, Void, Void> createMetrics(HttpServer server, SocketAddress localAddress, HttpServerOptions serverOtions) {
return new HttpServerMetricsImpl(localAddress, defaultLabels, !this.options.isMetricsTypeDisabled(MetricsType.HTTP_SERVER));
}
@Override
public HttpClientMetrics createMetrics(HttpClient client, HttpClientOptions options) {
return new HttpClientMetricsImpl(defaultLabels, !this.options.isMetricsTypeDisabled(MetricsType.HTTP_CLIENT));
}
@Override
public TCPMetrics createMetrics(NetServer server, SocketAddress localAddress, NetServerOptions options) {
return new TCPServerMetricsImpl(localAddress, defaultLabels, !this.options.isMetricsTypeDisabled(MetricsType.NET_SERVER));
}
@Override
public TCPMetrics createMetrics(NetClient client, NetClientOptions options) {
return new TCPClientMetricsImpl(defaultLabels, !this.options.isMetricsTypeDisabled(MetricsType.NET_CLIENT));
}
@Override
public DatagramSocketMetrics createMetrics(DatagramSocket socket, DatagramSocketOptions options) {
return new DatagramSocketMetricsImpl(defaultLabels, !this.options.isMetricsTypeDisabled(MetricsType.DATAGRAM_SOCKET));
}
@Override
public <P> PoolMetrics<?> createMetrics(P pool, String poolType, String poolName, int maxPoolSize) {
return new PoolMetricsImpl(poolType, poolName, maxPoolSize, defaultLabels, !this.options.isMetricsTypeDisabled(MetricsType.POOL));
}
} | [
"sebastien.lambour@cityzendata.com"
] | sebastien.lambour@cityzendata.com |
6d8a0a21bd415135e03c68f70bf6b8b0ac812a84 | 0cdab0464b878574b8cd78ab53c898304892a3ac | /src/main/java/org/apache/ibatis/logging/stdout/package-info.java | 86bba2a471d10f0841d8a0e99f7d70aba61969e2 | [
"Apache-2.0"
] | permissive | yeecode/MyBatisCN | e600f660b0975c6d58996cd5e578d615dffe0d1f | 489e130b318d4e46f0b2e70a5ed71b25914bda20 | refs/heads/master | 2023-08-17T02:58:42.922095 | 2022-01-18T13:26:05 | 2022-01-18T13:26:05 | 218,516,578 | 366 | 287 | Apache-2.0 | 2023-07-22T20:12:22 | 2019-10-30T11:55:10 | Java | UTF-8 | Java | false | false | 730 | java | /**
* Copyright 2009-2018 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.
*/
/**
* logger using standard out.
*/
package org.apache.ibatis.logging.stdout;
| [
"yeecode@126.com"
] | yeecode@126.com |
ca0965ac79db9f6b63e0e566788dfa1732074539 | a31b3a15a8b6450cb655415afc84b80c75769b71 | /src/main/java/com/mlh/spider/handle/PageHandler.java | 962d6ef1cbdac0bd14220f6baba57827911cd70b | [] | no_license | yuan-hui/garden-spider | cbef91e9b3a9c748025e55122fb4712447dd0288 | fe65b1f93c63db1978d37c46575a699374c235ff | refs/heads/master | 2022-09-12T06:51:03.841831 | 2020-05-22T09:07:55 | 2020-05-22T09:07:55 | 67,979,517 | 2 | 0 | null | 2022-09-01T22:18:24 | 2016-09-12T05:46:27 | Java | UTF-8 | Java | false | false | 2,863 | java | package com.mlh.spider.handle;
import java.util.Date;
import java.util.LinkedList;
import java.util.List;
import org.apache.commons.lang3.StringUtils;
import com.mlh.common.AppRun;
import com.mlh.enums.BussCode;
import com.mlh.enums.Confirm;
import com.mlh.model.DownloaderConfig;
import com.mlh.model.PageList;
import com.mlh.spider.factory.PageListProcessorFactory;
import com.mlh.utils.common.StringKit;
/**
*
* @Description: 整理出需要下载的详情页面
* @author liujiecheng
*/
public class PageHandler {
private final static String PLACEHOLDER = "{0}";
public static void main(String[] args) {
// 读取需要页面处理的下载配置(未处理过的)
// ----
AppRun.start();
// ----(把地址统一转换为可爬取列表页地址)
System.out.println("正在查询需要转换的配置...");
List<DownloaderConfig> configs = DownloaderConfig.dao.findByStatus(Confirm.no.toString());
if (configs != null && configs.size() > 0) {
System.out.println("转换记录数:" + configs.size());
System.out.println("开始转换为列表页...");
List<PageList> pages = new LinkedList<PageList>();
for (DownloaderConfig c : configs) {
String _id = c.getId();
//通用URL
String _url = c.getUrl();
//起始页
int _startpage = c.getStartpage();
//结束页
int _endpage = c.getEndpage();
//业务编码
String _code = c.getCode();
//所有的表面页
for (int i = _startpage; i <= _endpage; i++) {
PageList p = new PageList();
p.setId(StringKit.getUUID());
p.setUrl(StringUtils.replace(_url, PLACEHOLDER, String.valueOf(i)));
p.setPageno(i);
p.setCode(_code);
p.setHandle(Confirm.no.toString());
p.setCreateTime(new Date());
pages.add(p);
}
System.out.println("共转换列表页:" + pages.size());
// 保存当前业务所有的列表
int[] rows = PageList.dao.saveAll(pages);
System.out.println("共保存列表页:" + rows.length);
//状态更新为已处理
DownloaderConfig.dao.updateStatusById(Confirm.yes.toString(), _id);
System.out.println("转换状态更新完毕!");
System.out.println("-----------------------------------------------------------------");
}
} else {
System.out.println("没有配置需要转换:" + configs.size());
}
// 查询需要提出详情页的所有列表页,并根据不同的业务使用不同的页面解析器
BussCode[] codes = BussCode.values();
for (BussCode c : codes) {
String _code = c.getCode();
PageListProcessorFactory factory = new PageListProcessorFactory();
// 根据业务编码从列表页中解析出详情页的地址,并保存起来
factory.produce(_code);
}
}
}
| [
"wind123456"
] | wind123456 |
cf3ffb05a21781291c8f31162d4a7c18e75059a0 | e89dc01c95b8b45404f971517c2789fd21657749 | /src/main/java/com/alipay/api/domain/AntMerchantExpandFrontcategorySecurityModifyModel.java | c5107ac5215365ec90bd832ff8cc7c75161c6183 | [
"Apache-2.0"
] | permissive | guoweiecust/alipay-sdk-java-all | 3370466eec70c5422c8916c62a99b1e8f37a3f46 | bb2b0dc8208a7a0ab8521a52f8a5e1fcef61aeb9 | refs/heads/master | 2023-05-05T07:06:47.823723 | 2021-05-25T15:26:21 | 2021-05-25T15:26:21 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,628 | java | package com.alipay.api.domain;
import java.util.List;
import com.alipay.api.AlipayObject;
import com.alipay.api.internal.mapping.ApiField;
import com.alipay.api.internal.mapping.ApiListField;
/**
* 前台类目更新
*
* @author auto create
* @since 1.0, 2021-01-15 11:35:37
*/
public class AntMerchantExpandFrontcategorySecurityModifyModel extends AlipayObject {
private static final long serialVersionUID = 6134622146626457465L;
/**
* 前台类目描述
*/
@ApiField("description")
private String description;
/**
* 前台类目ID
*/
@ApiField("front_category_id")
private String frontCategoryId;
/**
* 素材列表(会和前台类目已存在素材做差异化比较后做增删改操作)
*/
@ApiListField("material_list")
@ApiField("material_modify_info")
private List<MaterialModifyInfo> materialList;
/**
* 前台类目名称
*/
@ApiField("name")
private String name;
public String getDescription() {
return this.description;
}
public void setDescription(String description) {
this.description = description;
}
public String getFrontCategoryId() {
return this.frontCategoryId;
}
public void setFrontCategoryId(String frontCategoryId) {
this.frontCategoryId = frontCategoryId;
}
public List<MaterialModifyInfo> getMaterialList() {
return this.materialList;
}
public void setMaterialList(List<MaterialModifyInfo> materialList) {
this.materialList = materialList;
}
public String getName() {
return this.name;
}
public void setName(String name) {
this.name = name;
}
}
| [
"ben.zy@antfin.com"
] | ben.zy@antfin.com |
a83d9f770e53234adff457709e3e5bdb3bbce509 | 647ec12ce50f06e7380fdbfb5b71e9e2d1ac03b4 | /com.tencent.mm/classes.jar/com/tencent/mm/plugin/mvvmlist/a/d.java | a6362acba0930b9f5b3d53b78b4d4bc936f18614 | [] | no_license | tsuzcx/qq_apk | 0d5e792c3c7351ab781957bac465c55c505caf61 | afe46ef5640d0ba6850cdefd3c11badbd725a3f6 | refs/heads/main | 2022-07-02T10:32:11.651957 | 2022-02-01T12:41:38 | 2022-02-01T12:41:38 | 453,860,108 | 36 | 9 | null | 2022-01-31T09:46:26 | 2022-01-31T02:43:22 | Java | UTF-8 | Java | false | false | 1,149 | java | package com.tencent.mm.plugin.mvvmlist.a;
import com.tencent.matrix.trace.core.AppMethodBeat;
import java.util.ArrayList;
import kotlin.Metadata;
@Metadata(d1={""}, d2={"Lcom/tencent/mm/plugin/mvvmlist/datasource/DataResponse;", "T", "", "request", "Lcom/tencent/mm/plugin/mvvmlist/datasource/DataRequest;", "(Lcom/tencent/mm/plugin/mvvmlist/datasource/DataRequest;)V", "continueFlag", "", "getContinueFlag", "()Z", "setContinueFlag", "(Z)V", "dataList", "Ljava/util/ArrayList;", "Lkotlin/collections/ArrayList;", "getDataList", "()Ljava/util/ArrayList;", "getRequest", "()Lcom/tencent/mm/plugin/mvvmlist/datasource/DataRequest;", "plugin-mvvmlist_release"}, k=1, mv={1, 5, 1}, xi=48)
public final class d<T>
{
public boolean ABD;
private final c<T> DHT;
public final ArrayList<T> pUj;
public d(c<T> paramc)
{
AppMethodBeat.i(278742);
this.DHT = paramc;
this.pUj = new ArrayList();
AppMethodBeat.o(278742);
}
}
/* Location: L:\local\mybackup\temp\qq_apk\com.tencent.mm\classes3.jar
* Qualified Name: com.tencent.mm.plugin.mvvmlist.a.d
* JD-Core Version: 0.7.0.1
*/ | [
"98632993+tsuzcx@users.noreply.github.com"
] | 98632993+tsuzcx@users.noreply.github.com |
6eb8646a19e18197f80dfc0dc9237ee3ddb1b24c | 3245f856a72e34de1f5c1c2092446425f21ebfab | /src/main/java/ru/itprogram/repository/ProductTypeRepository.java | 538ebce2b2da2f9249a8eedcb71a842cf4c21163 | [] | no_license | VladimirPanchenko/SpringOnlineStore | 5837bbe58d5ca09bea928d0f8e0f5cf4a98e4508 | d71c29d4125dc535c39d2a90ae97f3361d194163 | refs/heads/master | 2021-07-03T16:11:08.341179 | 2019-05-23T01:55:55 | 2019-05-23T01:55:55 | 187,550,465 | 0 | 0 | null | 2020-10-13T13:20:15 | 2019-05-20T01:52:31 | Java | UTF-8 | Java | false | false | 2,359 | java | package ru.itprogram.repository;
import org.springframework.beans.factory.annotation.Autowired;
import ru.itprogram.entity.dao.ProductType;
import ru.itprogram.utils.*;
import ru.itprogram.utils.generater.ArrayListGenerate;
import ru.itprogram.utils.generater.CurrentConnectionGenerate;
import ru.itprogram.utils.generater.dao.ProductTypeGenerate;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.List;
public class ProductTypeRepository implements Repository<ProductType> {
@Autowired
private ArrayListGenerate arrayListGenerate;
@Autowired
private CurrentConnectionGenerate currentConnectionGenerate;
@Autowired
private ProductTypeGenerate productTypeGenerate;
@Override
public List<ProductType> getAllEntity() {
List<ProductType> productTypes = arrayListGenerate.getArrayList();
CurrentConnection currentConnection = currentConnectionGenerate.getCurrentConnection();
try {
Statement statement = currentConnection.getConnection().createStatement();
ResultSet resultSet = statement.executeQuery(SelectSql.SELECT_ALL_PRODUCT_TYPE);
while (resultSet.next()) {
ProductType productType = productTypeGenerate.getProductType();
productType.setId(resultSet.getInt("id"));
productType.setType(resultSet.getString("type"));
productTypes.add(productType);
}
resultSet.close();
statement.close();
currentConnection.getConnection().close();
} catch (SQLException e) {
e.printStackTrace();
}
return productTypes;
}
@Override
public void saveEntity(ProductType productType) {
CurrentConnection currentConnection = currentConnectionGenerate.getCurrentConnection();
try {
PreparedStatement preparedStatement = currentConnection.getConnection()
.prepareStatement(InsertSql.INSERT_PRODUCT_TYPE);
preparedStatement.setString(1, productType.getType());
preparedStatement.execute();
preparedStatement.close();
currentConnection.getConnection().close();
} catch (SQLException e) {
e.printStackTrace();
}
}
}
| [
"kapcap4@gmail.com"
] | kapcap4@gmail.com |
c15435523481f7a2b745d7b7bd631b5ffea700ce | bddc06ee551bbb2d54e608fc9df7e2fc923a5df2 | /uo-server/src/main/java/com/wd/cloud/uoserver/pojo/entity/OrgDept.java | 855e2eaee540b1f9e166aa59dd0ed5369a6fc315 | [] | no_license | DimonHo/api-root | c3f330bffa4ea69d6e52159adf572db5ce3f5753 | d30590f5ebc7dcc800d1ecbefde018ecb5ec7f05 | refs/heads/master | 2022-04-20T14:45:59.559090 | 2019-05-09T01:32:17 | 2019-05-09T01:32:17 | 251,194,121 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 836 | java | package com.wd.cloud.uoserver.pojo.entity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.hibernate.annotations.DynamicInsert;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;
/**
* @author He Zhigang
* @date 2019/3/4
* @Description: 机构院系表
*/
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@Entity
@DynamicInsert
@Table(name = "org_dept", uniqueConstraints = {@UniqueConstraint(columnNames = {"name", "org_flag"})})
public class OrgDept extends AbstractEntity {
/**
* 所属上级院系
*/
private Long pid;
/**
* 院系名称
*/
private String name;
@Column(name = "org_flag")
private String orgFlag;
}
| [
"hezhigang@hnwdkj.com"
] | hezhigang@hnwdkj.com |
03a965766c57f6a2816200bf7be278406b273e3a | dcc34918cff185c7a33783e9049d7e46765b163a | /source code/LHD/src/trunk/parallel/engine/opt/ExhOptimiser.java | 4cf757961125ad37223344b58c31d4720782a411 | [
"Apache-2.0"
] | permissive | dice-group/CostBased-FedEval | 9b6a081dbd8a1d533ab664a031522c4e78c1a882 | eb7b6a6972a53cc774be53362fe6dcfba4dadf28 | refs/heads/master | 2022-02-28T02:43:36.074550 | 2021-04-06T10:31:52 | 2021-04-06T10:31:52 | 178,651,394 | 0 | 4 | Apache-2.0 | 2022-02-10T16:16:13 | 2019-03-31T06:30:11 | Java | UTF-8 | Java | false | false | 12,816 | java | package trunk.parallel.engine.opt;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import trunk.config.Config;
import trunk.graph.Edge;
import trunk.graph.SimpleGraph;
import trunk.graph.Vertex;
import trunk.parallel.engine.ParaConfig;
import trunk.parallel.engine.error.RelativeError;
import trunk.parallel.engine.exec.operator.BindJoin;
import trunk.parallel.engine.exec.operator.EdgeOperator;
import trunk.parallel.engine.exec.operator.HashJoin;
public class ExhOptimiser extends Optimiser {
private Set<EdgeOperator> optimal;
public ExhOptimiser(SimpleGraph g) {
super(g);
long start = System.nanoTime();
initialOptimal();
long end = System.nanoTime();
if(ParaConfig.debug) {
Long inter = end-start;
System.out.println("Optimisation: "+inter.doubleValue()/1000000000);
}
}
@Override
public List<EdgeOperator> nextStage() {
List<EdgeOperator> operators = null;
if(optimal !=null) {
operators = new ArrayList<EdgeOperator>(optimal);
optimal = null;
}
return operators;
}
@Override
public Set<Vertex> getRemainVertices() {
Set<Vertex> remains = new HashSet<Vertex>();
for(Vertex v:g.getVertices()) {
if(!v.isConsumed()) {
remains.add(v);
}
}
return remains;
}
private void initialOptimal() {
//optimal contains the sequence of the execution of edges.
//each element (a List<EdgeOperator>) is the edges to be executed
//in parallel, the index of the element indicates the order of the execution
//of these edges.
List<Edge> edges = g.getEdges();
optimal = getFirstStage(edges);
if(!edges.isEmpty()) {
Iterator<List<Edge>> orders = getPermutations(edges);
Set<Set<EdgeOperator>> candidates;
candidates = getOptimal(optimal,orders);
optimal = finalize(optimal,candidates);
}
}
/**
* Find out all edges having concrete node. All these edges will be executed first.
* @param edges
* @return
*/
private Set<EdgeOperator> getFirstStage(List<Edge> edges) {
Set<EdgeOperator> firststage = new HashSet<EdgeOperator>();
List<Edge> toberemove = new ArrayList<Edge>();
for(Edge e:edges) {
Edge se = (Edge) e;
if(se.getV1().getNode().isConcrete() || se.getV2().getNode().isConcrete()) {
firststage.add(new HashJoin(se));
toberemove.add(e);
if(Config.relative_error) {
RelativeError.est_resultSize.put(se.getV1(), se.estimatedCard());
RelativeError.est_resultSize.put(se.getV2(), se.estimatedCard());
}
}
// if(Config.relative_error){
// RelativeError.est_resultSize.put(se.getV1(), (int)se.estimatedCard());
// RelativeError.est_resultSize.put(se.getV2(), (int)se.estimatedCard());
// if(se.getV1().getNode().isConcrete()) {
// RelativeError.est_resultSize.put(se.getV1(), 1);
// //RelativeError.est_resultSize.put(se.getV2(), 1);
// }
// else {
// RelativeError.est_resultSize.put(se.getV1(), se.getTripleCount()/(se.getDistinctObject()!=0?se.getDistinctObject():1));
// }
// if (se.getV2().getNode().isConcrete()){
// RelativeError.est_resultSize.put(se.getV2(), 1);
// //RelativeError.est_resultSize.put(se.getV1(), 1);
// }else {
// RelativeError.est_resultSize.put(se.getV2(), se.getTripleCount()/(se.getDistinctSubject()!=0?se.getDistinctSubject():1));
// }
// }
if(!se.getV1().isConsumed()) {
firststage.add(new BindJoin(se.getV1(),se));
toberemove.add(e);
if(Config.relative_error) {
RelativeError.est_resultSize.put(se.getV1(), se.estimatedCard());
RelativeError.est_resultSize.put(se.getV2(), se.estimatedCard());
}
} else if(!se.getV2().isConsumed()) {
firststage.add(new BindJoin(se.getV2(),se));
toberemove.add(e);
if(Config.relative_error) {
RelativeError.est_resultSize.put(se.getV1(), se.estimatedCard());
RelativeError.est_resultSize.put(se.getV2(), se.estimatedCard());
}
}
}
edges.removeAll(toberemove);
return firststage;
}
private Set<Set<EdgeOperator>> getOptimal(Set<EdgeOperator> firststage, Iterator<List<Edge>> orders) {
Map<Vertex,Double> resultsize_ = new HashMap<Vertex,Double>();
for(EdgeOperator eo:firststage) {
Edge edge = eo.getEdge();
Vertex v1 = edge.getV1();
Vertex v2 = edge.getV2();
if(v1.getNode().isConcrete()) {
resultsize_.put(v1, 1.0);
resultsize_.put(v2, (double)edge.getTripleCount()/edge.getDistinctSubject());
}
else {
resultsize_.put(v2, 1.0);
resultsize_.put(v1, (double)edge.getTripleCount()/edge.getDistinctObject());
}
}
if(Config.relative_error && resultsize_.size()>0) {
// RelativeError.est_resultSize.clear();
RelativeError.est_resultSize.putAll(resultsize_);
}
double cost = Double.MAX_VALUE;
Set<Set<EdgeOperator>> candidates = new HashSet<Set<EdgeOperator>>();
while(orders.hasNext()) {
List<Edge> order = orders.next();
//for a list of edges generate the corresponding list of operator
//that has the minimum cost. That is, for each edge, choose either
//hash join or bind join that has lower cost
Set<EdgeOperator> plan = new HashSet<EdgeOperator>();
//record bound vertices and their number of bindings
Map<Vertex,Double> resultsize = new HashMap<Vertex,Double>(resultsize_);
double temp = 0;
for(Edge e:order) {
Edge edge = (Edge) e;
Vertex v1 = edge.getV1();
Vertex v2 = edge.getV2();
//add all concrete vertices and their binding number (1) to the record
if(v1.getNode().isConcrete()) {
resultsize.put(v1, 1.0);
}
if(v2.getNode().isConcrete()) {
resultsize.put(v2, 1.0);
}
Double size1 = resultsize.get(v1);
Double size2 = resultsize.get(v2);
double nj = 1*CostModel.CQ + edge.getTripleCount()*CostModel.CT;
if(size1 == null && size2 == null) {//if this is the first edge, use HashJoin.
temp+=nj;
plan.add(new HashJoin(edge));
resultsize.put(v1, (double)edge.getTripleCount());
resultsize.put(v2, (double)edge.getTripleCount());
} else {
size1 = size1 == null?edge.getDistinctSubject():size1;
size2 = size2 == null?edge.getDistinctObject():size2;
double ssel = 1d/edge.getDistinctSubject();
double osel = 1d/edge.getDistinctObject();
int bindingsize = (int) Math.max(size1*ssel*edge.getTripleCount()*size2*osel, 2);
if(size1 <= size2) {
//if the minimum vertex is concrete (and a concrete vertex should always
//be the minimum vertex since its binding size is 1), use hash join
if(v1.getNode().isConcrete()) {
temp+=nj;
plan.add(new HashJoin(edge));
resultsize.put(v2, (double)bindingsize);
continue;
}
double bj = size1*CostModel.CQ + size1*ssel*edge.getTripleCount();
if(nj>bj) {
temp+=bj;
plan.add(new BindJoin(v1,edge));
} else {
temp+=nj;
plan.add(new HashJoin(edge));
}
//either join should return the same number of results
resultsize.put(v2, (double)bindingsize);
} else {//size2<size1
if(v2.getNode().isConcrete()) {
temp+=nj;
plan.add(new HashJoin(edge));
resultsize.put(v1, (double)bindingsize);
continue;
}
double bj = size2*CostModel.CQ + size2*osel*edge.getTripleCount();
if(nj>bj) {
temp+=bj;
plan.add(new BindJoin(v2,edge));
} else {
temp+=nj;
plan.add(new HashJoin(edge));
}
resultsize.put(v1, (double)bindingsize);
}
}
}
if(temp<cost) {
cost = temp;
candidates.clear();
candidates.add(plan);
RelativeError.est_resultSize.putAll(resultsize);
}
if(temp == cost) {
candidates.add(plan);
RelativeError.est_resultSize.putAll(resultsize);
}
}
return candidates;
}
private Set<EdgeOperator> finalize(Set<EdgeOperator> firststage, Set<Set<EdgeOperator>> plans) {
Set<EdgeOperator> optimal = null;
int count = 0;
for(Set<EdgeOperator> plan:plans) {
/*List<List<EdgeOperator>> temp;
temp = parallelise(firststage,plan);
//keep the plan with minimum depth, which means minimum
//steps are needed to execute a query
if(optimal == null) {
optimal = temp;
} else
if(temp.size()<optimal.size()) {
optimal = temp;
}*/
int _count = 0;
for(EdgeOperator eo:plan) {
if(eo instanceof HashJoin) {
_count++;
}
}
if(_count>count) {
count = _count;
plan.addAll(firststage);
optimal = plan;
}
}
if(optimal == null) {
optimal = plans.iterator().next();
optimal.addAll(firststage);
}
return optimal;
}
/*private List<List<EdgeOperator>> parallelise(List<List<EdgeOperator>> firststage, List<EdgeOperator> plan) {
List<List<EdgeOperator>> prllplan = new ArrayList<List<EdgeOperator>>();
prllplan.add(new ArrayList<EdgeOperator>(firststage.get(0)));
List<Set<Vertex>> dependency = new ArrayList<Set<Vertex>>();
//initial dependency
dependency.add(new HashSet<Vertex>());
for(EdgeOperator eo:prllplan.get(0)) {
dependency.get(0).add(eo.getEdge().getV1());
dependency.get(0).add(eo.getEdge().getV2());
}
for(EdgeOperator eo:plan) {
Vertex start = eo.getStartVertex();
if(start == null) {//no dependency needed
prllplan.get(0).add(eo);
dependency.get(0).add(eo.getEdge().getV1());
dependency.get(0).add(eo.getEdge().getV2());
} else {//check dependency
for(int i=0;i<dependency.size();i++) {
if(dependency.get(i).contains(start)) {//if the start vertex has been bound
try {
prllplan.get(i+1).add(eo);
dependency.get(i+1).add(eo.getEdge().getV1());
dependency.get(i+1).add(eo.getEdge().getV2());
}
catch (Exception e) {
prllplan.add(new ArrayList<EdgeOperator>());
dependency.add(new HashSet<Vertex>());
prllplan.get(i+1).add(eo);
dependency.get(i+1).add(eo.getEdge().getV1());
dependency.get(i+1).add(eo.getEdge().getV2());
}
break;
}//try the next plan_num
}
}
}
return prllplan;
}*/
/**
* Generate the permutations of the given set of objects
* @param items the set of objects
* @return a list of all permutations
*/
private <T> Iterator<List<T>> getPermutations(Collection<T> items) {
/*//Recursive approach
List<List<T>> results = new ArrayList<List<T>>();
if(items.size() == 1) {
List<T> temp = new ArrayList<T>();
temp.add(items.iterator().next());
results.add(temp);
return results;
}
for(T current:items) {
Set<T> next = new HashSet<T>();
next.addAll(items);
next.remove(current);
List<List<T>> subResults = getPermutations(next);
for(List<T> solution:subResults) {
solution.add(0, current);
results.add(solution);
}
}
return results;*/
return new Permutor<T>(items);
}
/**
* An iterative approach
* @param plans
* @param items
* @return
*//*
private <T> List<List<T>> getPermutations(List<List<T>> plans, Collection<T> items) {
if(plans.get(0).size() == items.size())
return plans;
List<List<T>> partial = new ArrayList<List<T>>();
for(List<T> plan:plans) {
for(T item:items) {
if(plan.contains(item))
continue;
List<T> temp = new ArrayList<T>();
temp.addAll(plan);
temp.add(item);
partial.add(temp);
}
}
return getPermutations(partial,items);
}*/
}
class Permutor<T> implements Iterator<List<T>> {
private Iterator<List<T>> iter = null;
private Iterator<T> self = null;
private Collection<T> items;
private T current = null;
public Permutor(Collection<T> items) {
this.items = items;
self = items.iterator();
}
@Override
public boolean hasNext() {
if(iter == null) {
return self.hasNext();
}
if(iter.hasNext() || self.hasNext()) {
return true;
}
return false;
}
@Override
public List<T> next() {
List<T> next;
if(items.size() == 1) {
next = new ArrayList<T>();
next.add(self.next());
return next;
}
while(true) {
if(current == null) {
current = self.next();
List<T> temp = new ArrayList<T>(items);
temp.remove(current);
iter = new Permutor<T>(temp);
}
if(!iter.hasNext()) {
current = null;
continue;
}
next = iter.next();
next.add(0,current);
return next;
}
}
@Override
public void remove() {
}
}
| [
"umair.qudus@hotmail.com"
] | umair.qudus@hotmail.com |
d295b98f6dcf728366485bafa69b30a74ebd17a2 | 7e2023cbe43e68ba90a58742d329fe8caa87efbf | /src/main/java/ru/director/SpringDiaryLern/model/Student.java | 36c3b28ca3294747d31b21d2006a1b37ab7c9a77 | [] | no_license | directorPandy/SpringDiaryLern | 0e3413278e683166e5095a2e511103c3a45dd26f | afb6a0d674b2405dba743afe4027c66a52782b3e | refs/heads/master | 2023-04-19T14:33:19.163424 | 2021-05-04T12:27:51 | 2021-05-04T12:27:51 | 358,207,615 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,076 | java | package ru.director.SpringDiaryLern.model;
import lombok.Getter;
import lombok.Setter;
import javax.persistence.*;
@Entity(name = "Student")
@Table(name="student")
@Getter
@Setter
public class Student {
@Id
@GeneratedValue
@Column(name = "id",
updatable = false)
private Long id;
@Column(name = "name",
nullable = false,
columnDefinition = "TEXT")
private String name;
@ManyToOne
private Grade grade;
public Student(String name) {
this.name = name;
}
public Student(String name, Grade grade) {
this.name = name;
this.grade = grade;
}
public Student() {
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Long getId() {
return id;
}
@Override
public String toString() {
return "Student{" +
"id=" + id +
", name='" + name + '\'' +
'}';
}
}
| [
"81641257+directorPandy@users.noreply.github.com"
] | 81641257+directorPandy@users.noreply.github.com |
9e7dacce6ec43169c01259570cf3416f42bd3ef2 | f68b98faf0cb902d77bafb1b86106870f7edf8c5 | /spooned/fil/iagl/opl/rendu/two/insert/impl/CatchInsert.java | bdd54be8cd1fb6db62427210de7252f567f59121 | [] | no_license | Ly4m/idlScrum | 193933fea531bf68d07e689952e4459882d5300e | 9c5cf2928fb19eeaafc3d024216dfbaf9f54b50f | refs/heads/master | 2021-01-10T16:56:31.593010 | 2016-02-08T23:16:42 | 2016-02-08T23:16:42 | 50,840,013 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,880 | java | package fil.iagl.opl.rendu.two.insert.impl;
import spoon.processing.AbstractProcessor;
import fil.iagl.opl.rendu.two.processors.AddWatcherProcessor;
import java.util.Arrays;
import org.fest.assertions.Assertions;
import fil.iagl.opl.rendu.two.processors.BeforeInsertTest;
import fil.iagl.opl.rendu.two.samples.BeforeSample;
import fil.iagl.opl.rendu.two.processors.CaseInsertTest;
import fil.iagl.opl.rendu.two.processors.CatchInsertTest;
import fil.iagl.opl.rendu.two.processors.ConstructorCoolTest;
import fil.iagl.opl.rendu.two.processors.ConstructorInsertTest;
import fil.iagl.opl.rendu.two.samples.ConstructorSample;
import fil.iagl.opl.rendu.two.processors.CorrespondingTask;
import fil.iagl.opl.rendu.two.processors.CorrespondingTasks;
import spoon.reflect.code.CtCase;
import spoon.reflect.code.CtCatch;
import spoon.reflect.declaration.CtClass;
import spoon.reflect.code.CtCodeSnippetStatement;
import spoon.reflect.code.CtDo;
import spoon.reflect.declaration.CtElement;
import spoon.reflect.code.CtFor;
import spoon.reflect.code.CtIf;
import spoon.reflect.code.CtStatement;
import spoon.reflect.code.CtSwitch;
import spoon.reflect.code.CtWhile;
import fil.iagl.opl.rendu.two.processors.DoInsertTest;
import fil.iagl.opl.rendu.two.samples.DoSample;
import java.lang.annotation.ElementType;
import java.io.File;
import java.io.FileOutputStream;
import fil.iagl.opl.rendu.two.processors.ForInsertTest;
import fil.iagl.opl.rendu.two.samples.ForSample;
import java.io.IOException;
import fil.iagl.opl.rendu.two.processors.IfInsertTest;
import fil.iagl.opl.rendu.two.samples.IfSample;
import fil.iagl.opl.rendu.two.insert.Insertion;
import spoon.Launcher;
import java.util.List;
import fil.iagl.opl.rendu.two.processors.MethodInsertTest;
import fil.iagl.opl.rendu.two.samples.MethodSample;
import java.io.ObjectOutputStream;
import java.util.function.Predicate;
import java.lang.annotation.Repeatable;
import fil.iagl.opl.rendu.two.processors.SwitchInsertTest;
import fil.iagl.opl.rendu.two.samples.SwitchSample;
import fil.iagl.opl.rendu.two.processors.SynchronizedInsertTest;
import fil.iagl.opl.rendu.two.samples.SynchronizedSample;
import java.lang.annotation.Target;
import org.junit.Test;
import fil.iagl.opl.rendu.two.processors.TryInsertTest;
import fil.iagl.opl.rendu.two.samples.TrySample;
import fil.iagl.opl.rendu.two.processors.WhileInsertTest;
import fil.iagl.opl.rendu.two.samples.WhileSample;
import instrumenting._Instrumenting;
public class CatchInsert implements Insertion {
@Override
public boolean match(CtElement element) {
return element instanceof CtCatch;
}
@Override
public void apply(CtElement element, CtStatement statementToInsert) {
CtCatch ctCatch = ((CtCatch)(element));
statementToInsert.setParent(ctCatch.getBody());
ctCatch.getBody().getStatements().add(0, statementToInsert);
}
}
| [
"jordan.piorun@gmail.com"
] | jordan.piorun@gmail.com |
1d67ed9f4d301ce9c46037be9264fbaaf8113ba3 | aaaac917b0dcb9a996461f2e8d3ccaea60f60aae | /src/main/java/com/work/entity/TPubAttachinfo.java | 4e628ac1e00b5927d02126e405f18afc56f1ef1f | [] | no_license | zijinlian/TeamTaleApi | 9b8cff28e7c76576db0e82e255e6cfc8ac9364c5 | 3f048ae3f993cf13b8ec5eedfd81fcb78bc0a66d | refs/heads/master | 2022-12-21T12:28:01.106868 | 2019-08-27T05:12:18 | 2019-08-27T05:12:18 | 204,605,642 | 1 | 0 | null | 2022-12-16T07:46:39 | 2019-08-27T02:46:07 | Java | UTF-8 | Java | false | false | 2,031 | java | package com.work.entity;
import java.math.BigDecimal;
public class TPubAttachinfo {
private String fdAttachid;
private String fdAttachtyp;
private String fdSourcenme;
private String fdNewnme;
private String fdStorepath;
private String fdUploaderid;
private String fdUploadernme;
private String fdUploadtime;
private BigDecimal fdValidflag;
private String fdComments;
private String fdLoaded;
public String getFdAttachid() {
return fdAttachid;
}
public void setFdAttachid(String fdAttachid) {
this.fdAttachid = fdAttachid;
}
public String getFdAttachtyp() {
return fdAttachtyp;
}
public void setFdAttachtyp(String fdAttachtyp) {
this.fdAttachtyp = fdAttachtyp;
}
public String getFdSourcenme() {
return fdSourcenme;
}
public void setFdSourcenme(String fdSourcenme) {
this.fdSourcenme = fdSourcenme;
}
public String getFdNewnme() {
return fdNewnme;
}
public void setFdNewnme(String fdNewnme) {
this.fdNewnme = fdNewnme;
}
public String getFdStorepath() {
return fdStorepath;
}
public void setFdStorepath(String fdStorepath) {
this.fdStorepath = fdStorepath;
}
public String getFdUploaderid() {
return fdUploaderid;
}
public void setFdUploaderid(String fdUploaderid) {
this.fdUploaderid = fdUploaderid;
}
public String getFdUploadernme() {
return fdUploadernme;
}
public void setFdUploadernme(String fdUploadernme) {
this.fdUploadernme = fdUploadernme;
}
public String getFdUploadtime() {
return fdUploadtime;
}
public void setFdUploadtime(String fdUploadtime) {
this.fdUploadtime = fdUploadtime;
}
public BigDecimal getFdValidflag() {
return fdValidflag;
}
public void setFdValidflag(BigDecimal fdValidflag) {
this.fdValidflag = fdValidflag;
}
public String getFdComments() {
return fdComments;
}
public void setFdComments(String fdComments) {
this.fdComments = fdComments;
}
public String getFdLoaded() {
return fdLoaded;
}
public void setFdLoaded(String fdLoaded) {
this.fdLoaded = fdLoaded;
}
} | [
"1176496178@qq.com"
] | 1176496178@qq.com |
92293ba10df5224ae53b47d1ee17eacd1f231edb | 72c02268078a70973d3f92aee657623b6c2e0c6f | /micro-service-server-reactive/src/main/java/edu/ustc/server/domain/User.java | 43bb478e7f3a77b8f0c06da12eefeb69b4517b5a | [
"MIT"
] | permissive | colddew/micro-service | f4a18c43366bf74b0d5dfffb4f71c6b51ecd36a9 | a1fe10037196f1d42f0e75722357cb3c6449e46c | refs/heads/master | 2023-05-27T05:04:31.564412 | 2021-09-13T16:07:09 | 2021-09-13T16:07:09 | 40,712,527 | 27 | 11 | MIT | 2023-05-09T18:07:28 | 2015-08-14T11:51:12 | Java | UTF-8 | Java | false | false | 398 | java | package edu.ustc.server.domain;
/**
* Created by colddew on 2019/5/7.
*/
public class User {
private Integer id;
private String name;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
| [
"88028842@qq.com"
] | 88028842@qq.com |
42b3aceabe609730dc1a87c954dd93db71246635 | 3e24cc42539db6cfaa51586c55854e0bf14a4a65 | /src/org/jonix/codelist/PriceCodeTypes.java | 6a94cd0ce58620387745d5e8ddb98fddfec712bf | [] | no_license | MiladRamsys/jonix | 08dc77edff0f0addc49a5d20f45534c818b3a0e2 | fc493bb2e354686488ad63c2c051e73039c468a7 | refs/heads/master | 2021-01-10T21:23:41.811111 | 2013-04-04T14:39:26 | 2013-04-04T14:39:26 | 32,104,199 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 859 | java | package org.jonix.codelist;
/**
* Enum that corresponds to Onix's CodeList 179
*
* @author Zach Melamed
*
*/
public enum PriceCodeTypes
{
/**
* A publisher or retailer’s proprietary code list which identifies particular codes with particular price points, price tiers or bands.
*/
Proprietary("01"),
/**
* Price Code scheme for Finnish Pocket Books (Pokkareiden hintaryhmä). Price codes expressed as letters A–J in <PriceCode>.
*/
Finnish_Pocket_Book_price_code("02");
public final String code;
private PriceCodeTypes(String code)
{
this.code = code;
}
private static PriceCodeTypes[] values = PriceCodeTypes.values();
public static PriceCodeTypes fromCode(String code)
{
if (code != null && !code.isEmpty())
for (PriceCodeTypes item : values)
if (item.code.equals(code))
return item;
return null;
}
}
| [
"tsahim@gmail.com@d7478ce8-731c-9f3f-b499-ac6574b89192"
] | tsahim@gmail.com@d7478ce8-731c-9f3f-b499-ac6574b89192 |
caf67140a84847e57d8dec4ea992f4f4c5f2b8df | 468469f70f11190e583cb61994f5a7e08a9ebd84 | /project-code/src/player/subclasses/Human.java | 49937035b1cfcff0fadb750ea53134e782940c0c | [] | no_license | Mattie432/Civilization-Wars-Advanced | 406c5c739d06fe4dabf5d808a6d0fd7cb88f2a1b | e2c02dfbda0a7038dee6ffc4a69bf42867499b26 | refs/heads/master | 2021-01-22T19:40:37.062802 | 2015-04-28T18:52:34 | 2015-04-28T18:52:34 | 20,933,824 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 523 | java | package player.subclasses;
import player.Player;
/**
* The player type Human
* @author Matt
*
*/
@SuppressWarnings("serial")
public class Human extends Player {
/**
* Constructor to create player. This adds the player to the team specified
*
* @param team
* : Teams - the Teams object
* @param teamOfPlayer
* : Teams - the team (e.g. Teams.GREEN)
* @param playerName
* : String - the players name
*/
public Human(String playerName) {
super(playerName);
}
}
| [
"mattie432@icloud.com"
] | mattie432@icloud.com |
54e69ae95a9a7d60b98838859f0b7e5721bd1c83 | 627dafa165ee4420680b4144c849e141596ae0b0 | /wecardio/wecardio/src/main/java/com/borsam/plugin/file/FilePlugin.java | f2128a364c4c5e4f492d02db8b581f46d3968c0c | [] | no_license | tan-tian/wecardio | 97339383a00ecd090dd952ea3c4c3f32dac8a6f2 | 5e291d19bce2d4cebd43040e4195a26d18d947c3 | refs/heads/master | 2020-04-03T01:01:57.429064 | 2018-10-25T15:26:50 | 2018-10-25T15:26:50 | 154,917,227 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,878 | java | package com.borsam.plugin.file;
import com.borsam.plugin.StoragePlugin;
import com.borsam.pojo.file.FileInfo;
import com.hiteam.common.util.ConfigUtils;
import org.apache.commons.io.FileUtils;
import org.springframework.stereotype.Component;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
* Plugin - 本地存储
* Created by tantian on 2015/6/30.
*/
@Component("filePlugin")
public class FilePlugin extends StoragePlugin {
@Override
public boolean getIsEnabled() {
return Boolean.valueOf(ConfigUtils.config.getProperty("isFilePluginEnable"));
}
@Override
public void upload(String path, File file, String contentType) {
File destFile = new File(ConfigUtils.config.getProperty("uploadPath"), path);
try {
FileUtils.moveFile(file, destFile);
} catch (IOException e) {
e.printStackTrace();
}
}
@Override
public String getUrl(String path) {
return path;
}
@Override
public List<FileInfo> browser(String path) {
List<FileInfo> fileInfos = new ArrayList<FileInfo>();
File directory = new File(ConfigUtils.config.getProperty("uploadPath"), path);
if (directory.exists() && directory.isDirectory()) {
for (File file : directory.listFiles()) {
FileInfo fileInfo = new FileInfo();
fileInfo.setName(file.getName());
fileInfo.setUrl(ConfigUtils.config.getProperty("siteUrl") + "/file?path=" + path + file.getName());
fileInfo.setIsDirectory(file.isDirectory());
fileInfo.setSize(file.length());
fileInfo.setLastModified(new Date(file.lastModified()));
fileInfos.add(fileInfo);
}
}
return fileInfos;
}
}
| [
"tantiant@126.com"
] | tantiant@126.com |
4cef5b3d37bf6c65368fa905c06ad447f14b3da0 | bccecf3541fac152969ce01ea8151b42e327ec74 | /parasite-lib/src/main/java/com/hu/parasite/util/ReflectUtil.java | ca6fc2525ad008236b1d050c5ae37a868a0d371c | [] | no_license | guyueyingmu/Parasite | a6a00a82d9bc192b948be0a5e1cb0bbac4650936 | 76a994955e80d42fbad7f1f440ba26f669b242c9 | refs/heads/master | 2020-03-23T23:28:34.746447 | 2018-01-20T18:10:43 | 2018-01-20T18:10:43 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 25,002 | java | package com.hu.parasite.util;
import java.io.InputStream;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.URL;
import java.util.NoSuchElementException;
/**
* Created by HuJi on 2017/12/29.
*/
public class ReflectUtil {
public static ClassLoader getClassLoader() {
return Thread.currentThread().getContextClassLoader();
}
public static URL getResource(String name) {
return getClassLoader().getResource(name);
}
public static InputStream getResourceAsStream(String name) {
return getClassLoader().getResourceAsStream(name);
}
public static Class<?> loadClass(String className)
throws ClassNotFoundException {
switch (className) {
case "boolean": return boolean.class;
case "byte": return byte.class;
case "char": return char.class;
case "short": return short.class;
case "int": return int.class;
case "long": return long.class;
case "float": return float.class;
case "double": return double.class;
case "void": return void.class;
}
return Class.forName(className, true, getClassLoader());
}
public static Class<?> loadClass(Class<?> clazz) {
switch (clazz.getName()) {
case "boolean": return Boolean.class;
case "byte": return Byte.class;
case "char": return Character.class;
case "short": return Short.class;
case "int": return Integer.class;
case "long": return Long.class;
case "float": return Float.class;
case "double": return Double.class;
case "void": return Void.class;
}
return clazz;
}
public static <T> Method findMethod(String className, String methodName, T... args)
throws ClassNotFoundException, NoSuchMethodException {
return findMethod(loadClass(className), methodName, args);
}
public static <T> Method findMethod(Class<?> clazz, String methodName, T... args)
throws NoSuchMethodException {
Class<?> tmp = clazz;
for (; tmp != null; tmp = tmp.getSuperclass()) {
Method[] methods = tmp.getDeclaredMethods();
for (Method method : methods) {
if (methodName.equals(method.getName()) && equalParams(method, args)) {
return method;
}
}
}
throw new NoSuchElementException(clazz.getName() + "." + methodName + "()");
}
public static boolean equalParams(Method method, Object... params) {
return equalParams(method.getParameterTypes(), params);
}
public static boolean equalParams(Class<?>[] parameterTypes, Object... params) {
if (parameterTypes.length != params.length) {
return false;
}
for (int i = 0; i < parameterTypes.length; i++) {
if (parameterTypes[i].isPrimitive()) {
if (params[i] == null || !loadClass(parameterTypes[i]).equals(params[i].getClass())) {
return false;
}
} else {
if (params[i] != null && !parameterTypes[i].isAssignableFrom(params[i].getClass())) {
return false;
}
}
}
return true;
}
public static boolean equalParams(Method method, Class<?>... types) {
return equalParams(method.getParameterTypes(), types);
}
public static boolean equalParams(Class<?>[] parameterTypes, Class<?>... types) {
if (parameterTypes.length != types.length) {
return false;
}
for (int i = 0; i < parameterTypes.length; i++) {
if (parameterTypes[i].isAssignableFrom(types[i])) {
return false;
}
}
return true;
}
public static <T> Method getMethod(String className, String methodName, T... parameterTypes)
throws ClassNotFoundException, NoSuchMethodException {
return getMethod(loadClass(className), methodName, getClassType(parameterTypes));
}
public static Method getMethod(String className, String methodName, Class<?>... parameterTypes)
throws ClassNotFoundException, NoSuchMethodException {
return getMethod(loadClass(className), methodName, parameterTypes);
}
public static <T> Method getMethod(Class<?> clazz, String methodName, T... parameterTypes)
throws ClassNotFoundException, NoSuchMethodException {
return getMethod(clazz, methodName, getClassType(parameterTypes));
}
public static Method getMethod(Class<?> clazz, String methodName, Class<?>... parameterTypes)
throws NoSuchMethodException {
NoSuchMethodException exception = null;
for (; clazz != null; clazz = clazz.getSuperclass()) {
try {
Method method = clazz.getDeclaredMethod(methodName, parameterTypes);
if (!method.isAccessible()) {
method.setAccessible(true);
}
return method;
} catch (NoSuchMethodException e) {
if (exception == null) {
exception = e;
}
}
}
throw exception;
}
public static Object invoke(String className, String methodName)
throws InvocationTargetException, IllegalAccessException, ClassNotFoundException, NoSuchMethodException {
return getMethod(loadClass(className), methodName).invoke(null);
}
public static Object invoke(Class<?> clazz, String methodName)
throws InvocationTargetException, IllegalAccessException, ClassNotFoundException, NoSuchMethodException {
return getMethod(clazz, methodName).invoke(null);
}
public static Object invoke(Object object, String methodName)
throws InvocationTargetException, IllegalAccessException, ClassNotFoundException, NoSuchMethodException {
return getMethod(object.getClass(), methodName).invoke(object);
}
public static Object invoke(String className, String methodName, Object... parameterTypesAndParameters)
throws InvocationTargetException, IllegalAccessException, ClassNotFoundException, NoSuchMethodException {
int length = parameterTypesAndParameters.length;
Class<?>[] parameterTypes = getClassType(parameterTypesAndParameters, 0, length >> 1);
Object[] parameters = getParameters(parameterTypesAndParameters, length >> 1, length >> 1);
return getMethod(loadClass(className), methodName, parameterTypes).invoke(null, parameters);
}
public static Object invoke(Class<?> clazz, String methodName, Object... parameterTypesAndParameters)
throws InvocationTargetException, IllegalAccessException, ClassNotFoundException, NoSuchMethodException {
int length = parameterTypesAndParameters.length;
Class<?>[] parameterTypes = getClassType(parameterTypesAndParameters, 0, length >> 1);
Object[] parameters = getParameters(parameterTypesAndParameters, length >> 1, length >> 1);
return getMethod(clazz, methodName, parameterTypes).invoke(null, parameters);
}
public static Object invoke(Object object, String methodName, Object... parameterTypesAndParameters)
throws InvocationTargetException, IllegalAccessException, ClassNotFoundException, NoSuchMethodException {
int length = parameterTypesAndParameters.length;
Class<?>[] parameterTypes = getClassType(parameterTypesAndParameters, 0, length >> 1);
Object[] parameters = getParameters(parameterTypesAndParameters, length >> 1, length >> 1);
return getMethod(object.getClass(), methodName, parameterTypes).invoke(object, parameters);
}
public static <T> Constructor<?> getConstructor(String className, Object... parameterTypes)
throws ClassNotFoundException, NoSuchMethodException {
return getConstructor(loadClass(className), getClassType(parameterTypes));
}
public static Constructor<?> getConstructor(String className, Class<?>... parameterTypes)
throws ClassNotFoundException, NoSuchMethodException {
return getConstructor(loadClass(className), parameterTypes);
}
public static <T> Constructor<?> getConstructor(Class<?> clazz, T... parameterTypes)
throws ClassNotFoundException, NoSuchMethodException {
return getConstructor(clazz, getClassType(parameterTypes));
}
public static Constructor<?> getConstructor(Class<?> clazz, Class<?>... parameterTypes)
throws ClassNotFoundException, NoSuchMethodException {
Constructor constructor = clazz.getConstructor(parameterTypes);
if (!constructor.isAccessible()) {
constructor.setAccessible(true);
}
return constructor;
}
public static Object newInstance(String className)
throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException,
InvocationTargetException, InstantiationException {
return getConstructor(loadClass(className)).newInstance();
}
public static Object newInstance(Class clazz)
throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException,
InvocationTargetException, InstantiationException {
return getConstructor(clazz).newInstance();
}
public static Object newInstance(String className, Object... parameterTypesAndParameters)
throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException,
InvocationTargetException, InstantiationException {
int length = parameterTypesAndParameters.length;
Class<?>[] parameterTypes = getClassType(parameterTypesAndParameters, 0, length >> 1);
Object[] parameters = getParameters(parameterTypesAndParameters, length >> 1, length >> 1);
return getConstructor(loadClass(className), parameterTypes).newInstance(parameters);
}
public static Object newInstance(Class clazz, Object... parameterTypesAndParameters)
throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException,
InvocationTargetException, InstantiationException {
int length = parameterTypesAndParameters.length;
Class<?>[] parameterTypes = getClassType(parameterTypesAndParameters, 0, length >> 1);
Object[] parameters = getParameters(parameterTypesAndParameters, length >> 1, length >> 1);
return getConstructor(clazz, parameterTypes).newInstance(parameters);
}
private static <T> Class<?>[] getClassType(T... parameterTypes)
throws ClassNotFoundException {
Class<?>[] type = new Class[parameterTypes != null ? parameterTypes.length : 0];
for (int i = 0; i < type.length; i++) {
if (parameterTypes[i] instanceof Class<?>) {
type[i] = (Class<?>) parameterTypes[i];
} else if (parameterTypes[i] instanceof String) {
type[i] = loadClass((String) parameterTypes[i]);
} else {
type[i] = parameterTypes[i].getClass();
}
}
return type;
}
private static Class<?>[] getClassType(Object[] parameterTypes, int offset, int length)
throws ClassNotFoundException {
Class<?>[] type = new Class[length];
for (int i = offset; i < offset + length; i++) {
if (parameterTypes[i] instanceof Class<?>) {
type[i] = (Class<?>) parameterTypes[i];
} else if (parameterTypes[i] instanceof String) {
type[i] = loadClass((String) parameterTypes[i]);
} else {
type[i] = parameterTypes[i].getClass();
}
}
return type;
}
private static Object[] getParameters(Object[] parameters, int offset, int length)
throws ClassNotFoundException {
Object[] params = new Object[length];
System.arraycopy(parameters, offset, params, 0, length);
return params;
}
public static Field getField(Object object, String fieldName)
throws NoSuchFieldException {
return getField(object.getClass(), fieldName);
}
public static Field getField(Class<?> clazz, String fieldName)
throws NoSuchFieldException {
NoSuchFieldException exception = null;
for (; clazz != null; clazz = clazz.getSuperclass()) {
try {
Field field = clazz.getDeclaredField(fieldName);
if (!field.isAccessible()) {
field.setAccessible(true);
}
return field;
} catch (NoSuchFieldException e) {
if (exception == null) {
exception = e;
}
}
}
throw exception;
}
public static Object get(String className, String fieldName)
throws ClassNotFoundException, NoSuchFieldException, IllegalAccessException {
return getField(loadClass(className), fieldName).get(null);
}
public static Object get(Class<?> clazz, String fieldName)
throws NoSuchFieldException, IllegalAccessException {
return getField(clazz, fieldName).get(null);
}
public static Object get(Object object, String fieldName)
throws NoSuchFieldException, IllegalAccessException {
return getField(object.getClass(), fieldName).get(object);
}
public static void set(String className, String fieldName, Object value)
throws NoSuchFieldException, IllegalAccessException, ClassNotFoundException {
getField(loadClass(className), fieldName).set(null, value);
}
public static void set(Class<?> clazz, String fieldName, Object value)
throws NoSuchFieldException, IllegalAccessException {
getField(clazz, fieldName).set(null, value);
}
public static void set(Object object, String fieldName, Object value)
throws NoSuchFieldException, IllegalAccessException {
getField(object.getClass(), fieldName).set(object, value);
}
public static boolean getBoolean(String className, String fieldName)
throws ClassNotFoundException, NoSuchFieldException, IllegalAccessException {
return getField(loadClass(className), fieldName).getBoolean(null);
}
public static boolean getBoolean(Class<?> clazz, String fieldName)
throws NoSuchFieldException, IllegalAccessException {
return getField(clazz, fieldName).getBoolean(null);
}
public static boolean getBoolean(Object object, String fieldName)
throws NoSuchFieldException, IllegalAccessException {
return getField(object.getClass(), fieldName).getBoolean(object);
}
public static void setBoolean(String className, String fieldName, boolean value)
throws NoSuchFieldException, IllegalAccessException, ClassNotFoundException {
getField(loadClass(className), fieldName).setBoolean(null, value);
}
public static void setBoolean(Class<?> clazz, String fieldName, boolean value)
throws NoSuchFieldException, IllegalAccessException {
getField(clazz, fieldName).setBoolean(null, value);
}
public static void setBoolean(Object object, String fieldName, boolean value)
throws NoSuchFieldException, IllegalAccessException {
getField(object.getClass(), fieldName).setBoolean(object, value);
}
public static byte getByte(String className, String fieldName)
throws ClassNotFoundException, NoSuchFieldException, IllegalAccessException {
return getField(loadClass(className), fieldName).getByte(null);
}
public static byte getByten(Class<?> clazz, String fieldName)
throws NoSuchFieldException, IllegalAccessException {
return getField(clazz, fieldName).getByte(null);
}
public static byte getByte(Object object, String fieldName)
throws NoSuchFieldException, IllegalAccessException {
return getField(object.getClass(), fieldName).getByte(object);
}
public static void setBoolean(String className, String fieldName, byte value)
throws NoSuchFieldException, IllegalAccessException, ClassNotFoundException {
getField(loadClass(className), fieldName).setByte(null, value);
}
public static void setBoolean(Class<?> clazz, String fieldName, byte value)
throws NoSuchFieldException, IllegalAccessException {
getField(clazz, fieldName).setByte(null, value);
}
public static void setByte(Object object, String fieldName, byte value)
throws NoSuchFieldException, IllegalAccessException {
getField(object.getClass(), fieldName).setByte(object, value);
}
public static char getChar(String className, String fieldName)
throws ClassNotFoundException, NoSuchFieldException, IllegalAccessException {
return getField(loadClass(className), fieldName).getChar(null);
}
public static char getChar(Class<?> clazz, String fieldName)
throws NoSuchFieldException, IllegalAccessException {
return getField(clazz, fieldName).getChar(null);
}
public static char getChar(Object object, String fieldName)
throws NoSuchFieldException, IllegalAccessException {
return getField(object.getClass(), fieldName).getChar(object);
}
public static void setBoolean(String className, String fieldName, char value)
throws NoSuchFieldException, IllegalAccessException, ClassNotFoundException {
getField(loadClass(className), fieldName).setChar(null, value);
}
public static void setBoolean(Class<?> clazz, String fieldName, char value)
throws NoSuchFieldException, IllegalAccessException {
getField(clazz, fieldName).setChar(null, value);
}
public static void setChar(Object object, String fieldName, char value)
throws NoSuchFieldException, IllegalAccessException {
getField(object.getClass(), fieldName).setChar(object, value);
}
public static short getShort(String className, String fieldName)
throws ClassNotFoundException, NoSuchFieldException, IllegalAccessException {
return getField(loadClass(className), fieldName).getShort(null);
}
public static short getShort(Class<?> clazz, String fieldName)
throws NoSuchFieldException, IllegalAccessException {
return getField(clazz, fieldName).getShort(null);
}
public static short getShort(Object object, String fieldName)
throws NoSuchFieldException, IllegalAccessException {
return getField(object.getClass(), fieldName).getShort(object);
}
public static void setShort(String className, String fieldName, short value)
throws NoSuchFieldException, IllegalAccessException, ClassNotFoundException {
getField(loadClass(className), fieldName).setShort(null, value);
}
public static void setShort(Class<?> clazz, String fieldName, short value)
throws NoSuchFieldException, IllegalAccessException {
getField(clazz, fieldName).setShort(null, value);
}
public static void setShort(Object object, String fieldName, short value)
throws NoSuchFieldException, IllegalAccessException {
getField(object.getClass(), fieldName).setShort(object, value);
}
public static int getInt(String className, String fieldName)
throws ClassNotFoundException, NoSuchFieldException, IllegalAccessException {
return getField(loadClass(className), fieldName).getInt(null);
}
public static int getInt(Class<?> clazz, String fieldName)
throws NoSuchFieldException, IllegalAccessException {
return getField(clazz, fieldName).getInt(null);
}
public static int getInt(Object object, String fieldName)
throws NoSuchFieldException, IllegalAccessException {
return getField(object.getClass(), fieldName).getInt(object);
}
public static void setInt(String className, String fieldName, int value)
throws NoSuchFieldException, IllegalAccessException, ClassNotFoundException {
getField(loadClass(className), fieldName).setInt(null, value);
}
public static void setInt(Class<?> clazz, String fieldName, int value)
throws NoSuchFieldException, IllegalAccessException {
getField(clazz, fieldName).setInt(null, value);
}
public static void setInt(Object object, String fieldName, int value)
throws NoSuchFieldException, IllegalAccessException {
getField(object.getClass(), fieldName).setInt(object, value);
}
public static long getLong(String className, String fieldName)
throws ClassNotFoundException, NoSuchFieldException, IllegalAccessException {
return getField(loadClass(className), fieldName).getLong(null);
}
public static long getLong(Class<?> clazz, String fieldName)
throws NoSuchFieldException, IllegalAccessException {
return getField(clazz, fieldName).getLong(null);
}
public static long getLong(Object object, String fieldName)
throws NoSuchFieldException, IllegalAccessException {
return getField(object.getClass(), fieldName).getLong(object);
}
public static void setLong(String className, String fieldName, long value)
throws NoSuchFieldException, IllegalAccessException, ClassNotFoundException {
getField(loadClass(className), fieldName).setLong(null, value);
}
public static void setLong(Class<?> clazz, String fieldName, long value)
throws NoSuchFieldException, IllegalAccessException {
getField(clazz, fieldName).setLong(null, value);
}
public static void setLong(Object object, String fieldName, long value)
throws NoSuchFieldException, IllegalAccessException {
getField(object.getClass(), fieldName).setLong(object, value);
}
public static float getFloat(String className, String fieldName)
throws ClassNotFoundException, NoSuchFieldException, IllegalAccessException {
return getField(loadClass(className), fieldName).getFloat(null);
}
public static float getFloat(Class<?> clazz, String fieldName)
throws NoSuchFieldException, IllegalAccessException {
return getField(clazz, fieldName).getFloat(null);
}
public static float getFloat(Object object, String fieldName)
throws NoSuchFieldException, IllegalAccessException {
return getField(object.getClass(), fieldName).getFloat(object);
}
public static void setFloat(String className, String fieldName, float value)
throws NoSuchFieldException, IllegalAccessException, ClassNotFoundException {
getField(loadClass(className), fieldName).setFloat(null, value);
}
public static void setFloat(Class<?> clazz, String fieldName, float value)
throws NoSuchFieldException, IllegalAccessException {
getField(clazz, fieldName).setFloat(null, value);
}
public static void setFloat(Object object, String fieldName, float value)
throws NoSuchFieldException, IllegalAccessException {
getField(object.getClass(), fieldName).setFloat(object, value);
}
public static double getDouble(String className, String fieldName)
throws ClassNotFoundException, NoSuchFieldException, IllegalAccessException {
return getField(loadClass(className), fieldName).getDouble(null);
}
public static double getDouble(Class<?> clazz, String fieldName)
throws NoSuchFieldException, IllegalAccessException {
return getField(clazz, fieldName).getDouble(null);
}
public static double getDouble(Object object, String fieldName)
throws NoSuchFieldException, IllegalAccessException {
return getField(object.getClass(), fieldName).getDouble(object);
}
public static void setDouble(String className, String fieldName, double value)
throws NoSuchFieldException, IllegalAccessException, ClassNotFoundException {
getField(loadClass(className), fieldName).setDouble(null, value);
}
public static void setDouble(Class<?> clazz, String fieldName, double value)
throws NoSuchFieldException, IllegalAccessException {
getField(clazz, fieldName).setDouble(null, value);
}
public static void setDouble(Object object, String fieldName, double value)
throws NoSuchFieldException, IllegalAccessException {
getField(object.getClass(), fieldName).setDouble(object, value);
}
}
| [
"669898595@qq.com"
] | 669898595@qq.com |
5bc555cd549ee397cc58a3e313435e247d52102b | 648c1ff7e38ea98b93d9dc33c1a8c0f43f50d8e5 | /src/main/java/action/ProfileActionFactory.java | 9e0c6bbc71f51a725338e542edbb4b06244b5556 | [] | no_license | executed/nano-medical-ss | c588d565cb10cc7150660d9bf23c50e105abb4f2 | fc29ed7ca3998bee5d30adf896e6ef943b060a93 | refs/heads/master | 2021-12-24T23:40:11.152388 | 2018-11-23T20:44:11 | 2018-11-23T20:44:11 | 166,433,581 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 762 | java | package action;
import dto.ClientProfileInputDTO;
import dto.DoctorProfileInputDTO;
import dto.UserProfileInputDTO;
import entity.Client;
import entity.Doctor;
import entity.IUser;
import javax.servlet.http.HttpServletRequest;
public class ProfileActionFactory {
public UserProfileInputDTO resolveInputDTO(HttpServletRequest request){
IUser user = (IUser) request.getSession().getAttribute("user");
String userTypeName = user.getClassName();
if (userTypeName.equals(Client.class.getName())){
return new ClientProfileInputDTO(request);
}
if (userTypeName.equals(Doctor.class.getName())){
return new DoctorProfileInputDTO(request);
}
return null; //if type not found
}
}
| [
"denis.serbyn@gmail.com"
] | denis.serbyn@gmail.com |
3898aa020387daad70603b245b023f5f576b8cf5 | a697c984c33afa66ef7a9a5c61f03de59ce63f36 | /security-app/src/main/java/lab/zlren/security/app/SpringSocialConfigurerPostProcessor.java | b5ae7ddeb708b5958a5e59825cc3129fc124c030 | [] | no_license | zlren/SpringSecurity | a4b5b3cd384bc11a9b165b531ec17cbb70207d73 | f2c5e0b506f2c99979ba3ff1a2cb3508fe561d37 | refs/heads/master | 2021-07-21T12:21:20.056112 | 2017-10-30T14:42:35 | 2017-10-30T14:42:35 | 106,522,942 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,295 | java | package lab.zlren.security.app;
import lab.zlren.security.core.social.qq.MySpringSocialConfigurer;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.stereotype.Component;
/**
* 在app环境下,社交账号首次登录以后不要跳转到注册页面
* 在Spring容器里面在所有的bean初始化之前和之后调用
*
* @author zlren
* @date 17/10/25
*/
@Component
public class SpringSocialConfigurerPostProcessor implements BeanPostProcessor {
@Override
public Object postProcessBeforeInitialization(Object o, String s) throws BeansException {
return o;
}
/**
* 修改配置
*
* @param bean
* @param beanName
* @return
* @throws BeansException
*/
@Override
public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
if (StringUtils.equals("mySpringSocialConfig", beanName)) {
MySpringSocialConfigurer mySpringSocialConfigurer = (MySpringSocialConfigurer) bean;
mySpringSocialConfigurer.signupUrl("/social/signup");
return mySpringSocialConfigurer;
}
return bean;
}
}
| [
"zlren2012@163.com"
] | zlren2012@163.com |
faed2332b9a49062468790ec6936acafb180b693 | 6d83845b420462c48dcf21caf9130cb4f1840d5c | /ui/src/test/java/com/stanfy/enroscar/fragments/ListLoaderFragmentTest.java | 40dfefb52c5ded5ce6b28dbd65490d3098abc033 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | mkodekar/enroscar | cba14369cd698de59cbe9097935a18f908bf501f | d7085d6eb5906db0cbe6f3748531c3b1c903e549 | refs/heads/master | 2020-12-11T05:28:45.298750 | 2015-09-29T06:12:42 | 2015-09-29T06:12:42 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,750 | java | package com.stanfy.enroscar.fragments;
import android.content.Context;
import android.os.Build;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.support.v4.content.Loader;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.stanfy.enroscar.content.loader.ResponseData;
import com.stanfy.enroscar.views.list.adapter.RendererBasedAdapter;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.Robolectric;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.annotation.Config;
import java.util.Arrays;
import java.util.List;
import static org.assertj.core.api.Assertions.assertThat;
@RunWith(RobolectricTestRunner.class)
@Config(emulateSdk = Build.VERSION_CODES.JELLY_BEAN_MR2)
public class ListLoaderFragmentTest {
/** Test loader ID. */
private static final int LOADER_ID = 100;
/** Fragment under the test. */
private ListLoaderFragment<String, List<String>> fragment;
/** Items adapter. */
private RendererBasedAdapter<String> adapter;
/** Last used loader ID. */
private int lastUserLoaderId;
/** Method call flag. */
private boolean createViewCalled, modifyLoaderCalled;
@Before
public void init() {
createViewCalled = false;
adapter = new RendererBasedAdapter<String>(Robolectric.application, null) {
@Override
public long getItemId(final int position) {
return position;
}
};
fragment = new ListLoaderFragment<String, List<String>>() {
@Override
protected Loader<ResponseData<List<String>>> createLoader() {
return new ListLoader(Robolectric.application);
}
@Override
protected RendererBasedAdapter<String> createAdapter() {
return adapter;
}
@Override
public Loader<ResponseData<List<String>>> onCreateLoader(final int id, final Bundle bundle) {
lastUserLoaderId = id;
return super.onCreateLoader(id, bundle);
}
@Override
protected View createView(final LayoutInflater inflater, final ViewGroup container, final Bundle savedInstanceState) {
createViewCalled = true;
return super.createView(inflater, container, savedInstanceState);
}
@Override
protected Loader<ResponseData<List<String>>> modifyLoader(final Loader<ResponseData<List<String>>> loader) {
modifyLoaderCalled = true;
return super.modifyLoader(loader);
}
};
fragment.setLoaderId(LOADER_ID);
FragmentActivity activity = Robolectric.buildActivity(FragmentActivity.class).attach().create().start().get();
activity.getSupportFragmentManager().beginTransaction()
.add(android.R.id.content, fragment)
.commit();
}
@Test
public void shouldUseDefinedLoaderId() {
fragment.startLoad();
assertThat(lastUserLoaderId).isEqualTo(LOADER_ID).isEqualTo(fragment.getLoaderId());
}
@Test
public void shouldProvideCoreAdapter() {
assertThat(fragment.getCoreAdapter()).isSameAs(adapter);
}
@Test
public void shouldProvideLoaderAdapter() {
assertThat(fragment.getAdapter()).isNotNull();
}
@Test
public void shouldProvideListView() {
assertThat(fragment.getListView()).isNotNull();
}
@Test
public void shouldDelegateToCreateView() {
assertThat(createViewCalled).isTrue();
}
private static class ListLoader extends Loader<ResponseData<List<String>>> {
public ListLoader(final Context context) {
super(context);
}
@Override
protected void onForceLoad() {
ResponseData<List<String>> data = new ResponseData<>(Arrays.asList("a", "b", "c"));
deliverResult(data);
}
}
} | [
"rivne2@gmail.com"
] | rivne2@gmail.com |
1a275365b6a6a1baf53a58e9eed5352ce22ad1c7 | 96880c093a31644fd6fb556d5367adfd11feb650 | /choerodon-study-service/src/main/java/io/choerodon/exam/app/service/OrganizationService.java | 7efe275eddec273630f4073dbfaaddec0356eed1 | [] | no_license | bgzyy/StudyService | 64edd76631e73fc90741c0257e9baf837feead2d | af949d40cb3ccd8a5d754cc50f4dd6017cfaafe9 | refs/heads/master | 2022-06-24T04:33:22.520501 | 2019-08-03T08:22:55 | 2019-08-03T08:22:55 | 200,348,069 | 0 | 0 | null | 2022-06-21T01:35:42 | 2019-08-03T07:49:00 | Java | UTF-8 | Java | false | false | 400 | java | package io.choerodon.exam.app.service;
import io.choerodon.exam.api.vo.UserResult;
import io.choerodon.exam.infa.dto.OrganizationDTO;
/**
* Created by zhao'yin
* Date 2019/8/3.
*/
public interface OrganizationService {
OrganizationDTO getOrganizationById(Long id);
UserResult getUserResult(Long organizationId, Long id);
void insertOrganization(OrganizationDTO organizationDTO);
} | [
"bg_zyy@foxmial.com"
] | bg_zyy@foxmial.com |
2b13fd9cb269e3b4fe7c92286620507d3505c051 | b90382aea9fd27a7ee8c9d3198c7f6e57ecdad8c | /gmall-api/src/main/java/com/topjia/gmall/pms/service/ProductAttributeService.java | 2965fa65ca1ce654c29b124784adaa9e880431bc | [] | no_license | topjia-vip/gmall | 7a26a78dbd33beb99ce836a5e6b50336dd78827a | 29b1cc2eda939a34dafd3c4a5e887730fcbb5929 | refs/heads/master | 2022-06-22T17:44:54.470948 | 2019-11-24T07:46:15 | 2019-11-24T07:46:15 | 223,708,602 | 0 | 0 | null | 2022-06-21T02:18:06 | 2019-11-24T07:34:43 | Java | UTF-8 | Java | false | false | 331 | java | package com.topjia.gmall.pms.service;
import com.topjia.gmall.pms.entity.ProductAttribute;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 商品属性参数表 服务类
* </p>
*
* @author wjh
* @since 2019-11-24
*/
public interface ProductAttributeService extends IService<ProductAttribute> {
}
| [
"1256957450@qq.com"
] | 1256957450@qq.com |
36ec804d5c1e093c8d9b6afca5bd758062585340 | 6730151ee3d1213d130b606f68fd919360154e29 | /app/src/main/java/com/rd/qnz/tools/MyListView.java | 1c9ccef3b2e8a2e2ec7a85b6fb3ccfad6dbcf0f8 | [] | no_license | z610384064/Qnz | 87c0cf1d443cea068224cb94a136f49a13b2783d | ee080c15ba872abe1190069af2b3554a661d27ff | refs/heads/master | 2020-04-24T08:10:04.413590 | 2019-02-21T08:03:57 | 2019-02-21T08:03:57 | 171,822,530 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 867 | java | package com.rd.qnz.tools;
import android.content.Context;
import android.util.AttributeSet;
import android.widget.ListView;
/**
* 可以嵌套在scrollView里面使用的listview 2017/5/11 0011.
*/
public class MyListView extends ListView {
public MyListView(Context context) {
super(context);
}
public MyListView(Context context, AttributeSet attrs) {
super(context, attrs);
}
public MyListView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
//重新设置高度
heightMeasureSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST);
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
}
} | [
"610384064@qq.com"
] | 610384064@qq.com |
be665eaf82328edc7b7a12034112c24d9b0faa94 | c31b65267327c64f2ef79d015908c8224dd566df | /opencga-storage/opencga-storage-core/src/main/java/org/opencb/opencga/storage/core/variant/adaptors/iterators/DelegatedVariantDBIterator.java | a593a1c2a8c869e7a316f0163da067ddae355c50 | [
"Apache-2.0"
] | permissive | sconeill/opencga | 5676a4a415ff6fd4383a2ad8800264d26598a662 | dad91554c874e14023d7038644d1257d8d5c04f4 | refs/heads/master | 2020-06-26T12:43:00.547022 | 2019-04-04T14:49:23 | 2019-04-04T14:49:23 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,265 | java | package org.opencb.opencga.storage.core.variant.adaptors.iterators;
import org.opencb.biodata.models.variant.Variant;
import org.opencb.commons.datastore.core.QueryResult;
import org.opencb.opencga.core.results.VariantQueryResult;
import java.util.List;
import java.util.Map;
import java.util.function.Consumer;
/**
* Created by jacobo on 28/03/19.
*/
public class DelegatedVariantDBIterator extends VariantDBIterator {
private final VariantDBIterator delegated;
public DelegatedVariantDBIterator(VariantDBIterator delegated) {
this.delegated = delegated;
}
@Override
public VariantDBIterator addCloseable(AutoCloseable closeable) {
return delegated.addCloseable(closeable);
}
@Override
public long getTimeConverting() {
return delegated.getTimeConverting();
}
@Override
public long getTimeFetching() {
return delegated.getTimeFetching();
}
@Override
public int getCount() {
return delegated.getCount();
}
@Override
public boolean hasNext() {
return delegated.hasNext();
}
@Override
public Variant next() {
return delegated.next();
}
@Override
public void forEachRemaining(Consumer<? super Variant> action) {
delegated.forEachRemaining(action);
}
@Override
public QueryResult<Variant> toQueryResult() {
return delegated.toQueryResult();
}
@Override
public VariantQueryResult<Variant> toQueryResult(Map<String, List<String>> samples) {
return delegated.toQueryResult(samples);
}
@Override
protected <R, E extends Exception> R convert(TimeFunction<R, E> converter) throws E {
return delegated.convert(converter);
}
@Override
protected <R, E extends Exception> R fetch(TimeFunction<R, E> fetcher) throws E {
return delegated.fetch(fetcher);
}
@Override
public void close() throws Exception {
delegated.close();
}
@Override
public int hashCode() {
return delegated.hashCode();
}
@Override
public boolean equals(Object obj) {
return delegated.equals(obj);
}
@Override
public String toString() {
return delegated.toString();
}
}
| [
"jacobo167@gmail.com"
] | jacobo167@gmail.com |
da854aaf8279d5a76defd1a156105d286c0d065d | aaa7a630d2bb0036aeb7bbe4891c1e0ec91f449a | /src/designpattern/action/visitor/VisitorImpl.java | 7af8d11e57d230f6326a6b6a9a1dce8638db7344 | [] | no_license | JackyZhangFuDan/DesignPattern | 4b01754ca174d877809594100af74dd928e33991 | ae278a1c53185e5b9c4e3a7d465f754aad52c4d2 | refs/heads/master | 2022-06-28T04:54:54.546140 | 2022-06-12T12:59:04 | 2022-06-12T12:59:04 | 192,246,763 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 355 | java | package designpattern.action.visitor;
public class VisitorImpl implements Visitor {
@Override
public void definition() {
System.out.println("Role: Visitor");
}
@Override
public void visit(Subject subject) {
System.out.println("Visitor starts to deal with subject's data");
System.out.println("Visitor got data: " + subject.getData());
}
}
| [
"jacky01.zhang@outlook.com"
] | jacky01.zhang@outlook.com |
fa8a5c0718a5973bf3ac33c198bda0d2092e0509 | b981805ec07b74f5e7701eb94ea5cc85431c3069 | /spring-security-jpa/src/main/java/com/vikram/bishwajit/springsecurityjpa/Model/User.java | 3be1ffc7a0dfbb3494b786e51e8f566b16982547 | [] | no_license | bishwajit01/spring-security-jwt | 801c041a585a3fbea44708dec3c643e32827614a | e25671b902c448a3e2b4b6a1ade49e5a87affc18 | refs/heads/master | 2022-04-27T13:13:45.624541 | 2020-04-27T13:40:47 | 2020-04-27T13:40:47 | 255,799,186 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,614 | java | package com.vikram.bishwajit.springsecurityjpa.Model;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
/**
* @author Bishwajit.
*
*/
@Entity
@Table(name = "USER_DETAILS")
public class User {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private int id;
@Column(name = "USER_NAME")
private String userName;
@Column(name = "PASSWORD")
private String password;
@Column(name = "ACTIVE")
private boolean active;
@Column(name = "ROLES")
private String roles;
/**
* @return the id
*/
public int getId() {
return id;
}
/**
* @param id the id to set
*/
public void setId(int id) {
this.id = id;
}
/**
* @return the userName
*/
public String getUserName() {
return userName;
}
/**
* @param userName the userName to set
*/
public void setUserName(String userName) {
this.userName = userName;
}
/**
* @return the password
*/
public String getPassword() {
return password;
}
/**
* @param password the password to set
*/
public void setPassword(String password) {
this.password = password;
}
/**
* @return the roles
*/
public String getRoles() {
return roles;
}
/**
* @param roles the roles to set
*/
public void setRoles(String roles) {
this.roles = roles;
}
/**
* @return the active
*/
public boolean isActive() {
return active;
}
/**
* @param active the active to set
*/
public void setActive(boolean active) {
this.active = active;
}
}
| [
"bishwajit.vikram@gmail.com"
] | bishwajit.vikram@gmail.com |
495ae89f7e47a12110d7e03a95092412d5894d5d | f5d9efea9161401fdc561d97a0972645e52f67dd | /SpringBootDemo/src/main/java/com/yuyuda/service/impl/UserServiceImpl.java | 1b998ed2171b0a70578e69fae33dd00b618665bd | [] | no_license | yuyudaedu/spring-test | d6b1b498fa04237304068e3b728a303570ac7e01 | 94c95ef0cae00c96ed7de74bf777757c476c1b8e | refs/heads/master | 2020-04-04T17:49:22.200525 | 2019-01-05T10:15:50 | 2019-01-05T10:15:50 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 741 | java | package com.yuyuda.service.impl;
import com.yuyuda.mapper.UserMapper;
import com.yuyuda.pojo.User;
import com.yuyuda.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
@Service
@Transactional
public class UserServiceImpl implements UserService {
@Autowired
private UserMapper userMapper;
@Override
@Cacheable(value = "findAll")
public List<User> findAll() {
System.out.println("没有打印,则走缓存");
List<User> list = userMapper.findAll();
return list;
}
}
| [
"lzx123163@gmail.com"
] | lzx123163@gmail.com |
5fde5f790ef3d27a8d102be33ea19cbe3c264dc4 | d053ed8b16de314101644335fce960633e3a8dda | /Nutmeg/src/com/tutorial/nutmeg/Game.java | 37d94bb1f5114f66dc7e34803f1862bc9b57c369 | [] | no_license | rpagyc/Nutmeg-part-1 | c0c1434b8e0702b97b467ba87c9258d1f1313dd1 | 920343e33a9e0aa6bf78b113c64a9d0b3d0db387 | refs/heads/master | 2021-01-20T07:51:01.138369 | 2013-12-02T12:03:23 | 2013-12-02T12:03:23 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 171 | java | package com.tutorial.nutmeg;
import org.flixel.FlxGame;
public class Game extends FlxGame
{
public Game()
{
super(320, 240, PlayState.class, 2, 50, 50, false);
}
}
| [
"rpagyc@gmail.com"
] | rpagyc@gmail.com |
74e6a47673ce08f6c272a66f52eb602228611466 | 464f36e710b08f67dcf833139c3c233b7eeb7837 | /libCompiler/src/test/java/com/duy/pascal/lexer/NumberTest.java | 2c6e8fc9e0bc6d4e30e39e8cad4cca45e4102bb0 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | Traider09/pascalnide | 887fe92b58281dbfedd623ac72b6252657998baa | fbd0407392de7bbc7856b37f619b24c5d22bfe24 | refs/heads/master | 2020-12-02T16:41:46.153868 | 2017-06-29T07:42:46 | 2017-06-29T07:42:46 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 884 | java | /*
* Copyright (c) 2017 Tran Le Duy
*
* 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.duy.pascal.lexer;
/**
* Created by Duy on 12-Jun-17.
*/
public class NumberTest extends BaseLexerTest {
@Override
public String getDirTest() {
return "test_lexer";
}
public void test() {
assertTrue(parse("parse_number.pas"));
}
}
| [
"tranleduy1233@gmail.com"
] | tranleduy1233@gmail.com |
c0f8584e31629b1a94afdacd2a36ef44390efa78 | dfa8d3e26e66f0cb6d55199321786080a2867dd2 | /transaction-client/datasource/src/main/java/com/jef/transaction/datasource/datasource/DataCompareUtils.java | e83d2d7382230a4389ba168b9ad2d4a91faddff6 | [] | no_license | s1991721/cloud_transaction | e61b2eae4a283bf772b56c646f2d897215eb5dec | 015507cd87b5ba95905e7fefeb462be94c4660c4 | refs/heads/main | 2023-08-04T01:41:02.147299 | 2021-09-10T08:01:53 | 2021-09-10T08:01:53 | 401,238,251 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,333 | java | /*
* Copyright 1999-2019 Seata.io Group.
*
* 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.jef.transaction.datasource.datasource;
import com.jef.transaction.common.util.CollectionUtils;
import com.jef.transaction.common.util.StringUtils;
import com.jef.transaction.core.model.Result;
import com.jef.transaction.datasource.datasource.sql.struct.Field;
import com.jef.transaction.datasource.datasource.sql.struct.Row;
import com.jef.transaction.datasource.datasource.sql.struct.TableMeta;
import com.jef.transaction.datasource.datasource.sql.struct.TableRecords;
import com.jef.transaction.datasource.datasource.undo.AbstractUndoLogManager;
import com.jef.transaction.datasource.datasource.undo.parser.FastjsonUndoLogParser;
import java.math.BigDecimal;
import java.sql.Timestamp;
import java.sql.Types;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.HashMap;
import java.util.Comparator;
import java.util.stream.Collectors;
/**
* The type Data compare utils.
*
* @author Geng Zhang
*/
public class DataCompareUtils {
private DataCompareUtils() {
}
/**
* Is field equals result.
*
* @param f0 the f 0
* @param f1 the f 1
* @return the result
*/
public static Result<Boolean> isFieldEquals(Field f0, Field f1) {
if (f0 == null) {
return Result.build(f1 == null);
} else {
if (f1 == null) {
return Result.build(false);
} else {
if (StringUtils.equalsIgnoreCase(f0.getName(), f1.getName())
&& f0.getType() == f1.getType()) {
if (f0.getValue() == null) {
return Result.build(f1.getValue() == null);
} else {
if (f1.getValue() == null) {
return Result.buildWithParams(false, "Field not equals, name {}, new value is null", f0.getName());
} else {
String currentSerializer = AbstractUndoLogManager.getCurrentSerializer();
if (StringUtils.equals(currentSerializer, FastjsonUndoLogParser.NAME)) {
convertType(f0, f1);
}
boolean result = Objects.deepEquals(f0.getValue(), f1.getValue());
if (result) {
return Result.ok();
} else {
return Result.buildWithParams(false, "Field not equals, name {}, old value {}, new value {}", f0.getName(), f0.getValue(), f1.getValue());
}
}
}
} else {
return Result.buildWithParams(false, "Field not equals, old name {} type {}, new name {} type {}", f0.getName(), f0.getType(), f1.getName(), f1.getType());
}
}
}
}
private static void convertType(Field f0, Field f1) {
int f0Type = f0.getType();
int f1Type = f1.getType();
if (f0Type == Types.TIMESTAMP && f0.getValue().getClass().equals(String.class)) {
f0.setValue(Timestamp.valueOf(f0.getValue().toString()));
}
if (f1Type == Types.TIMESTAMP && f1.getValue().getClass().equals(String.class)) {
f1.setValue(Timestamp.valueOf(f1.getValue().toString()));
}
if (f0Type == Types.DECIMAL && f0.getValue().getClass().equals(Integer.class)) {
f0.setValue(new BigDecimal(f0.getValue().toString()));
}
if (f1Type == Types.DECIMAL && f1.getValue().getClass().equals(Integer.class)) {
f1.setValue(new BigDecimal(f1.getValue().toString()));
}
if (f0Type == Types.BIGINT && f0.getValue().getClass().equals(Integer.class)) {
f0.setValue(Long.parseLong(f0.getValue().toString()));
}
if (f1Type == Types.BIGINT && f1.getValue().getClass().equals(Integer.class)) {
f1.setValue(Long.parseLong(f1.getValue().toString()));
}
}
/**
* Is records equals result.
*
* @param beforeImage the before image
* @param afterImage the after image
* @return the result
*/
public static Result<Boolean> isRecordsEquals(TableRecords beforeImage, TableRecords afterImage) {
if (beforeImage == null) {
return Result.build(afterImage == null, null);
} else {
if (afterImage == null) {
return Result.build(false, null);
}
if (beforeImage.getTableName().equalsIgnoreCase(afterImage.getTableName())
&& CollectionUtils.isSizeEquals(beforeImage.getRows(), afterImage.getRows())) {
//when image is EmptyTableRecords, getTableMeta will throw an exception
if (CollectionUtils.isEmpty(beforeImage.getRows())) {
return Result.ok();
}
return compareRows(beforeImage.getTableMeta(), beforeImage.getRows(), afterImage.getRows());
} else {
return Result.build(false, null);
}
}
}
/**
* Is rows equals result.
*
* @param tableMetaData the table meta data
* @param oldRows the old rows
* @param newRows the new rows
* @return the result
*/
public static Result<Boolean> isRowsEquals(TableMeta tableMetaData, List<Row> oldRows, List<Row> newRows) {
if (!CollectionUtils.isSizeEquals(oldRows, newRows)) {
return Result.build(false, null);
}
return compareRows(tableMetaData, oldRows, newRows);
}
private static Result<Boolean> compareRows(TableMeta tableMetaData, List<Row> oldRows, List<Row> newRows) {
// old row to map
Map<String, Map<String, Field>> oldRowsMap = rowListToMap(oldRows, tableMetaData.getPrimaryKeyOnlyName());
// new row to map
Map<String, Map<String, Field>> newRowsMap = rowListToMap(newRows, tableMetaData.getPrimaryKeyOnlyName());
// compare data
for (Map.Entry<String, Map<String, Field>> oldEntry : oldRowsMap.entrySet()) {
String key = oldEntry.getKey();
Map<String, Field> oldRow = oldEntry.getValue();
Map<String, Field> newRow = newRowsMap.get(key);
if (newRow == null) {
return Result.buildWithParams(false, "compare row failed, rowKey {}, reason [newRow is null]", key);
}
for (Map.Entry<String, Field> oldRowEntry : oldRow.entrySet()) {
String fieldName = oldRowEntry.getKey();
Field oldField = oldRowEntry.getValue();
Field newField = newRow.get(fieldName);
if (newField == null) {
return Result.buildWithParams(false, "compare row failed, rowKey {}, fieldName {}, reason [newField is null]", key, fieldName);
}
Result<Boolean> oldEqualsNewFieldResult = isFieldEquals(oldField, newField);
if (!oldEqualsNewFieldResult.getResult()) {
return oldEqualsNewFieldResult;
}
}
}
return Result.ok();
}
/**
* Row list to map map.
*
* @param rowList the row list
* @param primaryKeyList the primary key list
* @return the map
*/
public static Map<String, Map<String, Field>> rowListToMap(List<Row> rowList, List<String> primaryKeyList) {
// {value of primaryKey, value of all columns}
Map<String, Map<String, Field>> rowMap = new HashMap<>();
for (Row row : rowList) {
//ensure the order of column
List<Field> rowFieldList = row.getFields().stream()
.sorted(Comparator.comparing(Field::getName))
.collect(Collectors.toList());
// {uppercase fieldName : field}
Map<String, Field> colsMap = new HashMap<>();
StringBuilder rowKey = new StringBuilder();
boolean firstUnderline = false;
for (int j = 0; j < rowFieldList.size(); j++) {
Field field = rowFieldList.get(j);
if (primaryKeyList.stream().anyMatch(e -> field.getName().equals(e))) {
if (firstUnderline && j > 0) {
rowKey.append("_");
}
rowKey.append(String.valueOf(field.getValue()));
firstUnderline = true;
}
colsMap.put(field.getName().trim().toUpperCase(), field);
}
rowMap.put(rowKey.toString(), colsMap);
}
return rowMap;
}
}
| [
"278971585@qq.com"
] | 278971585@qq.com |
801fb5dc561dadea851a7d33a108cb3a10d2128d | b5bf19be663a1038bd02a37f864d94af64830493 | /FtcRobotController/app/src/main/java/com/ftdi/j2xx/interfaces/SpiSlave.java | 004c55e64a1826cd748786916a0961676e01f629 | [] | no_license | rgatkinson/Information | 0bc60277e8b37acd6e3e27e2d75d0facc49aebe8 | e2c8beba09201cc106ed07fe956bf074f403611c | refs/heads/master | 2021-01-10T05:09:47.016720 | 2017-03-27T22:46:35 | 2017-03-27T22:46:35 | 43,043,971 | 0 | 4 | null | 2015-10-14T19:14:08 | 2015-09-24T04:04:49 | Java | UTF-8 | Java | false | false | 242 | java | package com.ftdi.j2xx.interfaces;
public interface SpiSlave {
int getRxStatus(int[] var1);
int init();
int read(byte[] var1, int var2, int[] var3);
int reset();
int write(byte[] var1, int var2, int[] var3);
}
| [
"bob@theatkinsons.org"
] | bob@theatkinsons.org |
632ba3f65c77812725d4a78b6489755e5785857d | f2623a4700b34b52aad0502356f4f8953296dc09 | /src/test/java/cn/store/repository/CustomAuditEventRepositoryIT.java | 047ebc5bb6282826acb00bb1e1ffb469a96529a5 | [] | no_license | LafeBelief/store | 0f85c3dec0eae3fce5702e26cb2001b8b5ae3f63 | 8b36d73922c7df212268a38c328615d6dd17131f | refs/heads/master | 2022-12-21T10:26:29.733354 | 2019-10-31T07:45:11 | 2019-10-31T07:45:11 | 218,711,090 | 0 | 0 | null | 2022-12-16T04:40:47 | 2019-10-31T07:43:44 | Java | UTF-8 | Java | false | false | 7,587 | java | package cn.store.repository;
import cn.store.StoreApp;
import cn.store.config.Constants;
import cn.store.config.audit.AuditEventConverter;
import cn.store.domain.PersistentAuditEvent;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.actuate.audit.AuditEvent;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.mock.web.MockHttpServletRequest;
import org.springframework.mock.web.MockHttpSession;
import org.springframework.security.web.authentication.WebAuthenticationDetails;
import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpSession;
import java.time.Instant;
import java.time.temporal.ChronoUnit;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static org.assertj.core.api.Assertions.assertThat;
import static cn.store.repository.CustomAuditEventRepository.EVENT_DATA_COLUMN_MAX_LENGTH;
/**
* Integration tests for {@link CustomAuditEventRepository}.
*/
@SpringBootTest(classes = StoreApp.class)
@Transactional
public class CustomAuditEventRepositoryIT {
@Autowired
private PersistenceAuditEventRepository persistenceAuditEventRepository;
@Autowired
private AuditEventConverter auditEventConverter;
private CustomAuditEventRepository customAuditEventRepository;
private PersistentAuditEvent testUserEvent;
private PersistentAuditEvent testOtherUserEvent;
private PersistentAuditEvent testOldUserEvent;
@BeforeEach
public void setup() {
customAuditEventRepository = new CustomAuditEventRepository(persistenceAuditEventRepository, auditEventConverter);
persistenceAuditEventRepository.deleteAll();
Instant oneHourAgo = Instant.now().minusSeconds(3600);
testUserEvent = new PersistentAuditEvent();
testUserEvent.setPrincipal("test-user");
testUserEvent.setAuditEventType("test-type");
testUserEvent.setAuditEventDate(oneHourAgo);
Map<String, String> data = new HashMap<>();
data.put("test-key", "test-value");
testUserEvent.setData(data);
testOldUserEvent = new PersistentAuditEvent();
testOldUserEvent.setPrincipal("test-user");
testOldUserEvent.setAuditEventType("test-type");
testOldUserEvent.setAuditEventDate(oneHourAgo.minusSeconds(10000));
testOtherUserEvent = new PersistentAuditEvent();
testOtherUserEvent.setPrincipal("other-test-user");
testOtherUserEvent.setAuditEventType("test-type");
testOtherUserEvent.setAuditEventDate(oneHourAgo);
}
@Test
public void addAuditEvent() {
Map<String, Object> data = new HashMap<>();
data.put("test-key", "test-value");
AuditEvent event = new AuditEvent("test-user", "test-type", data);
customAuditEventRepository.add(event);
List<PersistentAuditEvent> persistentAuditEvents = persistenceAuditEventRepository.findAll();
assertThat(persistentAuditEvents).hasSize(1);
PersistentAuditEvent persistentAuditEvent = persistentAuditEvents.get(0);
assertThat(persistentAuditEvent.getPrincipal()).isEqualTo(event.getPrincipal());
assertThat(persistentAuditEvent.getAuditEventType()).isEqualTo(event.getType());
assertThat(persistentAuditEvent.getData()).containsKey("test-key");
assertThat(persistentAuditEvent.getData().get("test-key")).isEqualTo("test-value");
assertThat(persistentAuditEvent.getAuditEventDate().truncatedTo(ChronoUnit.MILLIS))
.isEqualTo(event.getTimestamp().truncatedTo(ChronoUnit.MILLIS));
}
@Test
public void addAuditEventTruncateLargeData() {
Map<String, Object> data = new HashMap<>();
StringBuilder largeData = new StringBuilder();
for (int i = 0; i < EVENT_DATA_COLUMN_MAX_LENGTH + 10; i++) {
largeData.append("a");
}
data.put("test-key", largeData);
AuditEvent event = new AuditEvent("test-user", "test-type", data);
customAuditEventRepository.add(event);
List<PersistentAuditEvent> persistentAuditEvents = persistenceAuditEventRepository.findAll();
assertThat(persistentAuditEvents).hasSize(1);
PersistentAuditEvent persistentAuditEvent = persistentAuditEvents.get(0);
assertThat(persistentAuditEvent.getPrincipal()).isEqualTo(event.getPrincipal());
assertThat(persistentAuditEvent.getAuditEventType()).isEqualTo(event.getType());
assertThat(persistentAuditEvent.getData()).containsKey("test-key");
String actualData = persistentAuditEvent.getData().get("test-key");
assertThat(actualData.length()).isEqualTo(EVENT_DATA_COLUMN_MAX_LENGTH);
assertThat(actualData).isSubstringOf(largeData);
assertThat(persistentAuditEvent.getAuditEventDate().truncatedTo(ChronoUnit.MILLIS))
.isEqualTo(event.getTimestamp().truncatedTo(ChronoUnit.MILLIS));
}
@Test
public void testAddEventWithWebAuthenticationDetails() {
HttpSession session = new MockHttpSession(null, "test-session-id");
MockHttpServletRequest request = new MockHttpServletRequest();
request.setSession(session);
request.setRemoteAddr("1.2.3.4");
WebAuthenticationDetails details = new WebAuthenticationDetails(request);
Map<String, Object> data = new HashMap<>();
data.put("test-key", details);
AuditEvent event = new AuditEvent("test-user", "test-type", data);
customAuditEventRepository.add(event);
List<PersistentAuditEvent> persistentAuditEvents = persistenceAuditEventRepository.findAll();
assertThat(persistentAuditEvents).hasSize(1);
PersistentAuditEvent persistentAuditEvent = persistentAuditEvents.get(0);
assertThat(persistentAuditEvent.getData().get("remoteAddress")).isEqualTo("1.2.3.4");
assertThat(persistentAuditEvent.getData().get("sessionId")).isEqualTo("test-session-id");
}
@Test
public void testAddEventWithNullData() {
Map<String, Object> data = new HashMap<>();
data.put("test-key", null);
AuditEvent event = new AuditEvent("test-user", "test-type", data);
customAuditEventRepository.add(event);
List<PersistentAuditEvent> persistentAuditEvents = persistenceAuditEventRepository.findAll();
assertThat(persistentAuditEvents).hasSize(1);
PersistentAuditEvent persistentAuditEvent = persistentAuditEvents.get(0);
assertThat(persistentAuditEvent.getData().get("test-key")).isEqualTo("null");
}
@Test
public void addAuditEventWithAnonymousUser() {
Map<String, Object> data = new HashMap<>();
data.put("test-key", "test-value");
AuditEvent event = new AuditEvent(Constants.ANONYMOUS_USER, "test-type", data);
customAuditEventRepository.add(event);
List<PersistentAuditEvent> persistentAuditEvents = persistenceAuditEventRepository.findAll();
assertThat(persistentAuditEvents).hasSize(0);
}
@Test
public void addAuditEventWithAuthorizationFailureType() {
Map<String, Object> data = new HashMap<>();
data.put("test-key", "test-value");
AuditEvent event = new AuditEvent("test-user", "AUTHORIZATION_FAILURE", data);
customAuditEventRepository.add(event);
List<PersistentAuditEvent> persistentAuditEvents = persistenceAuditEventRepository.findAll();
assertThat(persistentAuditEvents).hasSize(0);
}
}
| [
"wbw_0117@163.com"
] | wbw_0117@163.com |
cfb5307f3fd889af586a3b99527a97dbd51a5b30 | c8b24cd38709878c2b9709956d05871edc433a35 | /com/mmallstudy/src/main/java/com/mmall/service/impl/UserServiceImpl.java | 39b9f77de936f5cebbc557f2d3851c35cbcdf69e | [] | no_license | yangyangsmile/mmall_learing | 65dd8c8129de33c1b94de9a4479b41390ccdbb7e | 2f60f62b8a2177b915021d25a45deb105a2589a7 | refs/heads/master | 2021-01-19T18:41:30.884150 | 2017-08-23T13:17:40 | 2017-08-23T13:17:40 | 101,153,778 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,117 | java | package com.mmall.service.impl;
import com.mmall.common.Const;
import com.mmall.common.ServerResponse;
import com.mmall.common.TokenCache;
import com.mmall.dao.UserMapper;
import com.mmall.pojo.User;
import com.mmall.service.IUserService;
import com.mmall.util.MD5Util;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.UUID;
/**
* Created by duanpengyang on 17-7-25.
*/
@Service("iUserService")
public class UserServiceImpl implements IUserService {
@Autowired
private UserMapper userMapper;
public ServerResponse<User> login(String userName, String passWord) {
if (userMapper.chackUser(userName)==1) {
return ServerResponse.CreateByErrorMessage("用户名不存在");
}
User user = (User) userMapper.checkUserByPasswd(userName, passWord);
if (user== null) {
return ServerResponse.CreateByErrorMessage("密码错误");
}
user.setPassword(StringUtils.EMPTY);
return ServerResponse .CreateBySuccess("登陆成功",user);
}
public ServerResponse<String> register(User user){
ServerResponse validResponse = this.checkValid(user.getUsername(),Const.USERNAME);
if (!validResponse.isSuccess()){
return validResponse;
}
validResponse = this.checkValid(user.getEmail(),Const.EMAILI);
if (!validResponse.isSuccess()){
return validResponse;
}
user.setRole(Const.Role.ROLE_CUSTOMER);
String md5Password = MD5Util.MD5EncodeUtf8(user.getPassword());
user.setPassword(md5Password);
int result = userMapper.insert(user);
if (result >0){
return ServerResponse.CreateBySuccessMessage("创建用户成功");
}
return ServerResponse.CreateByErrorMessage("创建用户失败");
}
public ServerResponse<String> checkValid(String str , String type) {
if (StringUtils.isBlank(type)) {
if (Const.USERNAME.equals(type)) { //开始校验
if (userMapper.chackUser(str) > 0) {
return ServerResponse.CreateByErrorMessage("用户名已经存在");
}
}
if (Const.EMAILI.equals(type)) {
if (userMapper.chackEamil(str) > 0) {
return ServerResponse.CreateByErrorMessage("EMAIL已经存在");
}
}
}else{
return ServerResponse.CreateByErrorMessage("参数错误");
}
return ServerResponse.CreateBySuccessMessage("校验成功");
}
public ServerResponse selectQuestion(String username){
ServerResponse validResponse = this.checkValid(username,Const.USERNAME);
if(validResponse.isSuccess()){
return ServerResponse.CreateByErrorMessage("用户不存在");
}
String question = userMapper.selectQuestionByUsername(username);
if (StringUtils.isNotBlank(question)){
return ServerResponse.CreateBySuccess(question);
}
return ServerResponse.CreateByErrorMessage("找回密码的问题是空的");
}
public ServerResponse<String> checkAnswer(String username,String question ,String answer){
int resultCount = userMapper.checkAnwer(username,question,answer);
if (resultCount>0){
String forgetToken = UUID.randomUUID().toString();
TokenCache.setKey(TokenCache.TOKEN_PREFIX+username,forgetToken);
return ServerResponse.CreateBySuccess(forgetToken);
}
return ServerResponse.CreateByErrorMessage("问题答案错误");
}
public ServerResponse<String>forgetResetPassword(String username,String passwordNew,String forgetToken) {
if (StringUtils.isBlank(forgetToken)) {
return ServerResponse.CreateByErrorMessage("参数错误,TOKEN 需要传递");
}
ServerResponse validResponse = this.checkValid(username, Const.USERNAME);
if (validResponse.isSuccess()) {
return ServerResponse.CreateByErrorMessage("用户不存在");
}
String token = TokenCache.getKey(TokenCache.TOKEN_PREFIX + username);
if (StringUtils.isBlank(token)) {
return ServerResponse.CreateByErrorMessage("token 无效或者过期");
}
if (StringUtils.equals(forgetToken, token)) {
String md5Password = MD5Util.MD5EncodeUtf8(passwordNew);
int rowCount = userMapper.updatePasswordByUsername(username, md5Password);
if (rowCount > 0) {
return ServerResponse.CreateBySuccessMessage("更改密码成功");
}
} else {
return ServerResponse.CreateByErrorMessage("token 错误");
}
return ServerResponse.CreateByErrorMessage("修改密码失败");
}
public ServerResponse<String> resetPassword(String password,String passwordNew,User user){
//防止横向越权
int resultCount = userMapper.checkPassword(MD5Util.MD5EncodeUtf8(password),user.getId());
if (resultCount == 0) {
return ServerResponse.CreateByErrorMessage("旧密码错误");
}
user.setPassword(MD5Util.MD5EncodeUtf8(passwordNew));
int updatecount = userMapper.updateByPrimaryKeySelective(user);
if(updatecount>0){
return ServerResponse.CreateBySuccessMessage("密码更新成功");
}
return ServerResponse.CreateByErrorMessage("密码更新失败");
}
public ServerResponse <User> updateInfoMation(User user){
//username 不能被更新
//email校验
int resultCount = userMapper.checkEmailByUserId(user.getEmail(),user.getId());
if (resultCount>0){
return ServerResponse.CreateByErrorMessage("EMAIL已经存在");
}
User updateUser = new User();
updateUser.setId(user.getId());
updateUser.setEmail(user.getEmail());
updateUser.setPhone(user.getPhone());
updateUser.setQuestion(user.getQuestion());
updateUser.setAnswer(user.getAnswer());
int updateCount = userMapper.updateByPrimaryKeySelective(user);
if (updateCount>0){
return ServerResponse.CreateBySuccess("更新个人信息成功",updateUser);
}
return ServerResponse.CreateByErrorMessage("更新个人信息失败");
}
public ServerResponse<User> getInformation(Integer userId){
User user = userMapper.selectByPrimaryKey(userId);
if (user ==null){
return ServerResponse.CreateByErrorMessage("找不到当前用户");
}
user.setPassword(StringUtils.EMPTY);
return ServerResponse.CreateBySuccess(user);
}
//backend
public ServerResponse checkAdminRole(User user){
if (user != null && user.getRole().intValue()==Const.Role.ROLE_ADMIN){
return ServerResponse.CreateBySuccess();
}
return ServerResponse.CreateByError();
}
}
| [
"1542232999@qq.com"
] | 1542232999@qq.com |
e8edac35571bb7cca8cb6cf4742d856b290b22b6 | 37fdbb96848e5c23efa2512f92315d30ebb7132f | /CCPA-2020/Credit Card Processing/src/main/java/com/ics/creditcardreader/CreateSaleActivity.java | b3cf80e6a7a463a2ed60b8e95c253d77ae17b244 | [] | no_license | iamsfs/LeadsApps2020 | a3175d092136585f29e36674228fe9c8396f04d2 | c3886acc72e7418b8e7fd6da38c7e9301bda22c1 | refs/heads/master | 2023-03-21T23:38:08.392433 | 2021-03-18T17:11:55 | 2021-03-18T17:11:55 | 264,826,826 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,805 | java | package com.ics.creditcardprocessing;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.text.Editable;
import android.text.Selection;
import android.text.TextWatcher;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
public class CreateSaleActivity extends Activity implements OnClickListener {
private static final String TAG = "CCR - Sale Amount";
private TextView action_next;
private EditText sale_amt;
private boolean amountValidated = false;
private String valAmount = "", tmpAmount = "";
private char operator;
private Button key_01, key_02, key_03, key_04, key_05, key_06, key_07, key_08, key_09, key_0, key_x,
key_clear, key_devide, key_multiply, key_minus, key_plus, key_done, key_dot, key_equal;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_create_sale);
if (action_next == null) {
action_next = (TextView) findViewById(R.id.action_next);
}
if (sale_amt == null) {
sale_amt = (EditText) findViewById(R.id.sale_amt);
}
findViewById(R.id.calculator).setVisibility(View.VISIBLE);
key_01 = (Button) findViewById(R.id.key_01);
key_02 = (Button) findViewById(R.id.key_02);
key_03 = (Button) findViewById(R.id.key_03);
key_04 = (Button) findViewById(R.id.key_04);
key_05 = (Button) findViewById(R.id.key_05);
key_06 = (Button) findViewById(R.id.key_06);
key_07 = (Button) findViewById(R.id.key_07);
key_08 = (Button) findViewById(R.id.key_08);
key_09 = (Button) findViewById(R.id.key_09);
key_0 = (Button) findViewById(R.id.key_0);
key_x = (Button) findViewById(R.id.key_x);
key_clear = (Button) findViewById(R.id.key_clear);
key_devide = (Button) findViewById(R.id.key_devide);
key_multiply = (Button) findViewById(R.id.key_multiply);
key_minus = (Button) findViewById(R.id.key_minus);
key_plus = (Button) findViewById(R.id.key_plus);
key_done = (Button) findViewById(R.id.key_done);
key_dot = (Button) findViewById(R.id.key_dot);
key_equal = (Button) findViewById(R.id.key_equal);
}
@Override
protected void onStart() {
super.onStart();
sale_amt.setOnClickListener(this);
action_next.setOnClickListener(this);
key_0.setOnClickListener(this);
key_01.setOnClickListener(this);
key_02.setOnClickListener(this);
key_03.setOnClickListener(this);
key_04.setOnClickListener(this);
key_05.setOnClickListener(this);
key_06.setOnClickListener(this);
key_07.setOnClickListener(this);
key_08.setOnClickListener(this);
key_09.setOnClickListener(this);
key_x.setOnClickListener(this);
key_clear.setOnClickListener(this);
key_devide.setOnClickListener(this);
key_multiply.setOnClickListener(this);
key_minus.setOnClickListener(this);
key_plus.setOnClickListener(this);
key_done.setOnClickListener(this);
key_dot.setOnClickListener(this);
key_equal.setOnClickListener(this);
sale_amt.addTextChangedListener(new TextWatcher() {
public void afterTextChanged(Editable s) {
}
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
public void onTextChanged(CharSequence s, int start, int before, int count) {
if (!amountValidated) {
//if(!amountValidated && s.toString().matches("^(\\d{1,3}(\\,\\d{3})*|(\\d+))(\\.\\d+)?$")){
//String userInput = s.toString().replaceAll("[^\\d]", "");
String userInput = s.toString();
StringBuilder cashAmountBuilder = new StringBuilder(userInput);
//while (cashAmountBuilder.length() > 3 && cashAmountBuilder.charAt(0) == '0') {
// cashAmountBuilder.deleteCharAt(0);
//}
//while (cashAmountBuilder.length() < 3) {
// cashAmountBuilder.insert(0, '0');
//}
//cashAmountBuilder.insert(cashAmountBuilder.length() - 2, '.');
//cashAmountBuilder.insert(0, '$');
amountValidated = true;
valAmount = cashAmountBuilder.toString();
setAmtValue(valAmount);
amountValidated = false;
}
}
});
}
private void setAmtValue(String cashAmount) {
sale_amt.setText(cashAmount);
// keeps the cursor always to the right
Selection.setSelection(sale_amt.getText(), sale_amt.getText().toString().length());
Log.d(TAG, sale_amt.getText().toString());
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.sale_amt:
findViewById(R.id.calculator).setVisibility(View.VISIBLE);
break;
case R.id.action_next:
//if (validateData()) {
startNewActivity();
//} else {
// ShowNotification.showErrorDialog(CreateSaleActivity.this, "Enter Valid Amount");
//}
break;
case R.id.key_0:
valAmount = valAmount + "0";
break;
case R.id.key_01:
valAmount = valAmount + "1";
break;
case R.id.key_02:
valAmount = valAmount + "2";
break;
case R.id.key_03:
valAmount = valAmount + "3";
break;
case R.id.key_04:
valAmount = valAmount + "4";
break;
case R.id.key_05:
valAmount = valAmount + "5";
break;
case R.id.key_06:
valAmount = valAmount + "6";
break;
case R.id.key_07:
valAmount = valAmount + "7";
break;
case R.id.key_08:
valAmount = valAmount + "8";
break;
case R.id.key_09:
valAmount = valAmount + "9";
break;
case R.id.key_dot:
if (!valAmount.contains(".")) {
valAmount = valAmount + ".";
}
break;
case R.id.key_x:
if (valAmount.length() > 0) {
valAmount = valAmount.substring(0, (valAmount.length() - 1));
}
break;
case R.id.key_clear:
valAmount = "";
break;
case R.id.key_devide:
tmpAmount = valAmount;
valAmount = "";
operator = '/';
break;
case R.id.key_multiply:
tmpAmount = valAmount;
valAmount = "";
operator = '*';
break;
case R.id.key_minus:
tmpAmount = valAmount;
valAmount = "";
operator = '-';
break;
case R.id.key_plus:
tmpAmount = valAmount;
valAmount = "";
operator = '+';
break;
case R.id.key_done:
findViewById(R.id.calculator).setVisibility(View.VISIBLE);
break;
case R.id.key_equal:
if (valAmount.length() > 0 && tmpAmount.length() > 0) {
switch (operator) {
case '/':
if (valAmount.length() > 0 && Double.parseDouble(valAmount) != 0) {
valAmount = String.format("%.2f", (Double.parseDouble(tmpAmount) / Double.parseDouble(valAmount)));
}
break;
case '*':
valAmount = String.format("%.2f", (Double.parseDouble(tmpAmount) * Double.parseDouble(valAmount)));
break;
case '-':
valAmount = String.format("%.2f", (Double.parseDouble(tmpAmount) - Double.parseDouble(valAmount)));
break;
case '+':
valAmount = String.format("%.2f", (Double.parseDouble(tmpAmount) + Double.parseDouble(valAmount)));
break;
}
}
break;
}
if (v.getId() != R.id.key_devide && v.getId() != R.id.key_multiply && v.getId() != R.id.key_minus && v.getId() != R.id.key_plus)
setAmtValue(valAmount);
}
private boolean validateData() {
if (sale_amt.getText().toString().equals("0.00")) {
return false;
}
try {
double num = Double.parseDouble(sale_amt.getText().toString());
if (num < 0.0) {
return false;
}
} catch (NumberFormatException e) {
e.printStackTrace();
return false;
}
return true;
}
private void startNewActivity() {
Intent i = new Intent(CreateSaleActivity.this, PaymentActivity.class);
i.putExtra("sale_amount", sale_amt.getText().toString());
startActivity(i);
}
}
| [
"33027759+TalhaTZA@users.noreply.github.com"
] | 33027759+TalhaTZA@users.noreply.github.com |
c65ef28ee2c75e03dc433b1c7a885de4963a29ec | 0ea4172096aa474661ca0d576e66b849f5ad47d0 | /exorg/backend/src/java/ru.exorg.backend/handler/YaletHandler.java | efede780ae5903926461f33df1ad871f1017700a | [] | no_license | SmartHub/ExcursionOrganizer | 739f4e5589053bbc71192c2b97b78a88fe9bb627 | d37c960e0e4f1b23b376b1bd355f6dd5a5bab8f2 | refs/heads/master | 2021-01-19T07:56:34.510246 | 2011-05-29T19:37:52 | 2011-05-29T19:37:52 | 1,371,967 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 372 | java | package ru.exorg.backend.handler;
import net.sf.xfresh.core.YaletProcessor2;
import org.eclipse.jetty.server.handler.AbstractHandler;
public abstract class YaletHandler extends AbstractHandler {
/* When genericity is an evil... */
protected YaletProcessor2 processor;
public void setYaletProcessor(YaletProcessor2 yp) {
this.processor = yp;
}
} | [
"aleksandr.kartashov.aptu.se@gmail.com"
] | aleksandr.kartashov.aptu.se@gmail.com |
541e1cc265e1bcaee604578e258d668b25fe2e1d | 9742a1695c33cfcfd79b056e7f7b4b642a441825 | /exercise/src/pr6/Ex7.java | 6ba839de6148975b4300782251e879d0de380ec8 | [] | no_license | howoo101/java | 21ca5dd26016060a96cb6e7a79c1ff4b9b1b1969 | ed108068d963af9689558ebd33ec03c7438220ab | refs/heads/master | 2020-05-18T15:40:14.330426 | 2019-06-30T04:38:53 | 2019-06-30T04:38:53 | 184,505,851 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 347 | java | package pr6;
class MyPoint {
int x;
int y;
MyPoint(int x, int y) {
this.x = x;
this.y = y;
}
public double getDistance(int x, int y) {
return Ex6.getDistance(x, y, this.x, this.y);
}
}
public class Ex7 {
public static void main(String[] args) {
MyPoint p = new MyPoint(1,1);
System.out.println(p.getDistance(2, 2));
}
}
| [
"minho0719@a.ut.ac.kr"
] | minho0719@a.ut.ac.kr |
0db38bff3c9ec2609645526b55a5eaebe9547d0a | 0e35ca3e5a94a4575e787775651b48fbd8a5997c | /SimpleReminder/src/com/dushantha/util/ReturnData.java | 9a943085353392bd5bd2e960938b1e8e894bad3c | [] | no_license | thilankadileepa/mobile | 7c230d390adf02fa84fdb8910ca0ff4cd17e1317 | 0d675c5a93a2e538f7fb19a42ed36c8b5193c09f | refs/heads/master | 2021-01-02T22:18:04.674942 | 2014-03-06T17:05:45 | 2014-03-06T17:05:45 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 654 | java | package com.dushantha.util;
/**
* composite return data object
* purpose is to return a status and a data from a method
*
* @author Thilanka
*
* @param <T>
*/
public class ReturnData<T> {
private boolean sucsess;
private T data;
public ReturnData() {
super();
}
public ReturnData(boolean sucsess, T data) {
super();
this.sucsess = sucsess;
this.data = data;
}
public boolean isSucsess() {
return sucsess;
}
public void setSucsess(boolean sucsess) {
this.sucsess = sucsess;
}
public T getData() {
return data;
}
public void setData(T data) {
this.data = data;
}
}
| [
"thilankadileepa@gmail.com"
] | thilankadileepa@gmail.com |
bcfb022e3f1736e226adbd029d8e25ade3a4be09 | c2e8c9dab9ff62b8fd2dc727a84f329a9de18796 | /src/main/java/eu/wauz/wauzcore/commands/CmdGrp.java | bec8ec168f1aa5d8fd70d291fb6c8dfafd3d3b81 | [
"Apache-2.0"
] | permissive | Jassuuu/WauzCore | 601c5a728a766443a0cef504ed0a26282c4183d1 | 8d86f4d3114af554849041106b4536f2b7456eda | refs/heads/master | 2023-02-27T23:26:33.633234 | 2021-02-07T01:13:59 | 2021-02-07T01:13:59 | 323,674,851 | 0 | 0 | Apache-2.0 | 2020-12-22T16:15:32 | 2020-12-22T16:15:31 | null | UTF-8 | Java | false | false | 1,326 | java | package eu.wauz.wauzcore.commands;
import java.util.Arrays;
import java.util.List;
import org.bukkit.command.CommandSender;
import org.bukkit.craftbukkit.libs.org.apache.commons.lang3.StringUtils;
import org.bukkit.entity.Player;
import eu.wauz.wauzcore.commands.execution.WauzCommand;
import eu.wauz.wauzcore.commands.execution.WauzCommandExecutor;
import eu.wauz.wauzcore.system.ChatFormatter;
import eu.wauz.wauzcore.system.annotations.Command;
/**
* A command, that can be executed by a player with fitting permissions.</br>
* - Description: <b>Send Message in Group Chat</b></br>
* - Usage: <b>/grp [text]</b></br>
* - Permission: <b>wauz.normal</b>
*
* @author Wauzmons
*
* @see WauzCommand
* @see WauzCommandExecutor
*/
@Command
public class CmdGrp implements WauzCommand {
/**
* @return The id of the command, aswell as aliases.
*/
@Override
public List<String> getCommandIds() {
return Arrays.asList("grp");
}
/**
* Executes the command for given sender with arguments.
*
* @param sender The sender of the command.
* @param args The arguments of the command.
*
* @return If the command had correct syntax.
*/
@Override
public boolean executeCommand(CommandSender sender, String[] args) {
return ChatFormatter.group((Player) sender, StringUtils.join(args, " "));
}
}
| [
"dev@wauz.eu"
] | dev@wauz.eu |
fdee845c2d2b83c49034d2a8a690990eab7d4a41 | 0e972ff378bbafa297b4b77dbe7fb29fc6358e8c | /test/unit/org/apache/cassandra/utils/btree/BTreeRemovalTest.java | a9cf383805be36c3792b794c8a66922b30c1d1ef | [
"BSD-3-Clause",
"Apache-2.0",
"LicenseRef-scancode-public-domain"
] | permissive | Instagram/cassandra | 27a87c7ab6c5c35ca575a2314c1d0c9deda86d47 | 90a4672970837e674972861f3cc7020e3c3caba6 | refs/heads/trunk | 2023-04-12T14:41:21.431744 | 2019-07-15T16:48:18 | 2019-07-15T16:48:18 | 10,067,580 | 487 | 64 | Apache-2.0 | 2023-03-21T23:03:09 | 2013-05-15T00:07:43 | Java | UTF-8 | Java | false | false | 13,066 | java | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.cassandra.utils.btree;
import static org.apache.cassandra.utils.btree.BTreeRemoval.remove;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import java.util.Comparator;
import java.util.Random;
import java.util.SortedSet;
import java.util.TreeSet;
import org.junit.Test;
import com.google.common.collect.Iterables;
public class BTreeRemovalTest
{
static
{
System.setProperty("cassandra.btree.fanfactor", "8");
}
private static final Comparator<Integer> CMP = new Comparator<Integer>()
{
public int compare(Integer o1, Integer o2)
{
return Integer.compare(o1, o2);
}
};
private static Object[] copy(final Object[] btree)
{
final Object[] result = new Object[btree.length];
System.arraycopy(btree, 0, result, 0, btree.length);
if (!BTree.isLeaf(btree))
{
for (int i = BTree.getChildStart(btree); i < BTree.getChildEnd(btree); ++i)
result[i] = copy((Object[]) btree[i]);
final int[] sizeMap = BTree.getSizeMap(btree);
final int[] resultSizeMap = new int[sizeMap.length];
System.arraycopy(sizeMap, 0, resultSizeMap, 0, sizeMap.length);
result[result.length - 1] = resultSizeMap;
}
return result;
}
private static Object[] assertRemove(final Object[] btree, final int key)
{
final Object[] btreeBeforeRemoval = copy(btree);
final Object[] result = remove(btree, CMP, key);
assertBTree(btreeBeforeRemoval, btree);
assertTrue(BTree.isWellFormed(result, CMP));
assertEquals(BTree.size(btree) - 1, BTree.size(result));
assertNull(BTree.find(result, CMP, key));
for (Integer k : BTree.<Integer>iterable(btree))
if (k != key)
assertNotNull(BTree.find(result, CMP, k));
return result;
}
private static void assertBTree(final Object[] expected, final Object[] result)
{
assertEquals(BTree.isEmpty(expected), BTree.isEmpty(result));
assertEquals(BTree.isLeaf(expected), BTree.isLeaf(result));
assertEquals(expected.length, result.length);
if (BTree.isLeaf(expected))
{
assertArrayEquals(expected, result);
}
else
{
for (int i = 0; i < BTree.getBranchKeyEnd(expected); ++i)
assertEquals(expected[i], result[i]);
for (int i = BTree.getChildStart(expected); i < BTree.getChildEnd(expected); ++i)
assertBTree((Object[]) expected[i], (Object[]) result[i]);
assertArrayEquals(BTree.getSizeMap(expected), BTree.getSizeMap(result));
}
}
private static Object[] generateLeaf(int from, int size)
{
final Object[] result = new Object[(size & 1) == 1 ? size : size + 1];
for (int i = 0; i < size; ++i)
result[i] = from + i;
return result;
}
private static Object[] generateBranch(int[] keys, Object[][] children)
{
assert keys.length > 0;
assert children.length > 1;
assert children.length == keys.length + 1;
final Object[] result = new Object[keys.length + children.length + 1];
for (int i = 0; i < keys.length; ++i)
result[i] = keys[i];
for (int i = 0; i < children.length; ++i)
result[keys.length + i] = children[i];
final int[] sizeMap = new int[children.length];
sizeMap[0] = BTree.size(children[0]);
for (int i = 1; i < children.length; ++i)
sizeMap[i] = sizeMap[i - 1] + BTree.size(children[i]) + 1;
result[result.length - 1] = sizeMap;
return result;
}
private static Object[] generateSampleTwoLevelsTree(final int[] leafSizes)
{
assert leafSizes.length > 1;
final Object[][] leaves = new Object[leafSizes.length][];
for (int i = 0; i < leaves.length; ++i)
leaves[i] = generateLeaf(10 * i + 1, leafSizes[i]);
final int[] keys = new int[leafSizes.length - 1];
for (int i = 0; i < keys.length; ++i)
keys[i] = 10 * (i + 1);
final Object[] btree = generateBranch(keys, leaves);
assertTrue(BTree.isWellFormed(btree, CMP));
return btree;
}
private static Object[] generateSampleThreeLevelsTree(final int[] middleNodeSizes)
{
assert middleNodeSizes.length > 1;
final Object[][] middleNodes = new Object[middleNodeSizes.length][];
for (int i = 0; i < middleNodes.length; ++i)
{
final Object[][] leaves = new Object[middleNodeSizes[i]][];
for (int j = 0; j < middleNodeSizes[i]; ++j)
leaves[j] = generateLeaf(100 * i + 10 * j + 1, 4);
final int[] keys = new int[middleNodeSizes[i] - 1];
for (int j = 0; j < keys.length; ++j)
keys[j] = 100 * i + 10 * (j + 1);
middleNodes[i] = generateBranch(keys, leaves);
}
final int[] keys = new int[middleNodeSizes.length - 1];
for (int i = 0; i < keys.length; ++i)
keys[i] = 100 * (i + 1);
final Object[] btree = generateBranch(keys, middleNodes);
assertTrue(BTree.isWellFormed(btree, CMP));
return btree;
}
@Test
public void testRemoveFromEmpty()
{
assertBTree(BTree.empty(), remove(BTree.empty(), CMP, 1));
}
@Test
public void testRemoveNonexistingElement()
{
final Object[] btree = new Object[] {1, 2, 3, 4, null};
assertBTree(btree, remove(btree, CMP, 5));
}
@Test
public void testRemoveLastElement()
{
final Object[] btree = new Object[] {1};
assertBTree(BTree.empty(), remove(btree, CMP, 1));
}
@Test
public void testRemoveFromRootWhichIsALeaf()
{
for (int size = 1; size < 9; ++size)
{
final Object[] btree = new Object[(size & 1) == 1 ? size : size + 1];
for (int i = 0; i < size; ++i)
btree[i] = i + 1;
for (int i = 0; i < size; ++i)
{
final Object[] result = remove(btree, CMP, i + 1);
assertTrue("size " + size, BTree.isWellFormed(result, CMP));
for (int j = 0; j < i; ++j)
assertEquals("size " + size + "elem " + j, btree[j], result[j]);
for (int j = i; j < size - 1; ++j)
assertEquals("size " + size + "elem " + j, btree[j + 1], result[j]);
for (int j = size - 1; j < result.length; ++j)
assertNull("size " + size + "elem " + j, result[j]);
}
{
final Object[] result = remove(btree, CMP, 0);
assertTrue("size " + size, BTree.isWellFormed(result, CMP));
assertBTree(btree, result);
}
{
final Object[] result = remove(btree, CMP, size + 1);
assertTrue("size " + size, BTree.isWellFormed(result, CMP));
assertBTree(btree, result);
}
}
}
@Test
public void testRemoveFromNonMinimalLeaf()
{
for (int size = 5; size < 9; ++size)
{
final Object[] btree = generateSampleTwoLevelsTree(new int[] {size, 4, 4, 4, 4});
for (int i = 1; i < size + 1; ++i)
assertRemove(btree, i);
}
}
@Test
public void testRemoveFromMinimalLeafRotateLeft()
{
final Object[] btree = generateSampleTwoLevelsTree(new int[] {4, 5, 5, 5, 5});
for (int i = 11; i < 15; ++i)
assertRemove(btree, i);
}
@Test
public void testRemoveFromMinimalLeafRotateRight1()
{
final Object[] btree = generateSampleTwoLevelsTree(new int[] {4, 5, 5, 5, 5});
for (int i = 1; i < 5; ++i)
assertRemove(btree, i);
}
@Test
public void testRemoveFromMinimalLeafRotateRight2()
{
final Object[] btree = generateSampleTwoLevelsTree(new int[] {4, 4, 5, 5, 5});
for (int i = 11; i < 15; ++i)
assertRemove(btree, i);
}
@Test
public void testRemoveFromMinimalLeafMergeWithLeft1()
{
final Object[] btree = generateSampleTwoLevelsTree(new int[] {4, 4, 4, 4, 4});
for (int i = 11; i < 15; ++i)
assertRemove(btree, i);
}
@Test
public void testRemoveFromMinimalLeafMergeWithLeft2()
{
final Object[] btree = generateSampleTwoLevelsTree(new int[] {4, 4, 4, 4, 4});
for (int i = 41; i < 45; ++i)
assertRemove(btree, i);
}
@Test
public void testRemoveFromMinimalLeafMergeWithRight()
{
final Object[] btree = generateSampleTwoLevelsTree(new int[] {4, 4, 4, 4, 4});
for (int i = 1; i < 5; ++i)
assertRemove(btree, i);
}
@Test
public void testRemoveFromMinimalLeafWhenSingleKeyRootMergeWithLeft()
{
final Object[] btree = generateSampleTwoLevelsTree(new int[] {4, 4});
for (int i = 1; i < 5; ++i)
assertRemove(btree, i);
}
@Test
public void testRemoveFromMinimalLeafWhenSingleKeyRootMergeWithRight()
{
final Object[] btree = generateSampleTwoLevelsTree(new int[] {4, 4});
for (int i = 11; i < 15; ++i)
assertRemove(btree, i);
}
@Test
public void testRemoveFromMinimalLeafWithBranchLeftRotation()
{
final Object[] btree = generateSampleThreeLevelsTree(new int[] {6, 5, 5, 5, 5});
for (int i = 101; i < 105; ++i)
assertRemove(btree, i);
}
@Test
public void testRemoveFromMinimalLeafWithBranchRightRotation1()
{
final Object[] btree = generateSampleThreeLevelsTree(new int[] {5, 6, 5, 5, 5});
for (int i = 1; i < 5; ++i)
assertRemove(btree, i);
}
@Test
public void testRemoveFromMinimalLeafWithBranchRightRotation2()
{
final Object[] btree = generateSampleThreeLevelsTree(new int[] {5, 5, 6, 5, 5});
for (int i = 101; i < 105; ++i)
assertRemove(btree, i);
}
@Test
public void testRemoveFromMinimalLeafWithBranchMergeWithLeft1()
{
final Object[] btree = generateSampleThreeLevelsTree(new int[] {5, 5, 5, 5, 5});
for (int i = 101; i < 105; ++i)
assertRemove(btree, i);
}
@Test
public void testRemoveFromMinimalLeafWithBranchMergeWithLeft2()
{
final Object[] btree = generateSampleThreeLevelsTree(new int[] {5, 5, 5, 5, 5});
for (int i = 401; i < 405; ++i)
assertRemove(btree, i);
}
@Test
public void testRemoveFromMinimalLeafWithBranchMergeWithRight()
{
final Object[] btree = generateSampleThreeLevelsTree(new int[] {5, 5, 5, 5, 5});
for (int i = 1; i < 5; ++i)
assertRemove(btree, i);
}
@Test
public void testRemoveFromMiddleBranch()
{
final Object[] btree = generateSampleThreeLevelsTree(new int[] {5, 5, 5, 5, 5});
for (int i = 10; i < 50; i += 10)
assertRemove(btree, i);
}
@Test
public void testRemoveFromRootBranch()
{
final Object[] btree = generateSampleThreeLevelsTree(new int[] {5, 5, 5, 5, 5});
for (int i = 100; i < 500; i += 100)
assertRemove(btree, i);
}
@Test
public void randomizedTest()
{
Random rand = new Random(2);
SortedSet<Integer> data = new TreeSet<>();
for (int i = 0; i < 1000; ++i)
data.add(rand.nextInt());
Object[] btree = BTree.build(data, UpdateFunction.<Integer>noOp());
assertTrue(BTree.isWellFormed(btree, CMP));
assertTrue(Iterables.elementsEqual(data, BTree.iterable(btree)));
while (btree != BTree.empty())
{
int idx = rand.nextInt(BTree.size(btree));
Integer val = BTree.findByIndex(btree, idx);
assertTrue(data.remove(val));
btree = assertRemove(btree, val);
}
}
}
| [
"sylvain@datastax.com"
] | sylvain@datastax.com |
7f436a765eef3f25670961cbe22a04f73adbe605 | a3d0a500fd07b444ec5eca57a1100cd322a61190 | /itcastTax/src/cn/itcast/nsfw/user/dao/UserDao.java | e1ff2c132efbb9d2eeadcf82444fa3dac33201c3 | [] | no_license | hms861972/test | 8c3c78d747825fb812a1225d79020748390d8f1a | de365988e052eab731fa13193330aa8d7c183603 | refs/heads/master | 2020-12-01T12:49:47.505441 | 2019-12-28T16:16:17 | 2019-12-28T16:16:17 | 230,631,175 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 518 | java | package cn.itcast.nsfw.user.dao;
import cn.itcast.core.dao.BaseDao;
import cn.itcast.nsfw.user.entity.User;
import cn.itcast.nsfw.user.entity.UserRole;
import java.util.List;
public interface UserDao extends BaseDao<User> {
List<User> selectUserByAccount(String id, String account);
void insertUserRole(UserRole userRole);
void deleteUserAndRoleByUid(String id);
List<UserRole> selectUserRoleByUid(String id);
List<User> selectUserByAccountAndPassword(String account, String password);
}
| [
"674948169@qq.com"
] | 674948169@qq.com |
521e4bbc24d9012bad1176d7a83c67d84b31c5e6 | 4d752bb0d5de25ae9f7efcef53338750c63a3bef | /scen-core-parent/scen-dao/src/main/java/com/scen/dao/AdminUserDao.java | ea860d02a32f841f50b7a65dfb21e14f719048d0 | [
"Apache-2.0"
] | permissive | Scenx/scen-springcloud-store | 96f3b434af148deba3ab71ff306f0f0af587946e | 6eeceef12c57ba1a0fd735b7a7a16de84aadf1c4 | refs/heads/master | 2020-03-16T21:20:40.009598 | 2018-06-11T09:52:03 | 2018-06-11T09:52:03 | 132,995,221 | 3 | 1 | null | null | null | null | UTF-8 | Java | false | false | 545 | java | package com.scen.dao;
import com.scen.basedao.BaseDao;
import com.scen.pojo.AdminUser;
import java.util.Set;
/**
* 管理员持久层
*
* @author Scen
* @date 2018/5/11 19:44
*/
public interface AdminUserDao extends BaseDao<AdminUser> {
/**
* 通过用户名查询角色信息
*
* @param username
* @return
*/
Set<String> getRoles(String username);
/**
* 通过用户名查询权限信息
*
* @param username
* @return
*/
Set<String> getPermissions(String username);
}
| [
"scen@vip.qq.com"
] | scen@vip.qq.com |
1e4d4f6590d2f090e7a83c761ab8421793d346ea | 6f6d6dc3afdbf4a3911545cdbdc692a96abfeb2e | /app/src/main/java/com/example/postgresql/ui/dashboard/ResultadosFragment.java | 34ad37c94c6558cbf7dc545f4c1316311bca2f1b | [] | no_license | cf18gastonrossi/PostgreSQL | 3dae2a8a3844a2173bd3db767d1129aa8c581d7d | 3836d7ec7f34b4e6f6f32a69d1741edd2646a373 | refs/heads/master | 2022-09-14T16:00:18.598236 | 2020-05-31T20:48:34 | 2020-05-31T20:48:34 | 268,095,875 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,088 | java | package com.example.postgresql.ui.dashboard;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModelProviders;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.example.postgresql.R;
import com.example.postgresql.ui.Model.Usuari;
import com.example.postgresql.ui.RecyclerView.Adapter;
import java.sql.Date;
import java.sql.SQLException;
import java.util.ArrayList;
public class ResultadosFragment extends Fragment {
private ResultadosViewModel resultadosViewModel;
private RecyclerView recyclerView;
private RecyclerView.Adapter mAdapter;
private RecyclerView.LayoutManager layoutManager;
private ArrayList<Usuari> usuarisList = new ArrayList<>();
public View onCreateView(@NonNull LayoutInflater inflater,
ViewGroup container, Bundle savedInstanceState) {
resultadosViewModel =
ViewModelProviders.of(this).get(ResultadosViewModel.class);
View root = inflater.inflate(R.layout.fragment_resultados, container, false);
setUpRecyclerView(root);
return root;
}
private void setUpRecyclerView(View view) {
resultadosViewModel.getListaUsuaris().observe(getViewLifecycleOwner(), new Observer<ArrayList<Usuari>>() {
@Override
public void onChanged(ArrayList<Usuari> usuaris) {
usuarisList = usuaris;
mAdapter = new Adapter(usuarisList);
recyclerView.setAdapter(mAdapter);
}
});
recyclerView = view.findViewById(R.id.recyclerView);
recyclerView.setHasFixedSize(true);
layoutManager = new LinearLayoutManager(getContext());
recyclerView.setLayoutManager(layoutManager);
mAdapter = new Adapter(usuarisList);
recyclerView.setAdapter(mAdapter);
}
} | [
"gaston.rossi@basetis.com"
] | gaston.rossi@basetis.com |
01ef8b1600cec60674f8765ccc132f259027760c | 2eeeb3ede8926c5c2313ed82068e23e7e868c566 | /app/src/main/java/cn/leeii/simple/ui/ref/RefreshTestContract.java | f5c2df931bf356602549da64662be206099bc7f9 | [] | no_license | JasonFengHot/LeeFream | 4f515c2908aa76de5073e8a0940f34684df9ef85 | cd422601fc724d4b5249be250b1cd17d743b0bfd | refs/heads/master | 2021-01-21T10:16:07.819173 | 2017-07-26T09:49:20 | 2017-07-26T09:49:20 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 317 | java | package cn.leeii.simple.ui.ref;
import com.leeiidesu.libmvp.mvp.IContract;
/**
* Created by leeiidesu on 2017/6/30.
*/
public interface RefreshTestContract {
interface IRefreshTestView extends IContract.IView<RefreshTestPresenter> {
}
interface IRefreshTestModel extends IContract.IModel {
}
}
| [
"leeiidesu@gmail.com"
] | leeiidesu@gmail.com |
b3c7502109b3304c77576f1f54f9d6789359e5b1 | 8971ca734e67d07b6694d52dd0101c2a41ee9b7c | /src/org/review/dal/ConnectionManager.java | c1d5cd04321682f0432021fb700858a63beb6f4b | [] | no_license | ivyqxy/ReviewApplication | 6090e6768b308017592dd81db49a82a017b33fc8 | 4b1c5c756960908d8e709c0a665935a1fbdae06a | refs/heads/master | 2021-06-06T07:00:53.369208 | 2016-11-09T11:26:15 | 2016-11-09T11:26:15 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,339 | java | // PRAKASH SOMASUNDARAM
package org.review.dal;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.Properties;
//import javax.servlet.ServletException;
/**
* Use ConnectionManager to connect to your database instance.
*
* ConnectionManager uses the MySQL Connector/J driver to connect to your local MySQL instance.
*
* In our example, we will create a DAO (data access object) java class to interact with
* each MySQL table. The DAO java classes will use ConnectionManager to open and close
* connections.
*
* Instructions:
* 1. Install MySQL Community Server. During installation, you will need to set up a user,
* password, and port. Keep track of these values.
* 2. Download and install Connector/J: http://dev.mysql.com/downloads/connector/j/
* 3. Add the Connector/J JAR to your buildpath. This allows your application to use the
* Connector/J library. You can add the JAR using either of the following methods:
* A. When creating a new Java project, on the "Java Settings" page, go to the
* "Libraries" tab.
* Click on the "Add External JARs" button.
* Navigate to the Connector/J JAR. On Windows, this looks something like:
* C:\Program Files (x86)\MySQL\Connector.J 5.1\mysql-connector-java-5.1.34-bin.jar
* B. If you already have a Java project created, then go to your project properties.
* Click on the "Java Build Path" option.
* Click on the "Libraries" tab, click on the "Add External Jars" button, and
* navigate to the Connector/J JAR.
* 4. Update the "private final" variables below.
*/
public class ConnectionManager {
// User to connect to database instance. By default, this is "root".
private final String user = "root";
// Password for the user.
private final String password = "root";
// URI to database server. If running on the same machine, then this is "localhost".
private final String hostName = "localhost";
// Port to database server. By default, this is 3306.
private final int port= 3306;
// Name of the MySQL schema that contains tables.
private final String schema = "reviewapplication";
/** Get the connection to the database instance. */
public Connection getConnection() throws SQLException {
Connection connection = null;
try {
Properties connectionProperties = new Properties();
connectionProperties.put("user", this.user);
connectionProperties.put("password", this.password);
// Ensure the JDBC driver is loaded by retrieving the runtime Class descriptor.
// Otherwise, Tomcat may have issues loading libraries in the proper order.
// One alternative is calling this in the HttpServlet init() override.
try {
Class.forName("com.mysql.jdbc.Driver");
} catch (ClassNotFoundException e) {
e.printStackTrace();
throw new SQLException(e);
}
connection = DriverManager.getConnection(
"jdbc:mysql://" + this.hostName + ":" + this.port + "/" + this.schema + "?useSSL=false",
connectionProperties);
} catch (SQLException e) {
e.printStackTrace();
throw e;
}
return connection;
}
/** Close the connection to the database instance. */
public void closeConnection(Connection connection) throws SQLException {
try {
connection.close();
} catch (SQLException e) {
e.printStackTrace();
throw e;
}
}
}
| [
"somasundaram.p@husky.neu.edu"
] | somasundaram.p@husky.neu.edu |
cd3728dc88a3f65e7105979ec3be5686d73fbc43 | 9edae0eb8b4e8dc522aea0c0964943541581f4a2 | /core/src/lando/systems/prototype/accessors/Vector2Accessor.java | 9c235da50e5fc9d3c22d34554a6c446b7918d50f | [] | no_license | bploeckelman/FlingerPrototype | 51ad725c9d0a80f6701107b63a8e14494fef8106 | 6c1f0b9eb8037f9cff4ced44a3e46b5c3de2f47a | refs/heads/master | 2020-06-05T23:20:14.983582 | 2015-01-18T00:12:08 | 2015-01-18T00:12:08 | 29,379,045 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,200 | java | package lando.systems.prototype.accessors;
import aurelienribon.tweenengine.TweenAccessor;
import com.badlogic.gdx.math.Vector2;
/**
* Brian Ploeckelman created on 7/21/2014.
*/
public class Vector2Accessor implements TweenAccessor<Vector2> {
public static final int X = 1;
public static final int Y = 2;
public static final int XY = 3;
@Override
public int getValues(Vector2 target, int tweenType, float[] returnValues) {
switch (tweenType) {
case X: returnValues[0] = target.x; return 1;
case Y: returnValues[0] = target.y; return 1;
case XY:
returnValues[0] = target.x;
returnValues[1] = target.y;
return 2;
default: assert false; return -1;
}
}
@Override
public void setValues(Vector2 target, int tweenType, float[] newValues) {
switch (tweenType) {
case X: target.x = newValues[0]; break;
case Y: target.y = newValues[0]; break;
case XY:
target.x = newValues[0];
target.y = newValues[1];
break;
default: assert false;
}
}
}
| [
"brian.ploeckelman@gmail.com"
] | brian.ploeckelman@gmail.com |
2c853ff25a067bb4ad46cebf59dbfd2a549ec138 | f2740cb6c3e47d362ba7b8275a23f5b1e4e21c01 | /spring4-code/chapter7/src/main/java/com/smart/advice/GreetingBeforeAdvice.java | f9bdd8af170f97f0b4fc6ebd4d550427b585b233 | [] | no_license | peterlxb/coding-demo | dd94a8a5471309e075c729e5ab85d970c8d8b705 | c5d52d03dcefe4a2663a5055621afcd889e2f4d9 | refs/heads/master | 2023-03-05T18:15:07.499938 | 2021-02-04T14:13:26 | 2021-02-04T14:13:26 | 257,637,242 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 374 | java | package com.smart.advice;
import java.lang.reflect.Method;
import org.springframework.aop.MethodBeforeAdvice;
public class GreetingBeforeAdvice implements MethodBeforeAdvice {
public void before(Method method, Object[] args, Object obj) throws Throwable {
String clientName = (String)args[0];
System.out.println("How are you!Mr."+clientName+".");
}
}
| [
"p_lxboliu@tencent.com"
] | p_lxboliu@tencent.com |
aae028be1385e5b1e20a5f1d8e6a138f864866d3 | 23bcf8dbee07b800585df29c5237db74600c4931 | /dripop-dao/src/main/java/com/dripop/entity/TParam.java | 58980aa60a8f0c2645dbdb29be0f7d776f768d86 | [] | no_license | chaolm/myWeb | cdb5ce3f28ff97104f487b4e1f1b736129d04b34 | 366ded1e0ef04dedc872e7cd26d0c5bef817878b | refs/heads/master | 2022-07-25T19:09:05.065025 | 2019-04-30T06:09:17 | 2019-04-30T06:09:17 | 184,199,647 | 0 | 0 | null | 2022-06-29T17:20:49 | 2019-04-30T05:49:59 | Java | UTF-8 | Java | false | false | 3,520 | java | package com.dripop.entity;
import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;
/**
* Created by liyou on 2017/6/14.
*/
@javax.persistence.Entity
@Table(name = "t_param")
public class TParam implements Serializable {
@Id
@GeneratedValue
private Long id;
private String name;
@Column(name = "channel_id")
private Long channelId;
@Column(name = "is_search")
private Integer isSearch;
@Column(name = "is_enum")
private Integer isEnum;
@Column(name = "is_mult")
private Integer isMult;
@Column(name = "is_detail_search")
private Integer isDetailSearch;
@Column(name = "prod_detail_show")
private Integer prodDetailShow;
@Column(name = "detail_param_show")
private Integer detailParamShow;
@Column(name = "is_required")
private Integer isRequired;
private Integer sort;
private Long creator;
@Column(name = "create_time")
private Date createTime;
private Long updater;
@Column(name = "update_time")
private Date updateTime;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Long getChannelId() {
return channelId;
}
public void setChannelId(Long channelId) {
this.channelId = channelId;
}
public Integer getIsSearch() {
return isSearch;
}
public void setIsSearch(Integer isSearch) {
this.isSearch = isSearch;
}
public Integer getIsEnum() {
return isEnum;
}
public void setIsEnum(Integer isEnum) {
this.isEnum = isEnum;
}
public Integer getIsRequired() {
return isRequired;
}
public void setIsRequired(Integer isRequired) {
this.isRequired = isRequired;
}
public Integer getSort() {
return sort;
}
public void setSort(Integer sort) {
this.sort = sort;
}
public Long getCreator() {
return creator;
}
public void setCreator(Long creator) {
this.creator = creator;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Long getUpdater() {
return updater;
}
public void setUpdater(Long updater) {
this.updater = updater;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public Integer getIsMult() {
return isMult;
}
public void setIsMult(Integer isMult) {
this.isMult = isMult;
}
public Integer getIsDetailSearch() {
return isDetailSearch;
}
public void setIsDetailSearch(Integer isDetailSearch) {
this.isDetailSearch = isDetailSearch;
}
public Integer getProdDetailShow() {
return prodDetailShow;
}
public void setProdDetailShow(Integer prodDetailShow) {
this.prodDetailShow = prodDetailShow;
}
public Integer getDetailParamShow() {
return detailParamShow;
}
public void setDetailParamShow(Integer detailParamShow) {
this.detailParamShow = detailParamShow;
}
}
| [
"1054490510@qq.com"
] | 1054490510@qq.com |
12a830609c32a44ec06da2ed66817747aa52d08f | f4fd782488b9cf6d99d4375d5718aead62b63c69 | /com/planet_ink/coffee_mud/Abilities/Properties/Prop_LanguageSpeaker.java | 73d8e77eb0a9a3292578e583f4add029c5a1718c | [
"Apache-2.0"
] | permissive | sfunk1x/CoffeeMud | 89a8ca1267ecb0c2ca48280e3b3930ee1484c93e | 0ac2a21c16dfe3e1637627cb6373d34615afe109 | refs/heads/master | 2021-01-18T11:20:53.213200 | 2015-09-17T19:16:30 | 2015-09-17T19:16:30 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,781 | java | package com.planet_ink.coffee_mud.Abilities.Properties;
import com.planet_ink.coffee_mud.core.interfaces.*;
import com.planet_ink.coffee_mud.core.*;
import com.planet_ink.coffee_mud.core.collections.*;
import com.planet_ink.coffee_mud.Abilities.interfaces.*;
import com.planet_ink.coffee_mud.Areas.interfaces.*;
import com.planet_ink.coffee_mud.Behaviors.interfaces.*;
import com.planet_ink.coffee_mud.CharClasses.interfaces.*;
import com.planet_ink.coffee_mud.Commands.interfaces.*;
import com.planet_ink.coffee_mud.Common.interfaces.*;
import com.planet_ink.coffee_mud.Exits.interfaces.*;
import com.planet_ink.coffee_mud.Items.interfaces.*;
import com.planet_ink.coffee_mud.Libraries.interfaces.MaskingLibrary;
import com.planet_ink.coffee_mud.Locales.interfaces.*;
import com.planet_ink.coffee_mud.MOBS.interfaces.*;
import com.planet_ink.coffee_mud.Races.interfaces.*;
import java.util.*;
/*
Copyright 2010-2015 Bo Zimmerman
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
public class Prop_LanguageSpeaker extends Property
{
@Override public String ID() { return "Prop_LanguageSpeaker"; }
@Override public String name(){ return "Forces language speaking";}
@Override protected int canAffectCode(){return Ability.CAN_ROOMS|Ability.CAN_AREAS|Ability.CAN_MOBS|Ability.CAN_ITEMS;}
protected boolean doPlayers=false;
protected boolean noMobs=false;
protected boolean homeOnly=false;
protected MaskingLibrary.CompiledZapperMask mobMask = null;
protected Language lang = null;
protected String langStr = "";
private final Room homeRoom = null;
private final Area homeArea = null;
private CMClass.CMObjectType affectedType = CMClass.CMObjectType.AREA;
@Override
public void setMiscText(String txt)
{
doPlayers=CMParms.getParmBool(txt,"PLAYERS",false);
noMobs=CMParms.getParmBool(txt,"NOMOBS",false);
homeOnly=CMParms.getParmBool(txt,"HOMEONLY",false);
langStr=CMParms.getParmStr(txt,"LANGUAGE","").trim();
final int x=txt.indexOf(';');
mobMask=null;
if((x>=0)&&(txt.substring(x+1).trim().length()>0))
mobMask=CMLib.masking().getPreCompiledMask(txt.substring(x+1).trim());
lang=null;
super.setMiscText(txt);
}
@Override
public void setAffectedOne(Physical P)
{
affectedType = CMClass.getType(P);
super.setAffectedOne(P);
}
public Language getLanguage()
{
if((lang == null)&&(langStr.trim().length()>0))
{
lang=(Language)CMClass.getAbility(langStr.trim());
langStr="";
}
return lang;
}
@Override
public String accountForYourself()
{
return "Forces speaking the language: "+((lang!=null)?lang.name():"?");
}
public void startSpeaking(MOB mob)
{
final Room mobHomeRoom=mob.getStartRoom();
final Area mobHomeArea=((mobHomeRoom==null)?null:mobHomeRoom.getArea());
if(((lang!=null)||(langStr.length()>0))
&&(doPlayers || mob.isMonster())
&&((!noMobs) || (!mob.isMonster()))
&&((!homeOnly) || (homeRoom==null) || (mobHomeRoom == homeRoom))
&&((!homeOnly) || (homeArea==null) || (mobHomeArea == homeArea))
&&(mob.fetchEffect(langStr)==null)
&&((mobMask==null) || CMLib.masking().maskCheck(mobMask,mob,true)))
{
if(lang == null)
lang = getLanguage();
if(lang == null)
{
lang=(Language)CMClass.getAbility("Common");
Log.errOut("Prop_LanguageSpeaker","Unknown language "+langStr);
}
if(lang != null)
{
switch(affectedType)
{
case AREA:
lang=(Language)lang.copyOf();
break;
case LOCALE:
lang=(Language)lang.copyOf();
break;
case MOB:
break;
case EXIT:
lang=(Language)lang.copyOf();
break;
default: // item
break;
}
mob.addNonUninvokableEffect(lang);
lang.setSavable(false);
lang.invoke(mob,mob,false,0);
}
}
}
@Override
public void executeMsg(final Environmental myHost, final CMMsg msg)
{
if(affected!=null)
switch(affectedType)
{
case AREA:
{
if(msg.targetMinor()==CMMsg.TYP_ENTER)
startSpeaking(msg.source());
else
if(msg.sourceMinor()==CMMsg.TYP_LIFE)
startSpeaking(msg.source());
break;
}
case LOCALE:
{
if((msg.target() == affected)
&&(msg.targetMinor()==CMMsg.TYP_ENTER))
startSpeaking(msg.source());
else
if(msg.sourceMinor()==CMMsg.TYP_LIFE)
startSpeaking(msg.source());
break;
}
case MOB:
{
if(lang==null)
startSpeaking((MOB)affected);
break;
}
case EXIT:
{
if((msg.targetMinor()==CMMsg.TYP_ENTER)
&&(msg.tool()==affected))
startSpeaking(msg.source());
break;
}
default: // item
{
if((msg.target() == affected)
&&(msg.targetMinor()==CMMsg.TYP_GET)
&&((lang==null)||(lang.affecting()!=msg.source())))
{
if((lang!=null)&&(lang.affecting()!=null))
lang.affecting().delEffect(lang);
startSpeaking(msg.source());
}
else
if((msg.target() == affected)
&&(msg.targetMinor()==CMMsg.TYP_DROP)
&&(lang!=null)
&&(lang.affecting()!=null))
{
lang.affecting().delEffect(lang);
lang.setAffectedOne(null);
}
break;
}
}
super.executeMsg(myHost,msg);
}
}
| [
"bo@zimmers.net"
] | bo@zimmers.net |
1d9e70f00bbd4dd9c70f839925139fa8872761d6 | 8f5c2096db1b493fc7ad6e84688cb6afe8edb649 | /PracticaFinalDejean/src/playlist/OtrosMetodos.java | e0b22f488caef120c290c7cc0e0de945d57f400a | [] | no_license | maxi-89/RepasoFinalDejean | b433cac7a6a16ca56853354f99dd4675ef0307a3 | 9f5016e2788f10dae0294b01b383a1e08ea2e415 | refs/heads/master | 2020-11-23T18:27:11.252491 | 2019-12-13T13:22:27 | 2019-12-13T13:22:27 | 227,766,325 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 4,424 | java | /**package playlist;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Scanner;
import java.util.TreeMap;
public class OtrosMetodos {
public static void descubrirNombresRepetidos(String miArchivo) throws IOException {
int cantNombres;
int cantRepetidos;
Map<String, Integer> nombres = new TreeMap<String, Integer>();
TreeMap< Integer,String> repetidos = new TreeMap<Integer,String>();
Scanner sc = new Scanner(new File(miArchivo));
cantNombres=sc.nextInt();
cantRepetidos=sc.nextInt();
for(int i=0;i<cantNombres;i++){
String nom = sc.next();
int cantidad=0;
if(nombres.containsKey(nom)){
cantidad = nombres.get(nom);
nombres.put(nom, cantidad+1);
}
else
nombres.put(nom, 1);
}
sc.close();
for (Entry<String, Integer> nombre : nombres.entrySet())
repetidos.put(nombre.getValue(), nombre.getKey());
PrintWriter s = new PrintWriter(new FileWriter("repetidos.out"));
for(int k=1; k<=cantRepetidos;k++){
Entry<Integer,String> salida=repetidos.pollLastEntry();
s.println(salida.getValue()+" "+salida.getKey());
}
s.close();
}
public void ListaDePrecios (){
LinkedList<Articulo> lista = new LinkedList <Articulo>();
public void cargarArticulo(int numero, double precio){
lista.add(new Articulo(numero, precio));
}
public double devuelvePrecio(int numero){
double aux=0;
for(Articulo a: lista){
if(numero == a.getNumero()){
aux=a.getPrecio();
}
}
return aux;
}
public double caclProm(Articulo articulo){
double suma=0;
int cont=0;
for(Articulo a: lista){
suma=suma+a.getPrecio();
cont++;
}
return suma/cont;
}
public double precioMaximo(int numero){
Articulo aux;
double max = 0,auxD;
aux=lista.peekFirst();
for(Articulo a: lista){
if(aux.getPrecio()<a.getPrecio()){
max=a.getPrecio();
}
}
return max;
}
public int cuentaCant(double precio1, double precio2){
int cont=0;
for(Articulo b:lista){
if((b.getPrecio()>precio1)&&(b.getPrecio()<precio2)){
cont++;
}
}
return cont;
}
}
public void supermercado() {
TreeMap<Integer, Cliente> filaA = new TreeMap<Integer, Cliente>();
TreeMap<Integer, Cliente> filaB = new TreeMap<Integer, Cliente>();
TreeMap<Integer, Cliente> filaTemp = new TreeMap<Integer, Cliente>();
Cliente maxi=new Cliente(5); filaA.put(1,maxi);
Cliente jose=new Cliente(10); filaA.put(2, jose);
Cliente nahuel=new Cliente(2); filaA.put(3, nahuel);
Cliente lucas=new Cliente(6); filaA.put(4, lucas);
Cliente nico=new Cliente(8); filaA.put(5, nico);
Cliente mati=new Cliente(1); filaA.put(6, mati);
Cliente juan=new Cliente(3); filaA.put(7, juan);
Cliente gabriel=new Cliente(12); filaA.put(8, gabriel);
Cliente esteban=new Cliente(4); filaA.put(9, esteban);
Cliente gian=new Cliente(9); filaA.put(10, gian);
for (Entry<Integer, Cliente> cliente : filaA.entrySet())
{
System.out.println("Cliente de la fila A, en la posicion "+cliente.getKey()+", posee "+cliente.getValue()+" productos.");
}
int cont = 1;
int cont2 = 1;
//Aquellos clientes que tengan menos de 5 productos pasan a la fila B
for (Entry<Integer, Cliente> cliente : filaA.entrySet())
{
if(cliente.getValue().getCantProductos()<5) {
filaB.put(cont, cliente.getValue());
cont++;
}else {
//Aquellos clientes que tengan mas de 5 productos pasan a la fila Temporal
filaTemp.put(cont2, cliente.getValue());
cont2++;
}
}
//Limpio la fila A y le asigno los clientes con mas de 5 productos
filaA.clear();
//Clonamos el mapa
filaA = (TreeMap)filaTemp.clone();
//Limpio la fila temporal.
filaTemp.clear();
System.out.println();
for (Entry<Integer, Cliente> cliente : filaA.entrySet())
{
System.out.println("Cliente de la fila A, en la posicion "+cliente.getKey()+", posee "+cliente.getValue().getCantProductos()+" productos.");
}
System.out.println();
for (Entry<Integer, Cliente> cliente : filaB.entrySet())
{
System.out.println("Cliente de la fila B, en la posicion "+cliente.getKey()+", posee "+cliente.getValue().getCantProductos()+" productos.");
}
}}
**/
| [
"maxirodriguez@maxirodriguez-VJF155F11UAR"
] | maxirodriguez@maxirodriguez-VJF155F11UAR |
56b5817af832cabff6927595d4043158787c46e8 | 1193bc051f813f6533bef4e9d45a448c83a23531 | /src/main/java/net/htjs/blog/entity/SysPermission.java | 20c26f9a724e2537cae09a3fe0dc95b565730397 | [] | no_license | jiyulongxu/blog | cdf5d468601d6d52e364e6aafa5654dc67a4af33 | b4131a9baa77e288b119f79bc596b26c9c0f8d99 | refs/heads/master | 2020-03-27T07:15:34.785948 | 2018-08-25T02:28:56 | 2018-08-25T02:28:56 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 647 | java | package net.htjs.blog.entity;
import lombok.Getter;
import lombok.Setter;
import java.util.Date;
/**
* blog/net.htjs.blog.entity
*
* @Description:
* @Author: dingdongliang
* @Date: 2018/8/13 17:35
*/
@Getter
@Setter
public class SysPermission extends BaseDomain {
private String pmsnId;
private String menuName;
private String menuCode;
private String prntId;
private String prntName;
private String pmsnCode;
private String pmsnName;
private String pmsnType = "menu";
private String status = "E";
private String pmsnUrl;
private String pmsnDesc;
private String required = "N";
} | [
"Ks10Kslhk"
] | Ks10Kslhk |
eef5776646a16df25ccb6b68f15dfdca41682dde | f7a0cd516f20d3cf58d643926a6a71fae69020f4 | /src/main/java/org/eumetsat/metop/sounder/FlagReader.java | e8ca88cf7e3baa57f06ff55b4a74df374456e357 | [] | no_license | bcdev/metop-sounder-tools | 52d6166dd9f775207e0fced6958a0c00fc7cdd5f | ac0b1f20b136388c3c3feece17f20141bab1afbb | refs/heads/master | 2020-05-24T05:50:25.584835 | 2017-03-13T13:14:26 | 2017-03-13T13:14:26 | 84,827,981 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,568 | java | /*
* $Id: $
*
* Copyright (C) 2009 by Brockmann Consult (info@brockmann-consult.de)
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation. This program is distributed in the hope 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.
*/
package org.eumetsat.metop.sounder;
import com.bc.ceres.binio.CompoundData;
import com.bc.ceres.binio.SequenceData;
import org.esa.beam.framework.datamodel.ProductData;
import java.io.IOException;
public class FlagReader implements MdrReader {
private final String memberName;
public FlagReader(String memberName) {
this.memberName = memberName;
}
@Override
public int read(int x, int width, ProductData buffer, int bufferIndex, CompoundData mdr) throws IOException {
SequenceData dataSequence = mdr.getSequence(memberName);
for (int xi = x; xi < x + width; xi++) {
short value = dataSequence.getShort(xi);
buffer.setElemIntAt(bufferIndex, value);
bufferIndex++;
}
return bufferIndex;
}
}
| [
"marcoz@fc2be322-dc32-0410-aa07-d0f95ae639be"
] | marcoz@fc2be322-dc32-0410-aa07-d0f95ae639be |
4886525992c5eff7721ac1caa08b4d1193dcb1f0 | 9374735a873b24244b6e382f931a599e157be645 | /gen/com/cs314/p4/R.java | 0a729eae174950be5d72f0fba61e480c8f867eb2 | [] | no_license | Mamill42/p4android | e74c30ddd44ab78385f69e646b3bfc9ee7535628 | e5adcc2432c80d08252569ff213359ac4a92c262 | refs/heads/master | 2016-09-05T20:35:29.286820 | 2014-11-30T21:59:05 | 2014-11-30T21:59:05 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,495 | java | /* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* aapt tool from the resource data it found. It
* should not be modified by hand.
*/
package com.cs314.p4;
public final class R {
public static final class attr {
}
public static final class dimen {
/** Default screen margins, per the Android Design guidelines.
Example customization of dimensions originally defined in res/values/dimens.xml
(such as screen margins) for screens with more than 820dp of available width. This
would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively).
*/
public static final int activity_horizontal_margin=0x7f040000;
public static final int activity_vertical_margin=0x7f040001;
}
public static final class drawable {
public static final int ic_launcher=0x7f020000;
}
public static final class id {
public static final int action_settings=0x7f08000e;
public static final int button_answer=0x7f080009;
public static final int button_back=0x7f080007;
public static final int button_done=0x7f08000a;
public static final int button_next=0x7f080008;
public static final int question_content_text_view=0x7f080001;
public static final int question_number_text_view=0x7f080000;
public static final int radio_fifth=0x7f080006;
public static final int radio_first=0x7f080002;
public static final int radio_fourth=0x7f080005;
public static final int radio_second=0x7f080003;
public static final int radio_third=0x7f080004;
public static final int textView1=0x7f08000b;
public static final int textView2=0x7f08000c;
public static final int textView3=0x7f08000d;
}
public static final class layout {
public static final int activity_main=0x7f030000;
public static final int activity_question=0x7f030001;
public static final int activity_statistics=0x7f030002;
}
public static final class menu {
public static final int main=0x7f070000;
public static final int question=0x7f070001;
public static final int statistics=0x7f070002;
}
public static final class string {
public static final int action_settings=0x7f050001;
public static final int answer_fifth=0x7f05000d;
public static final int answer_first=0x7f050009;
public static final int answer_fourth=0x7f05000c;
public static final int answer_second=0x7f05000a;
public static final int answer_third=0x7f05000b;
public static final int app_name=0x7f050000;
public static final int attempted_questions_text=0x7f05000f;
public static final int button_start=0x7f050005;
public static final int correct_questions_text=0x7f050010;
public static final int hello_world=0x7f050003;
public static final int question_content=0x7f050007;
public static final int question_number=0x7f050008;
public static final int splash_string=0x7f050004;
public static final int title_activity_main=0x7f050002;
public static final int title_activity_question=0x7f050006;
public static final int title_activity_statistics=0x7f05000e;
public static final int total_questions_text=0x7f050011;
}
public static final class style {
/**
Base application theme, dependent on API level. This theme is replaced
by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
Theme customizations available in newer API levels can go in
res/values-vXX/styles.xml, while customizations related to
backward-compatibility can go here.
Base application theme for API 11+. This theme completely replaces
AppBaseTheme from res/values/styles.xml on API 11+ devices.
API 11 theme customizations can go here.
Base application theme for API 14+. This theme completely replaces
AppBaseTheme from BOTH res/values/styles.xml and
res/values-v11/styles.xml on API 14+ devices.
API 14 theme customizations can go here.
*/
public static final int AppBaseTheme=0x7f060000;
/** Application theme.
All customizations that are NOT specific to a particular API-level can go here.
*/
public static final int AppTheme=0x7f060001;
}
}
| [
"mamill42@rams.colostate.edu"
] | mamill42@rams.colostate.edu |
12a177cc6d4183e1149eae09e5bd14dc3af70631 | 622dce249f6052f864e42aa1d13194b7ec26abba | /src/main/java/zadania_5/kolekcje_listy/zad6_DOKONCZ/Main.java | dc3bdb59aa6d8623aa169393dbbd829c784ecf80 | [] | no_license | DorotaPotulska/HomeworkFromTheCourseSDA | d14aaaf5d0e235a033072af40c385398021eea97 | d88c32ea3bcd6e7412bb624bbc154e520446acf2 | refs/heads/master | 2022-07-26T01:57:53.782654 | 2020-05-14T17:22:58 | 2020-05-14T17:22:58 | 263,979,409 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,296 | java | package zadania_5.kolekcje_listy.zad6_DOKONCZ;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/*6. Stwórz aplikację, a w niej klasę Dziennik i student .
Stwórz również klasę Student. Klasa Student powinna:
- posiadać listę ocen studenta (List<Double>)
- posiadać (pole) numer indeksu studenta (String)
- posiadać (pole) imię studenta
- posiadać (pole) nazwisko studenta
Klasa Dziennik powinna:
- posiadać (jako pole) listę Studentów.
- posiadać metodę 'dodajStudenta(Student):void' do dodawania nowego studenta do dziennika
- posiadać metodę 'usuńStudenta(Student):void' do usuwania studenta
- posiadać metodę 'usuńStudenta(String):void' do usuwania studenta po jego numerze indexu
- posiadać metodę 'zwróćStudenta(String):Student' która jako parametr przyjmuje numer indexu studenta,
a w wyniku zwraca konkretnego studenta.
- posiadać metodę 'podajŚredniąStudenta(String):double'
która przyjmuje indeks studenta i zwraca średnią ocen studenta.
- posiadać metodę 'podajStudentówZagrożonych():List<Student>'
- posiadać metodę 'posortujStudentówPoIndeksie():List<Student>'
- która sortuje listę studentów po numerach indeksów, a następnie zwraca posortowaną listę.
Polecenia VarArgs:
- dodanie kilku studentów - usunięcie kilku studentów
- wyszukiwanie studentów (i zwrócenie znalezionych w liście)
- dodanie/usuwanie ocen studentom
Wszystkie polecenia zrealizowane jako VarArgs.*/
public class Main {
public static void main(String[] args) {
List<Student> studenci = new ArrayList<>();
Dziennik dziennik=new Dziennik(studenci);
Student student1=new Student(Arrays.asList(2.0,4.0,6.0),"99204","Dorota","Potulska");
Student student2=new Student(Arrays.asList(5.0,4.0,6.0),"99111","Piotr","Potulski");
Student student3=new Student(Arrays.asList(2.0,1.0,1.0),"99222","Maks","Potulski");
Student student4=new Student(Arrays.asList(2.0,4.0,6.0,2.0),"99333","Nastka","Potulska");
/* dziennik.dodajStudenta(student1);
dziennik.dodajStudenta(student2);
dziennik.dodajStudenta(student3);
dziennik.dodajStudenta(student4);*/
//System.out.println(dziennik);
// dziennik.usunStudenta(student1);
//System.out.println(dziennik);
///dziennik.usunStudenta("99333");
/* System.out.println(dziennik);
System.out.println(dziennik.zwrocStudenta("99111"));
System.out.println(dziennik.podajŚredniąStudenta("99111"));
System.out.println(dziennik.podajStudentowZagrozonych());
System.out.println(dziennik.posortujStudentówPoIndeksie());*/
//////////////////VarARGS
dziennik.dodajStudenta2(student1,student2,student3,student4);
System.out.println(dziennik);
dziennik.usunStudenta2(student1,student4);
System.out.println(dziennik);
System.out.println(dziennik.zwrocStudenta2("99111", "99222"));
System.out.println(dziennik);
dziennik.dodajOcene("99111",5.0,6.0,4.0,3.5);
System.out.println(dziennik);
}
}
| [
"dorota-chajewska@wp.pl"
] | dorota-chajewska@wp.pl |
ea4253133f46cf215787f8891fdd38b915188030 | 0e06e096a9f95ab094b8078ea2cd310759af008b | /sources/rx/observers/Observers.java | 6444963cd8878fe16829fe2e07dad33059cb7769 | [] | no_license | Manifold0/adcom_decompile | 4bc2907a057c73703cf141dc0749ed4c014ebe55 | fce3d59b59480abe91f90ba05b0df4eaadd849f7 | refs/heads/master | 2020-05-21T02:01:59.787840 | 2019-05-10T00:36:27 | 2019-05-10T00:36:27 | 185,856,424 | 1 | 2 | null | 2019-05-10T00:36:28 | 2019-05-09T19:04:28 | Java | UTF-8 | Java | false | false | 2,943 | java | package rx.observers;
import rx.Observer;
import rx.exceptions.OnErrorNotImplementedException;
import rx.functions.Action0;
import rx.functions.Action1;
public final class Observers {
private static final Observer<Object> EMPTY = new C33261();
/* renamed from: rx.observers.Observers$1 */
static class C33261 implements Observer<Object> {
C33261() {
}
public final void onCompleted() {
}
public final void onError(Throwable e) {
throw new OnErrorNotImplementedException(e);
}
public final void onNext(Object args) {
}
}
private Observers() {
throw new IllegalStateException("No instances!");
}
public static <T> Observer<T> empty() {
return EMPTY;
}
public static <T> Observer<T> create(final Action1<? super T> onNext) {
if (onNext != null) {
return new Observer<T>() {
public final void onCompleted() {
}
public final void onError(Throwable e) {
throw new OnErrorNotImplementedException(e);
}
public final void onNext(T args) {
onNext.call(args);
}
};
}
throw new IllegalArgumentException("onNext can not be null");
}
public static <T> Observer<T> create(final Action1<? super T> onNext, final Action1<Throwable> onError) {
if (onNext == null) {
throw new IllegalArgumentException("onNext can not be null");
} else if (onError != null) {
return new Observer<T>() {
public final void onCompleted() {
}
public final void onError(Throwable e) {
onError.call(e);
}
public final void onNext(T args) {
onNext.call(args);
}
};
} else {
throw new IllegalArgumentException("onError can not be null");
}
}
public static <T> Observer<T> create(final Action1<? super T> onNext, final Action1<Throwable> onError, final Action0 onComplete) {
if (onNext == null) {
throw new IllegalArgumentException("onNext can not be null");
} else if (onError == null) {
throw new IllegalArgumentException("onError can not be null");
} else if (onComplete != null) {
return new Observer<T>() {
public final void onCompleted() {
onComplete.call();
}
public final void onError(Throwable e) {
onError.call(e);
}
public final void onNext(T args) {
onNext.call(args);
}
};
} else {
throw new IllegalArgumentException("onComplete can not be null");
}
}
}
| [
"querky1231@gmail.com"
] | querky1231@gmail.com |
f8e38c4c776d3538d31d1730bee626193d7ada5a | eeea2b91656bfb54c68d418807cf9ebb8296c986 | /src/main/java/pl/mobilkiwspa/avangarde/models/services/ServeService.java | e4f6c3fbef396f51132c8bdac11bbcb627cafc9c | [] | no_license | MaciejSzc/avangarde_backend_prototype | 7a0854dd0cdb1bbee2c3732b40a90292643f68c9 | b786b305a329707825a880a0c4a73c34dcb0d1ff | refs/heads/master | 2022-05-31T21:37:01.364999 | 2019-07-05T06:31:38 | 2019-07-05T06:31:38 | 194,565,798 | 0 | 0 | null | 2022-05-20T21:01:21 | 2019-06-30T22:09:03 | JavaScript | UTF-8 | Java | false | false | 1,449 | java | package pl.mobilkiwspa.avangarde.models.services;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import pl.mobilkiwspa.avangarde.models.entities.EmployeeEntity;
import pl.mobilkiwspa.avangarde.models.entities.ServeEntity;
import pl.mobilkiwspa.avangarde.models.forms.ServeForm;
import pl.mobilkiwspa.avangarde.models.repositories.ServeRepository;
import java.util.Optional;
@Service
public class ServeService {
@Autowired
ServeRepository serveRepository;
public Iterable<ServeEntity> getAll(){
return serveRepository.findAll();
}
public void addServe(ServeForm serveForm){
ServeEntity serveEntity = new ServeEntity();
serveEntity.setName(serveForm.getName());
serveEntity.setPrice(serveForm.getPrice());
serveEntity.setTime(serveForm.getTime());
serveRepository.save(serveEntity);
}
public void update(int id, ServeForm serveForm){
Optional<ServeEntity> serveEntity = serveRepository.findById(id);
if(serveEntity.isPresent()){
serveEntity.get().setName(serveForm.getName());
serveEntity.get().setPrice(serveForm.getPrice());
serveEntity.get().setTime(serveForm.getTime());
serveRepository.save(serveEntity.get());
}
}
public ServeEntity getServeById(int id){
return serveRepository.findById(id).get();
}
}
| [
"maciej.szczesny.orzesze@gmail.com"
] | maciej.szczesny.orzesze@gmail.com |
95631a8d6a9f20d5986946b42ce7fd2cebd45ac4 | 4b2be8355c1cbb93a2f90bcbd9b7732ae54ef82c | /src/main/java/chapter4/ex9ex11/Ref.java | 75cfa577d8bc55c76dfe4bf447bf2a15e8e5b2d3 | [] | no_license | DimaLaguta/Tasks | f16aa5a7229884dd979f682d9efac99cf7467940 | 08cebdbfb468f48113d64f3b1d3dca3644d1ba44 | refs/heads/master | 2022-11-26T19:08:35.240401 | 2020-03-28T22:09:23 | 2020-03-28T22:09:23 | 246,691,934 | 0 | 0 | null | 2022-11-16T00:53:58 | 2020-03-11T22:24:53 | Java | UTF-8 | Java | false | false | 1,412 | java | package chapter4.ex9ex11;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
public class Ref {
public static String ToString(Object object) throws IllegalAccessException {
String result = "";
Class classObject = object.getClass();
Field[] publicFields = classObject.getDeclaredFields();
for (Field i : publicFields) {
//Class c = Class.forName(i.getName());
i.setAccessible(true);
result += i.getName().toString() + " : " + i.get(object).toString() + "\n";
}
return result;
}
public static void helloWorld(String input) throws ClassNotFoundException, InvocationTargetException, IllegalAccessException {
//не работает
String system = "java.lang.System";
Class c = Class.forName(system);
Field[] fields = c.getFields();
for (Field i : fields) {
if (i.getName().equals("out")) {
Class c2 = Class.forName(i.getType().getName());
Method[] methods = c2.getMethods();
for (Method j : methods) {
if (j.getName().equals("println") && j.getParameterTypes()[0].toString().equals(input.getClass().toString())) {
j.invoke(c2);
}
}
}
}
}
}
| [
"dimalaguta4@gmail.com"
] | dimalaguta4@gmail.com |
952cfc9b301f132dd5db19f231868fd1ce402f86 | 082e26b011e30dc62a62fae95f375e4f87d9e99c | /docs/weixin_7.0.4_source/反编译源码/未反混淆/src/main/java/com/tencent/mm/plugin/webview/e/e.java | 02e153f07b7878b9e5bf2c13e07b8d38fe2aaf41 | [] | no_license | xsren/AndroidReverseNotes | 9631a5aabc031006e795a112b7ac756a8edd4385 | 9202c276fe9f04a978e4e08b08e42645d97ca94b | refs/heads/master | 2021-04-07T22:50:51.072197 | 2019-07-16T02:24:43 | 2019-07-16T02:24:43 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,928 | java | package com.tencent.mm.plugin.webview.e;
import android.content.Context;
import android.content.SharedPreferences.Editor;
import android.net.Uri;
import android.text.TextUtils;
import com.tencent.matrix.trace.core.AppMethodBeat;
import java.util.List;
import java.util.regex.Pattern;
public final class e {
public static void h(String str, Context context) {
AppMethodBeat.i(10146);
Editor edit = context.getSharedPreferences("webview_url_prefs", 4).edit();
edit.putString("url", str);
edit.apply();
AppMethodBeat.o(10146);
}
public static boolean agF(String str) {
AppMethodBeat.i(10147);
if (TextUtils.isEmpty(str)) {
AppMethodBeat.o(10147);
return false;
}
try {
List pathSegments = Uri.parse(str).getPathSegments();
if (pathSegments == null || pathSegments.size() <= 0) {
AppMethodBeat.o(10147);
return false;
}
String str2 = (String) pathSegments.get(pathSegments.size() - 1);
if (str2 != null && str2.toLowerCase().trim().endsWith(".apk")) {
AppMethodBeat.o(10147);
return true;
}
AppMethodBeat.o(10147);
return false;
} catch (Exception e) {
}
}
public static boolean agG(String str) {
AppMethodBeat.i(10148);
if (Pattern.compile("^(http|https)://mp.weixin.qq.com/(s|mp/author|mp/appmsg/show)", 2).matcher(str).find()) {
AppMethodBeat.o(10148);
return true;
} else if (Pattern.compile("^(http|https)://(sh.|hk.|sz.)?open.weixin.qq.com/connect/(confirm|oauth2/(authorize|explorer_authorize))", 2).matcher(str).find()) {
AppMethodBeat.o(10148);
return true;
} else {
AppMethodBeat.o(10148);
return false;
}
}
}
| [
"alwangsisi@163.com"
] | alwangsisi@163.com |
11586b8dec1bc76ad9c43f54f4b443000239717a | 85e1a5259fc6501ffb53b691e8a7891762727e56 | /AppDataLibrary/src/main/java/com/sn/app/net/data/app/XianYunApiService.java | 4f996c5e98bcc3aea1c717fd17a17abb7630ff87 | [] | no_license | sengeiou/New_And_WellGo | 32f30c509c03868bb9e5469811a7e9861ced90c1 | 80791b64d3127de5a0acc847f18b46462859028e | refs/heads/master | 2023-08-16T22:11:04.393563 | 2021-10-11T18:26:42 | 2021-10-11T18:26:42 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 128 | java | package com.sn.app.net.data.app;
/**
* 作者:东芝(2018/1/19).
* 功能:祥云
*/
public interface XianYunApiService {
}
| [
"758378737@qq.com"
] | 758378737@qq.com |
65b8980cd5c5b7b0e43bd98e2717b6112056e7d1 | 0a1b434de0434dbb50957eeb72ddf0819097691f | /app/src/main/java/com/hi/gpsmaps/fragment/RouteFragment.java | 883c504dbfeeedac8b88bb97fd756edf47ab082c | [] | no_license | NirajBhat/GpsMaps | 9ba694e86da97824c6b66da6326f5851433849f2 | 9b7c77209450f3832664f72e9fea1be62ca08e17 | refs/heads/master | 2020-03-23T22:02:00.108496 | 2018-07-24T11:45:39 | 2018-07-24T11:45:39 | 142,148,667 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,641 | java | package com.hi.gpsmaps.fragment;
import android.content.Context;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import com.hi.gpsmaps.R;
import java.util.ArrayList;
/**
* Created by hi on 22-06-2018.
*/
public class RouteFragment extends Fragment {
ArrayList<Long> routeData = new ArrayList<>();
ListView mListView;
Context mContext;
private RecyclerView.Adapter mAdapter;
private RecyclerView.LayoutManager layoutManager;
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.route,container,false);
mContext = getActivity();
String[] mRouteData = {"BENGALURU - MUMBAI","BENGALURU - DELHI","DELHI - AMRAVATI","BENGALURU - TIRUVANATAPURAM"
,"AMRAVATI - HYDERABAD","BANGALURU - CHENAI","DELHI - CHENAI","MUMBAI - DELHI","MUMBAI - CHENAI",
"HYDERABAD - BENGALURU","HYDERABAD - CHENAI","DELHI - HYDERABAD","HYDERABAD - GOA","GOA - BENGALURU","DELHI - GOA"
,"HYDERABAD - KOCHI","HYDERABAD - MUMBAI"};
ArrayAdapter adapter = new ArrayAdapter<String>(mContext,R.layout.route_data_list,mRouteData);
mListView = view.findViewById(R.id.route_list);
mListView.setAdapter(adapter);
return view;
}
}
| [
"nirajbhatpujari@gmail.com"
] | nirajbhatpujari@gmail.com |
f433aac803494c5a8bc7c082f489943cfa5a9437 | 1969c565c241182f4c41617c6ffee30ebad4cafc | /NotificationWS/src/main/java/com/servercentral/communication/hub/job/MainClass.java | e321124f127837a5cece3217722d927f0a1b80f7 | [] | no_license | rahatjaan/NotificationHub | 222a1bcd821000b06e51be700aafbfb62769c29e | 50cd664141fe0888c3dc48fc429ce3e53c1d4c7f | refs/heads/master | 2021-01-22T20:49:24.224725 | 2013-12-16T11:59:41 | 2013-12-16T11:59:41 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 507 | java | package com.servercentral.communication.hub.job;
import org.springframework.context.support.ClassPathXmlApplicationContext;
public class MainClass {
public static void main(String[] args) {
new ClassPathXmlApplicationContext("spring\\spring-config.xml");
/// new ClassPathXmlApplicationContext("schedule-basicUsageFixedDelay-example.xml");
// new ClassPathXmlApplicationContext("schedule-xmlConfig-example.xml");
// new ClassPathXmlApplicationContext("schedule-PropertiesConfig-example.xml");
}
}
| [
"rahat.jaan@gmail.com"
] | rahat.jaan@gmail.com |
70c0f3a2621858d0925ed7714c703f9847e03f8e | 3c629c4bec16c1ec07e8ad3973eddad7d018a229 | /src/com/conducivetech/cache/airports/v1/AirportByFsCodeResponse.java | 62034e21af731a1e54d0f8481b86b46aa362397a | [] | no_license | carlovendiola/HappyHeavenWebApp | 61f7e1906811b2223e8fd88a71f4126b3e57f561 | b42eeb5771eef893d8f7fb3b85ef6f69890c6313 | refs/heads/master | 2020-05-23T08:01:32.388034 | 2017-07-13T00:58:27 | 2017-07-13T00:58:27 | 80,487,179 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,899 | java |
package com.conducivetech.cache.airports.v1;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for airportByFsCodeResponse complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="airportByFsCodeResponse">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="return" type="{http://v1.airports.cache.conducivetech.com/}airport" maxOccurs="unbounded" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "airportByFsCodeResponse", propOrder = {
"_return"
})
public class AirportByFsCodeResponse {
@XmlElement(name = "return")
protected List<Airport> _return;
/**
* Gets the value of the return property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the return property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getReturn().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link Airport }
*
*
*/
public List<Airport> getReturn() {
if (_return == null) {
_return = new ArrayList<Airport>();
}
return this._return;
}
}
| [
"carlovendiola5287@gmail.com"
] | carlovendiola5287@gmail.com |
9204f2df4f31abadc952346a86c85220fff34bac | 1867e64fba84ddbb318e48086b3d68e193aa8945 | /com.tdd/src/test/java/Runner/Test_Runner.java | 5ffb4cab349d9788b61f6cc2604b8bd741b88789 | [] | no_license | UmaMahiswari/FinalTestNG | 514d8905d4f7a58fbf66797ff7e1f22802a3d912 | 9cf1a922d01a51ecc22067515929577ba2d5ae62 | refs/heads/master | 2020-03-27T14:29:52.724727 | 2018-08-29T22:27:49 | 2018-08-29T22:27:49 | 146,665,686 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 373 | java | package Runner;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;
public class Test_Runner {
@Test
public void test()
{
System.out.println("");
}
@BeforeTest
public void beforeTest()
{
System.out.println("");
}
@AfterTest
public void afterTest(){
System.out.println("");
}
}
| [
"umamahiswari.r@gmail.com"
] | umamahiswari.r@gmail.com |
f1392bb2558fc1c5c52c09de88faf46c2568d201 | fe7fe709bdfc8316a89c32a0dfc405e515cd63cb | /product/src/main/java/io/github/thesixonenine/product/service/SpuCommentService.java | 0d8b164d9ce44714271cd70ac4b33e2bfa11cf62 | [
"MIT"
] | permissive | thesixonenine/619 | 70aeab40abef98a3d38600d7300fec394139ad75 | f8b9d44f77a2eb81bd1fec6d747d8860433b0d2c | refs/heads/master | 2023-02-08T03:26:35.156276 | 2020-12-27T16:04:10 | 2020-12-27T16:04:10 | 269,237,555 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 463 | java | package io.github.thesixonenine.product.service;
import com.baomidou.mybatisplus.extension.service.IService;
import io.github.thesixonenine.common.utils.PageUtils;
import io.github.thesixonenine.product.entity.SpuCommentEntity;
import java.util.Map;
/**
* 商品评价
*
* @author thesixonenine
* @date 2020-06-06 00:59:35
*/
public interface SpuCommentService extends IService<SpuCommentEntity> {
PageUtils queryPage(Map<String, Object> params);
}
| [
"huyang1994822@gmail.com"
] | huyang1994822@gmail.com |
8b5acc037796be9667f204de32aca4a643119815 | fac77f817341a0015f659d39122ea3cd9c123ace | /src/test/java/mybatisPlus/MybatisPlusGenerate.java | bc996f23620c44c1114218e336c1e3cb6dfa1ea1 | [] | no_license | xuchen93/MyManage | 8a996de6162546bfb7055a182134668bd8763ede | 1dff73b9c0f6af0d00d3930f0d64183e252c7c87 | refs/heads/master | 2021-09-22T11:08:02.052485 | 2018-09-09T03:21:20 | 2018-09-09T03:21:20 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,217 | java | package mybatisPlus;
import com.baomidou.mybatisplus.generator.AutoGenerator;
import com.baomidou.mybatisplus.generator.config.DataSourceConfig;
import com.baomidou.mybatisplus.generator.config.GlobalConfig;
import com.baomidou.mybatisplus.generator.config.PackageConfig;
import com.baomidou.mybatisplus.generator.config.StrategyConfig;
import com.baomidou.mybatisplus.generator.config.rules.DbType;
import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
import org.junit.Test;
import java.io.File;
/**
* 生成相关代码
*/
public class MybatisPlusGenerate {
/**
* 数据库表名
*/
protected static String[] tableNames = {"order"};
/**
* 项目路径
*/
protected static String projectPath = "D:\\git\\MyManage\\src\\main\\java";
/**
* 包名称
*/
protected static String packageName = "com.xuchen";
/**
* 作者
*/
protected static String author = "xuchen";
/**
* 生成controller通用模版(需手动微调)
*/
protected static boolean createController = true;
protected static String dbUrl = "jdbc:mysql://localhost:3306/manage";
protected static String dbName = "root";
protected static String dbPassword = "xuchen93";
protected static String driverName = "com.mysql.jdbc.Driver";
protected static boolean serviceNameStartWithI = false;//user -> UserService, 设置成true: user -> IUserService
@Test
public void generateCode() throws Exception {
boolean checkControllerFile = checkControllerFile(tableNames);
if (!checkControllerFile) {
return;
}
generateByTables(serviceNameStartWithI, packageName, tableNames);
GenerateUtil.moveMapperXmlFile(projectPath, packageName);
for (String tableName : tableNames) {
TableNameInfo tableNameInfo = GenerateUtil.getTableNameInfo(tableName,projectPath,packageName);
if (createController) {
GenerateUtil.createControllerFile(tableNameInfo,projectPath);
}
GenerateUtil.createHtmlFile(tableNameInfo,projectPath);
}
}
private void generateByTables(boolean serviceNameStartWithI, String packageName, String... tableNames) {
GlobalConfig config = new GlobalConfig();
DataSourceConfig dataSourceConfig = new DataSourceConfig();
dataSourceConfig.setDbType(DbType.MYSQL)
.setUrl(dbUrl)
.setUsername(dbName)
.setPassword(dbPassword)
.setDriverName(driverName);
StrategyConfig strategyConfig = new StrategyConfig();
strategyConfig
.setCapitalMode(true)
.setEntityLombokModel(false)
.setDbColumnUnderline(true)
.setNaming(NamingStrategy.underline_to_camel)
.setInclude(tableNames);//修改替换成你需要的表名,多个表名传数组
config.setActiveRecord(false)
.setAuthor(author)
.setOutputDir(projectPath)
.setFileOverride(true)
.setEnableCache(false)
;
if (!serviceNameStartWithI) {
config.setServiceName("%sService");
}
new AutoGenerator().setGlobalConfig(config)
.setDataSource(dataSourceConfig)
.setStrategy(strategyConfig)
.setPackageInfo(
new PackageConfig()
.setParent(packageName)
.setController("controller")
.setEntity("entity")
).execute();
}
private static boolean checkControllerFile(String... tableNames) {
for (String tableName : tableNames) {
File file = new File(projectPath + "\\" + packageName.replace(".", "\\") + "\\controller\\" + GenerateUtil.toJavaName(true, tableName) + "Controller.java");
if (file.exists()) {
System.out.println("已经存在" + tableName + "表的Controller文件,如确定使用生成的,请先删除该文件");
return false;
}
}
return true;
}
}
| [
"599268367@qq.com"
] | 599268367@qq.com |
a55636edfcdecd011d97fd437048097bdabb7705 | c55090010a2cf1b3d91a89f073de6a052854c105 | /src/main/java/com/gdosoftware/mercadopago/domain/MPPreference.java | 11dfee0db3fcbfdfa0d1bc4802ae16cc4f827e8a | [] | no_license | gdosoftware/mercadopagos | febf3979d586008b11e06c7920eabe9299398884 | 37d85c779245b78780411e929ff5c363628b34a6 | refs/heads/master | 2021-04-15T18:00:35.527910 | 2018-04-11T17:52:34 | 2018-04-11T17:52:34 | 126,530,100 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,186 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.gdosoftware.mercadopago.domain;
import java.util.Date;
/**
*
* @author Daniel Gago
*/
public class MPPreference {
private String id;
private MPItem[] items;
private String additional_info;
private String auto_return;//approved / all
private Boolean expires;
private String expiration_date_to; //Date(ISO_8601)
private String notification_url;
private MPBackUrls back_urls;
private String init_point;
public MPItem[] getItems() {
return items;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public void setItems(MPItem[] items) {
this.items = items;
}
public String getAdditional_info() {
return additional_info;
}
public void setAdditional_info(String additional_info) {
this.additional_info = additional_info;
}
public String getAuto_return() {
return auto_return;
}
public void setAuto_return(String auto_return) {
this.auto_return = auto_return;
}
public Boolean getExpires() {
return expires;
}
public void setExpires(Boolean expires) {
this.expires = expires;
}
public String getExpiration_date_to() {
return expiration_date_to;
}
public void setExpiration_date_to(String expiration_date_to) {
this.expiration_date_to = expiration_date_to;
}
public String getNotification_url() {
return notification_url;
}
public void setNotification_url(String notification_url) {
this.notification_url = notification_url;
}
public MPBackUrls getBack_urls() {
return back_urls;
}
public void setBack_urls(MPBackUrls back_urls) {
this.back_urls = back_urls;
}
public String getInit_point() {
return init_point;
}
public void setInit_point(String init_point) {
this.init_point = init_point;
}
}
| [
"Dani@Daniel-PC"
] | Dani@Daniel-PC |
fe73896c7ba992782fbbfb83e3bb516a91ac9503 | 97ecee3e3df91630105e96c1d171bafee91b582f | /CSC 307/IntelliJ TestTool Collection/TestToolv8/TestTool/Model/TestBank/StudentTestBank.java | da6f4edc41fe5d1ee1d653ff0b32224629895a92 | [] | no_license | bsugiarto24/PastClasses | cb222b4c1ad086d790a99ea39ab70a7564c81546 | a6bdac4d8f534875a4fd88fda023d209302043cc | refs/heads/master | 2021-01-10T12:54:37.076981 | 2016-02-23T23:36:19 | 2016-02-23T23:36:19 | 52,399,274 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,668 | java | package TestTool.Model.TestBank;
import TestTool.Model.TestCreation.StudentTest;
import java.util.ArrayList;
import java.util.HashMap;
/**
* A StudentTestBank is a collection of StudentTest objects in a hashmap.
* The key is the name of the student and the value is the list of StudentTest objects assigned to each student
* It is also a singleton
*
* Created by Brandon Vo (brvo@calpoly.edu) on 11/20/15.
*/
public class StudentTestBank {
/*The singleton of the ActiveTestBank*/
private static StudentTestBank instance = new StudentTestBank();
/*The hashmap that acts as the bank*/
private HashMap<String, ArrayList<StudentTest>> bank;
private StudentTestBank(){
bank = new HashMap<>();
}
public void add(StudentTest test){
String student = test.getStudent().trim().toLowerCase();
ArrayList<StudentTest> tests = new ArrayList<>();
if(bank.containsKey(student)){
tests = bank.get(student);
tests.add(test);
bank.put(student, tests);
}
else{
tests.add(test);
bank.put(student, tests);
}
}
public void removeTest(StudentTest test){
String student = test.getStudent().trim().toLowerCase();
if(!bank.containsKey(student)){
throw new RuntimeException("Student does not exist");
}
ArrayList<StudentTest> tests;
tests = bank.get(student);
tests.remove(test);
bank.put(student, tests);
}
public void removeAllTests(String name){
String student = name.trim().toLowerCase();
ArrayList<StudentTest> tests;
if(!bank.containsKey(student)){
throw new RuntimeException("Student does not exist");
}
tests = bank.get(student);
tests.clear();
bank.put(student, tests);
}
public void removeStudent(String name){
String student = name.trim().toLowerCase();
if(!bank.containsKey(student)){
throw new RuntimeException("Student does not exist");
}
bank.remove(student);
}
public ArrayList<StudentTest> getTests(String name){
String student = name.trim().toLowerCase();
if(!bank.containsKey(student)){
throw new RuntimeException("Student does not exist");
}
return bank.get(student);
}
public HashMap<String, ArrayList<StudentTest>> getBank(){
return bank;
}
public static StudentTestBank getInstance() {
return instance;
}
public void setBank(HashMap<String, ArrayList<StudentTest>> tests){
this.bank = tests;
}
}
| [
"bsugiarto@bsugiarto-ltm.internal.salesforce.com"
] | bsugiarto@bsugiarto-ltm.internal.salesforce.com |
08dc411921cf4ce5016629c8e5a1d733fe5a8623 | d9b78a17eeb401d6bd5d364cfb417bc83c78fcaa | /Android/app/src/main/java/com/example/quanlynhahang/ui/share/DanhSachTrangThaiThucDon.java | f0cf6c52d2c373ba4074d79d373023f835e13a77 | [] | no_license | MinhLuongVu/PhanMemQuanLyNhaHang | 5cefa840922cdcba2744f4bc97491d8473f0632c | 7e7f8cd7eb64893406efb723ffd3015ecbfc7572 | refs/heads/master | 2022-11-22T17:35:39.674667 | 2020-07-15T13:51:40 | 2020-07-15T13:51:40 | 279,876,391 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,778 | java | package com.example.quanlynhahang.ui.share;
import com.example.quanlynhahang.Database.ConnectionDB;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.ArrayList;
public class DanhSachTrangThaiThucDon {
ResultSet resultSet;
ConnectionDB connectionDB=new ConnectionDB();
Connection connection;
final ArrayList dsmatrangthai= new ArrayList();
final ArrayList dstenmon=new ArrayList();
final ArrayList dssoluong= new ArrayList();
final ArrayList dstenban=new ArrayList();
final ArrayList dstrangthai= new ArrayList();
private PreparedStatement statement;
public void UpdateTrangThaiThucDon(String MaTrangThai,String TrangThai)
{
dsmatrangthai.clear();
dstenmon.clear();
dssoluong.clear();
dstrangthai.clear();
dstenban.clear();
try {
statement=connection.prepareStatement("update TRANGTHAI set TrangThai=N'"+TrangThai+"' where MaTrangThai='"+MaTrangThai+"'");
resultSet=statement.executeQuery();
statement.executeUpdate();
}
catch (Exception ex)
{
}
}
public ArrayList getMaTrangThai(String MaBan)
{
dsmatrangthai.clear();
try {
connection=connectionDB.connections();
if (MaBan==null)
{
statement=connection.prepareStatement("select * from TRANGTHAI order by TrangThai asc");
}
else
{
statement=connection.prepareStatement("select * from TRANGTHAI where MaBan='"+MaBan+"' order by TrangThai asc");
}
resultSet=statement.executeQuery();
while (resultSet.next())
{
dsmatrangthai.add(resultSet.getString("MaTrangThai"));
}
}
catch (Exception ex)
{
}
return dsmatrangthai;
}
public ArrayList getTenMon(String MaBan)
{
dstenmon.clear();
try {
connection=connectionDB.connections();
if (MaBan==null)
{
statement=connection.prepareStatement("select * from TRANGTHAI,MONAN where MONAN.MaMon=TRANGTHAI.MaMon order by TRANGTHAI.TrangThai asc");
}
else
{
statement=connection.prepareStatement("select * from TRANGTHAI,MONAN where TRANGTHAI.MaBan='"+MaBan+"' and MONAN.MaMon=TRANGTHAI.MaMon order by TRANGTHAI.TrangThai asc");
}
resultSet=statement.executeQuery();
while (resultSet.next())
{
dstenmon.add(resultSet.getString("TenMon"));
}
}
catch (Exception ex)
{
}
return dstenmon;
}
public ArrayList getTenBan(String MaBan)
{
dstenban.clear();
try {
connection=connectionDB.connections();
if (MaBan==null)
{
statement=connection.prepareStatement("select * from TRANGTHAI,DANHSACHBAN where DANHSACHBAN.MaBan=TRANGTHAI.MaBan order by TRANGTHAI.TrangThai asc");
}
else
{
statement=connection.prepareStatement("select * from TRANGTHAI,DANHSACHBAN where TRANGTHAI.MaBan='"+MaBan+"' and DANHSACHBAN.MaBan=TRANGTHAI.MaBan order by TRANGTHAI.TrangThai asc");
}
resultSet=statement.executeQuery();
while (resultSet.next())
{
dstenban.add(resultSet.getString("TenBan"));
}
}
catch (Exception ex)
{
}
return dstenban;
}
public ArrayList getSoLuong(String MaBan)
{
dssoluong.clear();
try {
connection=connectionDB.connections();
if (MaBan==null)
{
statement=connection.prepareStatement("select * from TRANGTHAI order by TrangThai asc");
}
else
{
statement=connection.prepareStatement("select * from TRANGTHAI where MaBan='"+MaBan+"' order by TrangThai asc");
}
resultSet=statement.executeQuery();
while (resultSet.next())
{
dssoluong.add(resultSet.getString("SoLuong"));
}
}
catch (Exception ex)
{
}
return dssoluong;
}
public ArrayList getTrangThai(String MaBan)
{
dstrangthai.clear();
try {
connection=connectionDB.connections();
if (MaBan==null)
{
statement=connection.prepareStatement("select * from TRANGTHAI order by TrangThai asc");
}
else
{
statement=connection.prepareStatement("select * from TRANGTHAI where MaBan='"+MaBan+"' order by TrangThai asc");
}
resultSet=statement.executeQuery();
while (resultSet.next())
{
dstrangthai.add(resultSet.getString("TrangThai"));
}
}
catch (Exception ex)
{
}
return dstrangthai;
}
/* public ArrayList getMaTrangThai(String MaBan)
{
try {
connection=connectionDB.connections();
PreparedStatement statement=connection.prepareStatement("select * from GOIMON,MONAN,DANHSACHBAN where DANHSACHBAN.MaBan=GOIMON.MaBan and MONAN.MaMon=GOIMON.MaMon and GOIMON.MaBan='"+MaBan+"'");
resultSet=statement.executeQuery();
while (resultSet.next())
{
dsmagoimon.add(resultSet.getString("MaGoiMon"));
}
}
catch (Exception ex)
{
}
return dsmagoimon;
}
public ArrayList getTenMon(String MaBan)
{
try {
connection=connectionDB.connections();
PreparedStatement statement=connection.prepareStatement("select * from GOIMON,MONAN,DANHSACHBAN where DANHSACHBAN.MaBan=GOIMON.MaBan and MONAN.MaMon=GOIMON.MaMon and GOIMON.MaBan='"+MaBan+"'");
resultSet=statement.executeQuery();
while (resultSet.next())
{
dstenmon.add(resultSet.getString("TenMon"));
}
}
catch (Exception ex)
{
}
return dstenmon;
}
public ArrayList getSoLuong(String MaBan)
{
try {
connection=connectionDB.connections();
PreparedStatement statement=connection.prepareStatement("select * from GOIMON,MONAN,DANHSACHBAN where DANHSACHBAN.MaBan=GOIMON.MaBan and MONAN.MaMon=GOIMON.MaMon and GOIMON.MaBan='"+MaBan+"'");
resultSet=statement.executeQuery();
while (resultSet.next())
{
dssoluong.add(resultSet.getString("SoLuong"));
}
}
catch (Exception ex)
{
}
return dssoluong;
}
public ArrayList getHinhAnh(String MaBan)
{
try {
connection=connectionDB.connections();
PreparedStatement statement=connection.prepareStatement("select MONAN.HinhAnh from GOIMON,MONAN,DANHSACHBAN where DANHSACHBAN.MaBan=GOIMON.MaBan and MONAN.MaMon=GOIMON.MaMon and GOIMON.MaBan='"+MaBan+"'");
resultSet=statement.executeQuery();
while (resultSet.next())
{
dshinhanh.add(resultSet.getString("HinhAnh"));
}
}
catch (Exception ex)
{
}
return dshinhanh;
}
public ArrayList getDonGia(String MaBan)
{
try {
connection=connectionDB.connections();
PreparedStatement statement=connection.prepareStatement("select MONAN.DonGia from GOIMON,MONAN,DANHSACHBAN where DANHSACHBAN.MaBan=GOIMON.MaBan and MONAN.MaMon=GOIMON.MaMon and GOIMON.MaBan='"+MaBan+"'");
resultSet=statement.executeQuery();
while (resultSet.next())
{
dsdongia.add(resultSet.getString("DonGia"));
}
}
catch (Exception ex)
{
}
return dsdongia;
}
public ArrayList getThanhTien(String MaBan)
{
try {
connection=connectionDB.connections();
PreparedStatement statement=connection.prepareStatement("select * from GOIMON,MONAN,DANHSACHBAN where DANHSACHBAN.MaBan=GOIMON.MaBan and MONAN.MaMon=GOIMON.MaMon and GOIMON.MaBan='"+MaBan+"'");
resultSet=statement.executeQuery();
while (resultSet.next())
{
dsthanhtien.add(resultSet.getString("ThanhTien"));
}
}
catch (Exception ex)
{
}
return dsthanhtien;
}*/
}
| [
"vuminhluong3@gmail.com"
] | vuminhluong3@gmail.com |
6d99d19fa0a5ed6b40a05a0382efae9805dcec99 | 2c7ffea09a8b6f7933a30d63992e067e648eda33 | /app/src/main/java/com/zcl/hxqh/liangqingmanagement/record/ParsedNdefRecord.java | 0db990f3a858e780f48ecb12ee262512bedce564 | [] | no_license | cd-hxqh/LiangQingProject | 5760faa94750d38de87413db4c07533526c41208 | cc0a300977d5279708076d80f4e4028a3fc572aa | refs/heads/master | 2021-01-13T15:47:32.996150 | 2017-10-12T08:13:15 | 2017-10-12T08:13:15 | 76,842,987 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,020 | java | /*
* Copyright (C) 2010 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.zcl.hxqh.liangqingmanagement.record;
import android.app.Activity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
public interface ParsedNdefRecord {
/**
* Returns a view to display this record.
*/
public View getView(Activity activity, LayoutInflater inflater, ViewGroup parent,
int offset);
}
| [
"278233503@qq.com"
] | 278233503@qq.com |
8feb302e1003803b31a881c5007b18d781c1b76f | 24096daba0c54e911cde43607b553280051748f7 | /NS_COMMONS/src/main/java/com/creditease/framework/listener/ExceptionEvent.java | 843cbd7caae368b0499f55b4fbee044406fe5476 | [
"Apache-2.0"
] | permissive | zhenyanlab/ns4_frame | 743dfff816ed37e4e4ea000de801b0e21d114f45 | 87f494dc2cb20c673d545a1a5a8835b253d419bf | refs/heads/master | 2022-05-30T16:35:39.570516 | 2019-04-01T06:03:22 | 2019-04-01T06:03:22 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 268 | java | package com.creditease.framework.listener;
public class ExceptionEvent implements Event{
private Throwable exception;
public Throwable getException() {
return exception;
}
public void setException(Throwable exception) {
this.exception = exception;
}
}
| [
"1573885251@qq.com"
] | 1573885251@qq.com |
39ce5292781c602d5694e9f6885670da666cc76b | da145c7676db329c7c41ee821b203dfb6ac86143 | /src/main/java/com/diloso/app/persist/entities/MultiText.java | de6de60cbe26a396f5464f54d8d09508e196246b | [] | no_license | javihsan/diloso | 62ada6ed23a6985369273b4ab2c44c82530397b2 | 0749f8595a9a9d485d12bdac4987f1d0f538d856 | refs/heads/master | 2020-04-10T05:01:52.071337 | 2018-12-07T11:42:00 | 2018-12-07T11:42:00 | 160,815,810 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,831 | java | package com.diloso.app.persist.entities;
import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
/**
* The persistent class for the MultiText entity
*
*/
@Entity
@NamedQueries({
@NamedQuery(name="getMultiText", query = "SELECT t FROM MultiText t WHERE t.enabled =1 order by t.id asc"),
@NamedQuery(name="getMultiLangCode", query = "SELECT t FROM MultiText t WHERE t.mulLanCode=:mulLanCode and t.enabled =1 order by t.id asc"),
@NamedQuery(name="getMultiKey", query = "SELECT t FROM MultiText t WHERE t.mulKey=:mulKey and t.enabled =1 order by t.id asc"),
@NamedQuery(name="getByLanCodeAndKey", query = "SELECT t FROM MultiText t WHERE t.mulLanCode=:mulLanCode and t.mulKey=:mulKey and t.enabled =1 order by t.id asc")
})
public class MultiText implements Serializable {
protected static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
protected Long id;
protected Integer enabled;
protected String mulKey;
protected String mulLanCode;
protected String mulText;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Integer getEnabled() {
return enabled;
}
public void setEnabled(Integer enabled) {
this.enabled = enabled;
}
public String getMulKey() {
return mulKey;
}
public void setMulKey(String mulKey) {
this.mulKey = mulKey;
}
public String getMulLanCode() {
return mulLanCode;
}
public void setMulLanCode(String mulLanCode) {
this.mulLanCode = mulLanCode;
}
public String getMulText() {
return mulText;
}
public void setMulText(String mulText) {
this.mulText = mulText;
}
}
| [
"javihsan@gmail.com"
] | javihsan@gmail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.