text
stringlengths 10
2.72M
|
|---|
/**
* Represents a superfan at the Olympics.
*
* @author Confused Coder
* @version 1.0
*/
public class SuperFan extends Spectator {
/**
* Public constructor.
*
* @param favoriteAthlete this spectator's favorite athlete... for now...
*/
public SuperFan(Athlete favoriteAthlete) {
super(favoriteAthlete);
}
@Override
public void cheerForFavorite() {
for (int i = 0; i < 5; i++) {
System.out.println("I LOVE YOU " + getFavoriteAthlete().getName()
+ "!!!!!!!!!!");
}
}
@Override
public void setFavoriteAthlete(Athlete favoriteAthlete) {}
}
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Maryam Athar Khan
// Homework 04
// Due date is September 22,2015
// This program is designed to create specific combinations that may occur whilst playing poker.
//
// define a class
public class PokerHandCheck {
// main method required of every Java program
public static void main(String[] args) {
// random card generator
int card1=(int)(Math.random()*52+1);
int card2=(int)(Math.random()*52+1);
int card3=(int)(Math.random()*52+1);
int card4=(int)(Math.random()*52+1);
int card5=(int)(Math.random()*52+1);
// declare variables of card suit, card number, a pair, two pair, three of a kind
String suitType1="";
String numberType1="";
String suitType2="";
String numberType2="";
String suitType3="";
String numberType3="";
String suitType4="";
String numberType4="";
String suitType5="";
String numberType5="";
// switch statements to get different card types
// switch statements to get different cards
// card 1 suit type
int temp1=(card1/13)+1;
if (card1 %13==0){
temp1=(card1/13);
}
switch (temp1){
case 1:
suitType1="Diamonds";
break;
case 2:
suitType1="Clubs";
break;
case 3:
suitType1="Hearts";
break;
case 4:
suitType1="Spades";
break;
}
// card 2 suit type
int temp2=(card2/13)+1;
if (card2 %13==0){
temp2=(card2/13);
}
switch (temp2){
case 1:
suitType2="Diamonds";
break;
case 2:
suitType2="Clubs";
break;
case 3:
suitType2="Hearts";
break;
case 4:
suitType2="Spades";
break;
}
// card 3 suit type
int temp3=(card3/13)+1;
if (card3 %13==0){
temp3=(card3/13);
}
switch (temp3){
case 1:
suitType3="Diamonds";
break;
case 2:
suitType3="Clubs";
break;
case 3:
suitType3="Hearts";
break;
case 4:
suitType3="Spades";
break;
}
// card 4 suit type
int temp4=(card4/13)+1;
if (card4 %13==0){
temp4=(card4/13);
}
switch (temp4){
case 1:
suitType4="Diamonds";
break;
case 2:
suitType4="Clubs";
break;
case 3:
suitType4="Hearts";
break;
case 4:
suitType4="Spades";
break;
}
// card 5 suit type
int temp5=(card5/13)+1;
if (card5 %13==0){
temp5=(card5/13);
}
switch (temp5){
case 1:
suitType5="Diamonds";
break;
case 2:
suitType5="Clubs";
break;
case 3:
suitType5="Hearts";
break;
case 4:
suitType5="Spades";
break;
}
// switch statements to get different card numbers
// card 1 number
int temp11=(card1%13);
if (card1%13==0){
temp11=(card1/13);
}
switch (temp11){
case 0:
numberType1="Kings";
break;
case 1:
numberType1="Ace";
break;
case 2:
numberType1="2";
break;
case 3:
numberType1="3";
break;
case 4:
numberType1="4";
break;
case 5:
numberType1="5";
break;
case 6:
numberType1="6";
break;
case 7:
numberType1="7";
break;
case 8:
numberType1="8";
break;
case 9:
numberType1="9";
break;
case 10:
numberType1="10";
break;
case 11:
numberType1="Jack";
break;
case 12:
numberType1="Queen";
break;
}
// card 2 number
int temp22=(card2%13);
if (card2%13==0){
temp22=(card2/13);
}
switch (temp22){
case 0:
numberType2="Kings";
break;
case 1:
numberType2="Ace";
break;
case 2:
numberType2="2";
break;
case 3:
numberType2="3";
break;
case 4:
numberType2="4";
break;
case 5:
numberType2="5";
break;
case 6:
numberType2="6";
break;
case 7:
numberType2="7";
break;
case 8:
numberType2="8";
break;
case 9:
numberType2="9";
break;
case 10:
numberType2="10";
break;
case 11:
numberType2="Jack";
break;
case 12:
numberType2="Queen";
break;
}
// card 3 number type
int temp33=(card3%13);
if (card3%13==0){
temp33=(card3/13);
}
switch (temp33){
case 0:
numberType3="Kings";
break;
case 1:
numberType3="Ace";
break;
case 2:
numberType3="2";
break;
case 3:
numberType3="3";
break;
case 4:
numberType3="4";
break;
case 5:
numberType3="5";
break;
case 6:
numberType3="6";
break;
case 7:
numberType3="7";
break;
case 8:
numberType3="8";
break;
case 9:
numberType3="9";
break;
case 10:
numberType3="10";
break;
case 11:
numberType3="Jack";
break;
case 12:
numberType3="Queen";
break;
}
// card 4 number
int temp44=(card4%13);
if (card4%13==0){
temp44=(card4/13);
}
switch (temp44){
case 0:
numberType4="Kings";
break;
case 1:
numberType4="Ace";
break;
case 2:
numberType4="2";
break;
case 3:
numberType4="3";
break;
case 4:
numberType4="4";
break;
case 5:
numberType4="5";
break;
case 6:
numberType4="6";
break;
case 7:
numberType4="7";
break;
case 8:
numberType4="8";
break;
case 9:
numberType4="9";
break;
case 10:
numberType4="10";
break;
case 11:
numberType4="Jack";
break;
case 12:
numberType4="Queen";
break;
}
// card 5 number
int temp55=(card5%13);
if (card5%13==0){
temp55=(card5/13);
}
switch (temp55){
case 0:
numberType5="Kings";
break;
case 1:
numberType5="Ace";
break;
case 2:
numberType5="2";
break;
case 3:
numberType5="3";
break;
case 4:
numberType5="4";
break;
case 5:
numberType5="5";
break;
case 6:
numberType5="6";
break;
case 7:
numberType5="7";
break;
case 8:
numberType5="8";
break;
case 9:
numberType5="9";
break;
case 10:
numberType5="10";
break;
case 11:
numberType5="Jack";
break;
case 12:
numberType5="Queen";
break;
}
// print out the five random cards
System.out.println("Your random cards were:");
System.out.println("the " +numberType1+ " of " +suitType1+ " ");
System.out.println("the " +numberType2+ " of " +suitType2+ " ");
System.out.println("the " +numberType3+ " of " +suitType3+ " ");
System.out.println("the " +numberType4+ " of " +suitType4+ " ");
System.out.println("the " +numberType5+ " of " +suitType5+ " ");
// declare match, pair, two pair, high card and three pair variables
int match=0;
int pair=0;// you want to keep count of the number of matches and pair, hence declare them as integers.
boolean Pair=false;
boolean twoPair=false;
boolean threeKind=false;
boolean highCard=false;
// compare card 1 with card 2
if (numberType1==numberType2) {
match=match+1; // match++
}
if (numberType1==numberType3) {
match=match+1;
}
if (numberType1==numberType4) {
match=match+1;
}
if (numberType1==numberType5) {
match=match+1;
}
if (match==2) {
threeKind=true; // if card 1 matches with two other card, it is three of a kind
}
if (match==1) {
pair=1;
Pair=true; // if there is only one match, there is only one pair
}
match=0; // set match is equal to zero so we can check other card combinations
// check combinations with card 2
if (numberType2==numberType3) {
match=match+1;
}
if (numberType2==numberType4) {
match=match+1;
}
if (numberType2==numberType5) {
match=match+1;
}
if ((pair==1) && (match>0)) {
twoPair=true; // you have card 1 matching with another card and card 2 matching as well
}
if (match==2) {
threeKind=true; // you have card 2 matching with two other cards
}
else if ((pair==0) && (match>0)){
pair=1;
Pair=true; // you have no cards matching with card 1 but card 2 matching with other cards
}
// check combiantions with card 3
match=0;
if (numberType3==numberType4) {
match=match+1;
}
if (numberType3==numberType5) {
match=match+1;
}
if ((pair==1) && (match>0)) {
twoPair=true; // you have card 1 matching with another card and card 3 matching as well
}
if (match==2) {
threeKind=true;// card 3 matches with 2 other cards
}
else if ((pair==0) && (match>0)){
pair=1;
Pair=true; // card 3 matches with another card
}
// check combinations with card 4
match=0;
if (numberType4==numberType5) {
match=match+1;
}
if ((pair==1) && (match>0)) {
twoPair=true; // card 1 matches with another card and so does card 4 with other cards
}
else if ((pair==0) && (match==1)) {
Pair=true;// card 4 maches with a card
}
// printing out statements now
System.out.println(" ");// blank line between what the cards are and the combination
if (threeKind==true) {
System.out.println("You have three of a kind!"); // three cards match
}
else if (twoPair==true) {
System.out.println("You have two pair!"); // you have two pairs
}
else if (Pair==true) {
System.out.println("You have a pair!"); // only one pair
}
else {
System.out.println("You have a high card!");
}
} // end of main method
}// end of class
|
// Sun Certified Java Programmer
// Chapter 6, P471
// Strings, I/O, Formatting, and Parsing
import java.io.*;
class Animal { // not serializable !
int weight = 42;
}
|
package com.tencent.mm.ui.chatting.b.b;
import com.tencent.mm.ui.chatting.b.u;
import com.tencent.mm.ui.chatting.v;
import java.util.ArrayList;
public interface w extends u {
void Fd(int i);
ArrayList<String> cvK();
boolean cvL();
void cvM();
void cvN();
boolean cvO();
v cvP();
boolean cvQ();
boolean cvR();
boolean cvS();
boolean cvT();
boolean gA(long j);
}
|
public class Ellipse implements Shape{
double major_axis;
double minor_axis;
public Ellipse(double major_axis, double minor_axis) {
this.major_axis = major_axis;
this.minor_axis = minor_axis;
}
public double area(){
return pi*(major_axis/2)*(minor_axis/2);
}
}
|
package com.automation;
import org.testng.annotations.AfterClass;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
import com.base.BaseClass;
public class TestingPage {
BaseClass b=new BaseClass();
@BeforeClass()
private void browser() {
b.launchBrowser("Google");
}
@BeforeMethod
private void url() {
b.launchUrl("http://automationpractice.com/");
}
@Parameters({"username","password"})
@Test(priority=4)
public void Execution(String username,String password) throws Throwable {
//First Page
Test1 auto1=new Test1();
b.click(auto1.getSignIn());
b.sendKeys(auto1.getEmail(),username);
b.sendKeys(auto1.getPassword(),password);
b.click(auto1.getLogin());
b.screenShot("Automation 1");
//Second Page
Test2 auto2=new Test2();
b.sendKeys(auto2.getSearchbox(),"dresses");
b.click(auto2.getButton());
b.click(auto2.getAddToCart());
Thread.sleep(2000);
b.click(auto2.getProceedtocheckout1());
//Third page
Test3 auto3=new Test3();
b.action(auto3.getMouseover());
b.getText(auto3.getDeliveryDetails());
b.click(auto3.getProceedtocheckout3());
//Fourth Page
Test4 auto4=new Test4();
b.action(auto4.getMouseover());
b.sendKeys(auto4.getMessage(),"Hiiiiiiiii");
b.click(auto4.getProceedtocheckout4());
//Fifth Page
Test5 auto5=new Test5();
b.action(auto5.getMouseover());
b.click(auto5.getTickmark());
b.click(auto5.getProceedtocheckout5());
//Sixth Page
Test6 auto6=new Test6();
b.action(auto6.getMouseover());
b.click(auto6.getBank());
b.click(auto6.getiConfirm());
}
}
|
package com.wb.bot.wbbot.beans;
public class Subscription {
private String channel;
private String subscription;
private String id;
private String clientId;
public void setChannel(String channel) {
this.channel = channel;
}
public String getChannel() {
return channel;
}
public void setSubscription(String subscription) {
this.subscription = subscription;
}
public String getSubscription() {
return subscription;
}
public void setId(String id) {
this.id = id;
}
public String getId() {
return id;
}
public void setClientId(String clientId) {
this.clientId = clientId;
}
public String getClientId() {
return clientId;
}
}
|
package com.s24.redjob.channel.command;
import com.s24.redjob.queue.QueueWorker;
import com.s24.redjob.worker.Execution;
import com.s24.redjob.worker.runner.JobRunner;
import com.s24.redjob.worker.runner.JobRunnerComponent;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
/**
* {@link JobRunner} for {@link ShutdownQueueWorker} command.
*/
@JobRunnerComponent
public class ShutdownQueueWorkerRunner implements JobRunner<ShutdownQueueWorker> {
/**
* Logger.
*/
private static final Logger log = LoggerFactory.getLogger(ShutdownQueueWorkerRunner.class);
/**
* All {@link QueueWorker}s.
*/
@Autowired(required = false)
private List<QueueWorker> allWorkers = List.of();
@Override
public void run(Execution execution) {
allWorkers.stream()
.filter(worker -> matches(worker, execution.getNamespace(), execution.getJob()))
.forEach(worker -> {
try {
log.info("Shutting down worker {}.", worker.getName());
worker.stop();
} catch (Exception e) {
log.error("Failed to stop worker {}: {}.", worker.getName(), e.getMessage());
}
});
}
/**
* Does the worker match the selectors of the job?.
*/
private boolean matches(QueueWorker worker, String namespace, ShutdownQueueWorker job) {
return worker.getNamespace().equals(namespace);
}
}
|
package gerenciador.turma;
import gerenciador.alunos.Aluno;
/*
* @author Evolute
*/
public class Turma {
private Aluno aluno;
private gerenciador.aula.Turma aula;
private DiasSemana semana;
private String horario;
// Declaraรงรฃo do construtor da classe Turma//
public Turma (Aluno aluno, gerenciador.aula.Turma aula, DiasSemana semana,String horario){
this.aluno = aluno;
this.aula = aula;
this.semana = semana;
this.horario = horario;
}
//Declaraรงรฃo do mรฉtodo horario
public void sethorario(String horario) {
this.horario = horario;
// Altera a variavel horario da classe Funcao para o parametro passado
}
//Declaraรงรฃo do mรฉtodo horario
public String gethorario() {
return horario;
//retorna o Valor da Variavel horario
}
}
|
package com.bootcamp.parkingLot;
import com.bootcamp.parkingLot.exception.CanNotParkException;
import com.bootcamp.parkingLot.observer.ParkingLotObserver;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
public class ParkingLot {
private int capacity;
private HashMap<Object, Object> tokenVehicleMap;
private List<ParkingLotObserver> observers;
public ParkingLot(int slots) {
this.capacity = slots;
tokenVehicleMap = new HashMap<Object, Object>();
observers = new ArrayList();
}
public Object park(Object car) throws CanNotParkException {
if (isSlotAvailable()) {
Object token = new Object();
tokenVehicleMap.put(token, car);
if (isFull())
notifyParkingIsFull();
return token;
} else {
throw CanNotParkException.slotIsFull();
}
}
public Object unpark(Object token) throws CanNotParkException {
if (tokenVehicleMap.containsKey(token)) {
Object car = tokenVehicleMap.remove(token);
if (isParkingAvailable())
notifyParkingIsAvailable();
return car;
} else
throw CanNotParkException.invalidToken();
}
public boolean isSlotAvailable() {
return tokenVehicleMap.size() < capacity;
}
public boolean isFull() {
return capacity == tokenVehicleMap.size();
}
public void addObserver(ParkingLotObserver parkingLotObserver) {
this.observers.add(parkingLotObserver);
}
public boolean containsToken(Object token) {
return tokenVehicleMap.containsKey(token);
}
private boolean isParkingAvailable() {
return tokenVehicleMap.size() == capacity - 1;
}
private void notifyParkingIsFull() {
for (ParkingLotObserver observer : observers) {
observer.parkingLotIsFull();
}
}
private void notifyParkingIsAvailable() {
for (ParkingLotObserver observer : observers) {
observer.parkingIsAvailable();
}
}
}
|
package steamarbitrage.steamio;
public enum SteamCookieName {
MACHINE_AUTH,
SESSION_ID,
LOGIN,
LOGIN_SECURE,
// CC,
// WEB_TRADE_ELIGIBILITY,
// COUNTRY,
// BROWSER_ID,
// LKG_BILLING_COUNTRY,
// REMEMBER_LOGIN
}
|
/**
* ReservationUserCommentImageServiceImpl.java $version 2018. 8. 7.
*
* Copyright 2018 NAVER Corp. All rights Reserved.
* NAVER PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*/
package com.nts.pjt3.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.nts.pjt3.dao.ReservationUserCommentImageDao;
import com.nts.pjt3.dto.ReservationUserCommentImage;
import com.nts.pjt3.service.ReservationUserCommentImageService;
/**
* @author Seok Jeongeum
*
*/
@Service
public class ReservationUserCommentImageServiceImpl implements ReservationUserCommentImageService {
@Autowired
private ReservationUserCommentImageDao reservationUserCommentImageDao;
@Override
public List<ReservationUserCommentImage> getReservationUserCommentImages(int id) {
return reservationUserCommentImageDao.selectReservationUserCommentImages(id);
}
@Override
public void addReservationUserCommentImage(ReservationUserCommentImage reservationUserCommentImage) {
reservationUserCommentImageDao.insertReservationUserCommentImage(reservationUserCommentImage);
}
}
|
/**
* Copyright (c) 2016, ๆ็ซฏ็งๆ.
*/
package com.rofour.baseball.service.message.impl;
import com.fasterxml.jackson.core.type.TypeReference;
import com.rofour.baseball.common.AttachConstant;
import com.rofour.baseball.common.Constant;
import com.rofour.baseball.common.HttpClientUtils;
import com.rofour.baseball.controller.model.ResultInfo;
import com.rofour.baseball.controller.model.message.SmsModelForUserInfo;
import com.rofour.baseball.controller.model.order.OrderInfo;
import com.rofour.baseball.controller.model.order.RequestOrderInfo;
import com.rofour.baseball.dao.message.bean.SmsModelForUserBean;
import com.rofour.baseball.dao.message.mapper.SmsModelForUserMapper;
import com.rofour.baseball.service.message.SmsModelForUserService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @ClassName: SmsModelForUserServiceImpl
* @Description: ็จๆท่ชๅฎไนๆจกๆฟๆๅกๅฎ็ฐ
* @author: xulang
* @date: 2016ๅนด09ๆ20ๆฅ 13:24
*/
@Service("smsModelForUserService")
public class SmsModelForUserServiceImpl implements SmsModelForUserService {
@Autowired
@Qualifier("smsModelForUserMapper")
private SmsModelForUserMapper smsModelForUserMapper;
@Override
public int delUpdate(SmsModelForUserBean smsModelId) {
return smsModelForUserMapper.delUpdate(smsModelId);
}
@Override
public int insert(SmsModelForUserInfo record) {
SmsModelForUserBean smsModelForUserBean = new SmsModelForUserBean();
BeanUtils.copyProperties(record, smsModelForUserBean);
return smsModelForUserMapper.insertSelective(smsModelForUserBean);
}
@Override
public SmsModelForUserInfo selectById(Long smsModelId) {
SmsModelForUserBean smsModelForUserBean = smsModelForUserMapper.selectByPrimaryKey(smsModelId);
SmsModelForUserInfo smsModelForUserInfo = new SmsModelForUserInfo();
BeanUtils.copyProperties(smsModelForUserBean, smsModelForUserInfo);
return smsModelForUserInfo;
}
@Override
public int update(SmsModelForUserInfo record) {
SmsModelForUserBean smsModelForUserBean = new SmsModelForUserBean();
BeanUtils.copyProperties(record, smsModelForUserBean);
return smsModelForUserMapper.updateByPrimaryKey(smsModelForUserBean);
}
@Override
public int auditSms(SmsModelForUserBean smsModelForUserBean) {
// SmsModelForUserBean smsModelForUserBean = new SmsModelForUserBean();
// BeanUtils.copyProperties(record, smsModelForUserBean);
int i = smsModelForUserMapper.auditSms(smsModelForUserBean);
try {
if(i > 0){
if(smsModelForUserBean.getSmsModelId()!=null && smsModelForUserBean.getUserId()!=null && smsModelForUserBean.getCreateUserPhone()!=null){
Map<String, Object> map = new HashMap<String, Object>();
if (smsModelForUserBean.getStateNum().equals("1")) {//้่ฟ
map.put("msgType", "GOODS_SYSNOTICE_SMSTMPL_CHECK_SUCESS");
} else if (smsModelForUserBean.getStateNum().equals("3")) {//ๆ็ป
map.put("msgType", "GOODS_SYSNOTICE_SMSTMPL_CHECK_FAIL");
}
map.put("bizId", smsModelForUserBean.getSmsModelId());
map.put("receiveUserId", smsModelForUserBean.getUserId());
map.put("receivePhone", smsModelForUserBean.getCreateUserPhone());
// map.put("receivePhone", "18551723901");
map.put("sendUserId", null);
String url = Constant.axpurl.get("send_message_serv");
// ๅฎไนๅๅบๅๅ ๆฐๆฎๆ ผๅผ
final TypeReference<ResultInfo<?>> TypeRef = new TypeReference<ResultInfo<?>>() {};
ResultInfo result = (ResultInfo<?>) HttpClientUtils.post(url, map, TypeRef);
}
}
}catch (Exception e){
e.printStackTrace();
}
return i;
}
@Override
public int batchAudit(SmsModelForUserBean smsModelForUserBean) {
int i = 0;
try{
i = smsModelForUserMapper.batchAudit(smsModelForUserBean);
if(i>0){
Map<String, Object> map = new HashMap<String, Object>();
if(smsModelForUserBean!=null){
List<String> list = smsModelForUserBean.getUserIdPhoneArr();
if(list!=null && list.size()>0){
for(int n=0;n<list.size();n++){
String str[] = list.get(n).split("~",-1);
if(str.length>2){
String bizId = str[0];
String receiveUserId = str[1];
String receivePhone = str[2];
if(smsModelForUserBean.getStateNum().equals("1")){//้่ฟ
map.put("msgType", "GOODS_SYSNOTICE_SMSTMPL_CHECK_SUCESS");
}else if(smsModelForUserBean.getStateNum().equals("3")){//ๆ็ป
map.put("msgType", "GOODS_SYSNOTICE_SMSTMPL_CHECK_FAIL");
}
map.put("bizId", bizId);
map.put("receiveUserId",receiveUserId);
map.put("receivePhone", receivePhone);
map.put("sendUserId",null);
String url = Constant.axpurl.get("send_message_serv");
// ๅฎไนๅๅบๅๅ ๆฐๆฎๆ ผๅผ
final TypeReference<ResultInfo<?>> TypeRef = new TypeReference<ResultInfo<?>>() {};
ResultInfo result = (ResultInfo<?>) HttpClientUtils.post(url, map, TypeRef);
}
}
}
}
}
} catch (Exception e) {
e.printStackTrace();
}
return i;
}
@Override
public List<SmsModelForUserBean> getSmsAuditList(SmsModelForUserBean smsModelForUserBean){
List<SmsModelForUserBean> list = smsModelForUserMapper.getSmsAuditList(smsModelForUserBean);//่ทๅ็ญไฟกๆจกๆฟๅ่กจ
if(!list.isEmpty()){//ๅพช็ฏๆฅ่ฏข่ด่ดฃไบบไฟกๆฏ
Map<String,String> map = new HashMap<String,String>();
SmsModelForUserBean bean = new SmsModelForUserBean();
for(int i=0;i<list.size();i++){
if(list.get(i).getStoreId()!=null){
map.put(i+"",list.get(i).getStoreId());
/*Map<String,Object> map = smsModelForUserMapper.queryHeadUser(list.get(i));
if(!map.isEmpty()){
list.get(i).setHeadUserId(map.get("user_id")==null?"":map.get("user_id").toString());//่ด่ดฃไบบID
list.get(i).setHeadUserPhone(map.get("user_name")==null?"":map.get("user_name").toString());//่ด่ดฃไบบๆๆบ
list.get(i).setHeadUserName(map.get("real_name")==null?"":map.get("real_name").toString());//่ด่ดฃไบบๅงๅ
}*/
}
}
bean.setStoreIdMap(map);
List<SmsModelForUserBean> resultList = smsModelForUserMapper.queryHeadUser(bean);
for(int i=0;i<resultList.size();i++){
for(int j=0;j<list.size();j++){
if(resultList.get(i)!=null && list.get(j).getStoreId().equals(resultList.get(i).getHeadUserId())){
list.get(j).setHeadUserId(resultList.get(i).getHeadUserId());//่ด่ดฃไบบID
list.get(j).setHeadUserPhone(resultList.get(i).getHeadUserPhone().toString());//่ด่ดฃไบบๆๆบ
list.get(j).setHeadUserName(resultList.get(i).getHeadUserName().toString());//่ด่ดฃไบบๅงๅ
}
}
}
}
return list;
}
@Override
public int getSmsAuditListTotal(SmsModelForUserBean smsModelForUserBean){
return smsModelForUserMapper.getSmsAuditListTotal(smsModelForUserBean);
}
public SmsModelForUserBean getSmsAuditView(SmsModelForUserBean smsModelForUserBean){
return smsModelForUserMapper.getSmsAuditView(smsModelForUserBean);
}
}
|
package com.smxknife.patterns.proxy.demo4.test;
import com.smxknife.patterns.proxy.demo4.JdkClassLoader;
import com.smxknife.patterns.proxy.demo4.JdkInvocationHandler;
import com.smxknife.patterns.proxy.demo4.JdkProxy;
import java.lang.reflect.Method;
/**
* @author smxknife
* 2019/12/27
*/
public class TestHandler implements JdkInvocationHandler {
private Object target;
@Override
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
System.out.println("preDo");
Object invoke = method.invoke(target, args);
System.out.println("postDo");
return invoke;
}
public Object getInstance(Object target) {
this.target = target;
Class<?> targetClass = target.getClass();
return JdkProxy.newProxyInstance(new JdkClassLoader(), targetClass.getInterfaces(), this);
}
}
|
package android.support.v4.e;
import java.util.Collection;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
public class a<K, V> extends j<K, V> implements Map<K, V> {
g<K, V> tv;
public a(int i) {
super(i);
}
private g<K, V> bQ() {
if (this.tv == null) {
this.tv = new g<K, V>() {
protected final int bR() {
return a.this.fi;
}
protected final Object p(int i, int i2) {
return a.this.tT[(i << 1) + i2];
}
protected final int h(Object obj) {
return a.this.indexOfKey(obj);
}
protected final int i(Object obj) {
return a.this.indexOfValue(obj);
}
protected final Map<K, V> bS() {
return a.this;
}
protected final void b(K k, V v) {
a.this.put(k, v);
}
protected final V b(int i, V v) {
return a.this.setValueAt(i, v);
}
protected final void ac(int i) {
a.this.removeAt(i);
}
protected final void bT() {
a.this.clear();
}
};
}
return this.tv;
}
public void putAll(Map<? extends K, ? extends V> map) {
int size = this.fi + map.size();
if (this.tS.length < size) {
Object obj = this.tS;
Object obj2 = this.tT;
super.aj(size);
if (this.fi > 0) {
System.arraycopy(obj, 0, this.tS, 0, this.fi);
System.arraycopy(obj2, 0, this.tT, 0, this.fi << 1);
}
j.a(obj, obj2, this.fi);
}
for (Entry entry : map.entrySet()) {
put(entry.getKey(), entry.getValue());
}
}
public Set<Entry<K, V>> entrySet() {
g bQ = bQ();
if (bQ.tE == null) {
bQ.tE = new b();
}
return bQ.tE;
}
public Set<K> keySet() {
g bQ = bQ();
if (bQ.tF == null) {
bQ.tF = new c();
}
return bQ.tF;
}
public Collection<V> values() {
g bQ = bQ();
if (bQ.tG == null) {
bQ.tG = new e();
}
return bQ.tG;
}
}
|
package com.sunbing.demo.config;
import com.sunbing.demo.interceptor.SourceAccessInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
/**
* ๆฆๆชๅจ้
็ฝฎ
*
* @author sunbing
* @version 1.0
* @since 2021/1/25 15:33
*/
@Configuration
public class WebMvcConfig implements WebMvcConfigurer {
@Override
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(new SourceAccessInterceptor()).addPathPatterns("/**");
}
}
|
package com.anydecisions.bean;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
@Entity
@Table(name = "web_user")
public class WebUser {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name = "web_user_id")
private int webUserId;
@Column(name = "first_name")
private String firstName;
@Column(name = "last_name")
private String lastName;
@Column(name = "email_id")
private String emailId;
@Column(name = "web_user_type_name")
private String webUserTypeName;
@Column(name = "is_activated")
private String isActivated;
@Column(name = "username")
private String userName;
@Column(name = "password")
private String password;
/**
* @return the webUserId
*/
public int getWebUserId() {
return webUserId;
}
/**
* @param webUserId
* the webUserId to set
*/
public void setWebUserId(int webUserId) {
this.webUserId = webUserId;
}
/**
* @return the firstName
*/
public String getFirstName() {
return firstName;
}
/**
* @param firstName
* the firstName to set
*/
public void setFirstName(String firstName) {
this.firstName = firstName;
}
/**
* @return the lastName
*/
public String getLastName() {
return lastName;
}
/**
* @param lastName
* the lastName to set
*/
public void setLastName(String lastName) {
this.lastName = lastName;
}
/**
* @return the emailId
*/
public String getEmailId() {
return emailId;
}
/**
* @param emailId
* the emailId to set
*/
public void setEmailId(String emailId) {
this.emailId = emailId;
}
/**
* @return the webUserTypeName
*/
public String getWebUserTypeName() {
return webUserTypeName;
}
/**
* @param webUserTypeName
* the webUserTypeName to set
*/
public void setWebUserTypeName(String webUserTypeName) {
this.webUserTypeName = webUserTypeName;
}
/**
* @return the isActivated
*/
public String getIsActivated() {
return isActivated;
}
/**
* @param isActivated
* the isActivated to set
*/
public void setIsActivated(String isActivated) {
this.isActivated = isActivated;
}
/**
* @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;
}
}
|
package
Marketing.Wrapping.Builder;
import Marketing.Wrapping.Cover.HerringCanWrappingCover;
import Marketing.Wrapping.Cover.WrappingCover;
import Marketing.Wrapping.WrappingCanInfo;
import Marketing.Wrapping.WrappingFactoryInfo;
/**
* ้ฒฑ้ฑผ็ฝๅคดๅปบ้ ่
็ฑป
*
* @author ็็ซๅ
* @date 2021/10/30 20:34
*/
public class HerringCanWrappingBuilder extends WrappingBuilder {
private final HerringCanWrappingCover wrappingCover = new HerringCanWrappingCover();
@Override
void buildWrappingCanInfo(WrappingCanInfo wrappingCanInfo) {
wrappingCover.setWrappingCanInfo(wrappingCanInfo);
}
@Override
void buildWrappingFactoryInfo(WrappingFactoryInfo wrappingFactoryInfo) {
wrappingCover.setWrappingFactoryInfo(wrappingFactoryInfo);
}
@Override
void buildWrappingBackground(String wrappingBackground) {
wrappingCover.setWrappingBackground(wrappingBackground);
}
@Override
void buildCanPrice(double canPrice) {
wrappingCover.setCanPrice(canPrice);
}
@Override
public WrappingCover build() {
return wrappingCover;
}
}
|
package com.xiaomi;
import org.apache.spark.SparkConf;
import org.apache.spark.api.java.JavaRDD;
import org.apache.spark.api.java.JavaSparkContext;
import org.apache.spark.api.java.function.Function;
import scala.Serializable;
import scala.Tuple2;
import java.util.Arrays;
import java.util.List;
public class CustomSortTuple {
public static void main(String[] args) {
SparkConf conf = new SparkConf().setAppName("CustomSortTuple").setMaster("local[*]");
JavaSparkContext jsc = new JavaSparkContext(conf);
List<String> userData = Arrays.asList("user1 99 28", "user2 999 90", "user3 99 25");
JavaRDD<String> userRDD = jsc.parallelize(userData);
JavaRDD<String> sortedRDD = userRDD.sortBy((Function<String, Object>) UserComparable::new, true, 1);
List<String> results = sortedRDD.collect();
for (String result : results) {
System.out.println(result);
}
}
}
class UserComparable implements Comparable<UserComparable>, Serializable {
private String value;
UserComparable(String value) {
this.value = value;
}
@Override
public int compareTo(UserComparable o) {
Integer firstKey1 = Integer.parseInt(this.value.split(" ")[1]);
Integer firstKey2 = Integer.parseInt(o.value.split(" ")[1]);
if (!firstKey1.equals(firstKey2)) {
return firstKey1.compareTo(firstKey2);
} else {
Integer secondKey1 = Integer.parseInt(this.value.split(" ")[2]);
Integer secondKey2 = Integer.parseInt(o.value.split(" ")[2]);
return secondKey1.compareTo(secondKey2);
}
}
}
|
package core.dao;
import core.dao.api.ItemDao;
import domain.api.Item;
public class ItemHibernateDaoImpl extends GenericHibernateDaoImpl<Item, Long> implements
ItemDao {
}
|
package com.tencent.mm.ui.chatting.viewitems;
import android.view.View;
import android.view.ViewGroup;
import android.widget.CheckBox;
import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.TextView;
import com.tencent.mm.R;
import com.tencent.mm.pluginsdk.ui.emoji.RTChattingEmojiView;
import com.tencent.mm.sdk.platformtools.x;
import java.lang.ref.WeakReference;
import java.util.HashMap;
import java.util.Map;
public final class i$b extends b$a {
public static Map<String, WeakReference<i$b>> ubi = new HashMap();
ProgressBar mgA;
ImageView uai;
RTChattingEmojiView ubd;
ImageView ube;
ProgressBar ubf;
ImageView ubg;
TextView ubh;
public final b$a q(View view, boolean z) {
super.dx(view);
this.hrs = (TextView) view.findViewById(R.h.chatting_time_tv);
this.ubd = (RTChattingEmojiView) view.findViewById(R.h.chatting_content_iv);
this.jBR = (CheckBox) view.findViewById(R.h.chatting_checkbox);
this.gFD = view.findViewById(R.h.chatting_maskview);
this.ubf = (ProgressBar) view.findViewById(R.h.chatting_download_progress);
this.ubg = (ImageView) view.findViewById(R.h.chatting_status_btn);
this.ubh = (TextView) view.findViewById(R.h.chatting_size_iv);
if (!z) {
this.mgA = (ProgressBar) view.findViewById(R.h.uploading_pb);
this.tZv = (ImageView) view.findViewById(R.h.chatting_state_iv);
this.uai = (ImageView) view.findViewById(R.h.chatting_status_tick);
}
if (this.ube != null) {
((ViewGroup) this.ube.getParent()).setBackgroundDrawable(null);
}
this.mQc = (TextView) view.findViewById(R.h.chatting_user_tv);
return this;
}
public static void l(String str, int i, int i2) {
if (ubi.containsKey(str)) {
i$b i_b = (i$b) ((WeakReference) ubi.get(str)).get();
if (i_b != null) {
switch (i2) {
case 0:
i_b.ubf.setVisibility(0);
i_b.ubh.setVisibility(8);
i_b.ubg.setVisibility(8);
i_b.ubf.setProgress(0);
return;
case 1:
i_b.ubf.setVisibility(8);
i_b.ubh.setVisibility(8);
i_b.ubg.setVisibility(8);
return;
case 2:
i_b.ubf.setVisibility(8);
i_b.ubh.setVisibility(8);
i_b.ubg.setVisibility(0);
i_b.ubf.setProgress(i);
i_b.ubg.setImageResource(R.g.emoji_download_failed_btn);
return;
default:
return;
}
}
return;
}
x.i("AppMsgEmojiItemHolder", "no contain attchid:%s");
}
}
|
package com.KSTT.cosmos.autotests.steps;
import com.KSTT.cosmos.autotests.core.CosmosPage;
import net.thucydides.core.annotations.Step;
import net.thucydides.core.pages.Pages;
import net.thucydides.core.steps.ScenarioSteps;
import org.junit.Assert;
/**
* Created by arzhanov on 04.12.15.
*/
public class CosmosSteps extends ScenarioSteps{
protected CosmosPage cosmosPage;
public CosmosSteps(Pages pages) {
super(pages);
cosmosPage = getPages().get(CosmosPage.class);
}
@Step
public void openPage() {
cosmosPage.open();
}
@Step
public void ensureBrowserIsSupport() {
Assert.assertTrue("Browser should supported. Test failed", cosmosPage.isBrowserSupported());
}
@Step
public void ensureLoginWidgetNotExists() {
Assert.assertFalse("Login widget should not exist. Test failed", false);
}
}
|
package com.xiruan.demand.repository;
import com.xiruan.demand.entity.monitor.Category;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
* Created by Chen.Ju on 2015/5/25.
*/
public interface CategoryDao extends PagingAndSortingRepository<Category, Long>, JpaSpecificationExecutor<Category> {
}
|
package net.sf.ardengine.input.console;
import javafx.scene.paint.Color;
import net.sf.ardengine.Core;
import net.sf.ardengine.FontManager;
import net.sf.ardengine.events.EventType;
import net.sf.ardengine.events.IEvent;
import net.sf.ardengine.events.IListener;
import net.sf.ardengine.events.KeyEvent;
import net.sf.ardengine.input.InputManager;
import net.sf.ardengine.input.Keys;
import net.sf.ardengine.input.TextBox;
import java.util.ArrayList;
import java.util.List;
/**
* ArdEngine console singleton,
* renders heavily customized command TextBox at 1/3 of window
*
* To support new commands, check class ConsoleModule
*/
public class ConsoleUI extends TextBox {
/**Singleton*/
private static ConsoleUI INSTANCE;
/**Default constant used, when determining console line count*/
private static final float FONT_SPACING = 2.0f;
/**True, if console is currently toggled on*/
private boolean isShown = false;
/**Console history*/
private List<String> lines = new ArrayList<>();
/**Command history*/
private List<String> lastCommands = new ArrayList<>();
/***Actual history listed command*/
private int actualHistoryLine = 0;
/**Maximum of lines, which can be renderered*/
private int maximumLines;
/**Size of used font*/
private final int fontSize;
/**Currently written command*/
private String actualCommand = "";
/**Console logic*/
private Console commands;
private ConsoleUI(){
super(Core.renderer.getBaseWindowWidth(), Core.renderer.getBaseWindowHeight()/3);
setBackgroundColor(Color.BLACK);
setBackgroundOpacity(0.75f);
setBorderOpacity(0);
setTextColor(Color.SILVER);
setStatic(true);
fontSize = FontManager.getFont(FontManager.DEFAULT_KEY).getFontHeight();
calculateLineLimit();
lines.add("ArdEngine "+ Core.VERSION+" console");
lines.add("Type \"console.help()\" for help...");
rebuildText();
InputManager.getInstance().registerListener(new IListener() {
@Override
public EventType getType() {
return EventType.KEY_RELEASED;
}
@Override
public void process(IEvent event) {
if(InputManager.getInstance().getActiveKeyTyper() == INSTANCE){
if(lastCommands.size() == 0) return;
if(((KeyEvent)event).getAffectedKey() == Keys.KEY_UP){
actualHistoryLine--;
if(actualHistoryLine < 0) actualHistoryLine = lastCommands.size() -1;
actualCommand = lastCommands.get(actualHistoryLine);
rebuildText();
}else if(((KeyEvent)event).getAffectedKey() == Keys.KEY_DOWN){
actualHistoryLine++;
if(actualHistoryLine >= lastCommands.size()) actualHistoryLine = 0;
actualCommand = lastCommands.get(actualHistoryLine);
rebuildText();
}
}
}
});
commands = new Console();
ConsoleUtils.addDefaultModules(commands);
}
/**
* Splits given message to lines and and adds them to command history.
* @param message Lines to render
*/
private void addLines(String message){
String[] lines = message.split("\n");
for(String line : lines){
this.lines.add(line);
}
rebuildText();
}
@Override
public void keyTyped(char key) {
actualCommand+=key;
rebuildText();
}
@Override
public void enterPressed() {
String command = actualCommand;
actualCommand = "";
command(command);
}
@Override
public void backspacePressed() {
if(actualCommand.length() == 0) return;
actualCommand = actualCommand.substring(0, actualCommand.length()-1);
rebuildText();
}
private void command(String command){
lines.add(command);
rebuildText();
try{
lastCommands.add(command);
actualHistoryLine = lastCommands.size();
commands.process(command);
}catch(Exception e){
printError(e);
}
}
/**
* Creates String content for text from lines
* and cuts old excessive ones
*/
private void rebuildText(){
StringBuilder text = new StringBuilder();
while(lines.size() > maximumLines){
lines.remove(0);
}
for(String line : lines){
text.append(line);
text.append('\n');
}
text.append(actualCommand);
setText(text.toString());
}
/**
* Updates limit of rendered command lines
*/
private void calculateLineLimit(){
maximumLines = (int)Math.floor(getHeight()/(fontSize+FONT_SPACING));
}
@Override
public void setWidth(float width) {
super.setWidth(width);
calculateLineLimit();
}
/**
* Shows/hides console UI
*/
public static void toggle(){
if(INSTANCE == null) throw new Console.ConsoleException("Console is not initialized yet!");
if(INSTANCE.isShown){
Core.removeDrawable(INSTANCE, false);
InputManager.getInstance().setActiveKeyTyper(null);
}else{
Core.addDrawable(INSTANCE);
InputManager.getInstance().setActiveKeyTyper(INSTANCE);
float windowWidth = Core.renderer.getBaseWindowWidth();
float windowHeight = Core.renderer.getBaseWindowHeight()/3;
if(INSTANCE.getHeight() != windowHeight || INSTANCE.getWidth() != windowWidth){
INSTANCE.setHeight(windowHeight);
INSTANCE.setWidth(windowWidth);
INSTANCE.updateCollisionShape();
}
}
INSTANCE.isShown = !INSTANCE.isShown;
}
/**
* Writes given exception to console
* @param e error
*/
public static void printError(Throwable e){
if(e == null || e.getMessage() == null) return;
if(e instanceof Console.ConsoleException){
print("CEE:"+e.getMessage());
}else{
StringBuilder error = new StringBuilder();
error.append("ERROR:"+e.getMessage());
error.append('\n');
int errorPath = 0;
for(StackTraceElement element : e.getStackTrace()){
error.append(element.toString());
error.append('\n');
errorPath++;
if(errorPath > 3){
break; //Console has too few free lines
}
}
print(error.toString());
}
}
/**
* Writes given lines to console
* @param message new line is created by \n
*/
public static void print(String message){
if(INSTANCE != null){
INSTANCE.addLines(message);
}
}
/**
* Clears console content
*/
public static void clear(){
if(INSTANCE != null){
INSTANCE.lines.clear();
INSTANCE.rebuildText();
}
}
/**
* @return array of registered modules
*/
public static String[] getRegisteredModules(){
if(INSTANCE != null){
return INSTANCE.commands.getModules();
}
return new String[0];
}
/**
* @param moduleName Name of requested module
* @return registered module with given name or throw exception
*/
public static ConsoleModule getRegisteredModule(String moduleName){
if(INSTANCE != null){
return INSTANCE.commands.getModule(moduleName);
}
throw new Console.ConsoleException("Console is not initialized yet!");
}
/**
* Adds new map of supported commands
* @param customModule unique named, at "debug.enable", "debug" is name of module
*/
public static void registerModule(ConsoleModule customModule){
if(INSTANCE == null) throw new Console.ConsoleException("Console is not initialized yet!");
INSTANCE.commands.registerModule(customModule);
}
/**
* Tries to interpret and execute given String as command
* @param command example: debug.enable(), sound.playMusic(path,1),
*/
public static void processCommand(String command){
if(INSTANCE != null){
INSTANCE.command(command);
}else{
throw new Console.ConsoleException("Console is not initialized yet!");
}
}
/**
* Creates console UI instance based on selected renderer
*/
public static void init(){
INSTANCE = new ConsoleUI();
InputManager.getInstance().registerListener(new IListener() {
@Override
public EventType getType() {
return EventType.KEY_RELEASED;
}
@Override
public void process(IEvent event) {
if(((KeyEvent)event).getAffectedKey() == Keys.KEY_F3){
toggle();
}
}
});
}
/**
* Adds new map of supported commands
* @param customModule unique named, at "debug.enable", "debug" is name of module
*/
public static void attachModule(ConsoleModule customModule){
INSTANCE.commands.registerModule(customModule);
}
}
|
package com.tencent.mm.plugin.fts.ui;
import android.app.Dialog;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.os.Build.VERSION;
import android.os.Bundle;
import android.transition.Transition;
import android.transition.TransitionInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.tencent.mm.g.a.sh;
import com.tencent.mm.g.a.tt;
import com.tencent.mm.kernel.g;
import com.tencent.mm.plugin.appbrand.s$l;
import com.tencent.mm.plugin.fts.a.e;
import com.tencent.mm.plugin.fts.a.n;
import com.tencent.mm.plugin.fts.ui.j.b;
import com.tencent.mm.plugin.fts.ui.widget.FTSLocalPageRelevantView;
import com.tencent.mm.plugin.fts.ui.widget.FTSMainUIEducationLayout;
import com.tencent.mm.plugin.messenger.a.f;
import com.tencent.mm.plugin.report.service.h;
import com.tencent.mm.plugin.websearch.api.ad;
import com.tencent.mm.plugin.websearch.api.d;
import com.tencent.mm.plugin.websearch.api.p;
import com.tencent.mm.plugin.websearch.api.r;
import com.tencent.mm.pluginsdk.ui.d.j;
import com.tencent.mm.sdk.b.c;
import com.tencent.mm.sdk.platformtools.ah;
import com.tencent.mm.sdk.platformtools.bi;
import com.tencent.mm.sdk.platformtools.w;
import com.tencent.mm.sdk.platformtools.x;
import com.tencent.mm.ui.base.a;
import com.tencent.mm.ui.e.i;
import java.util.HashMap;
import java.util.Map;
@a(3)
public class FTSMainUI extends FTSBaseVoiceSearchUI implements com.tencent.mm.modelgeo.a.a {
long ghF;
private Dialog iwc;
private int jsZ;
int jvZ = -1;
private FTSMainUIEducationLayout jwW;
private LinearLayout jwX;
private LinearLayout jwY;
private LinearLayout jwZ;
private View jxa;
private View jxb;
private FTSLocalPageRelevantView jxc;
private TextView jxd;
private TextView jxe;
private View jxf;
private View jxg;
private TextView jxh;
private String jxi;
private Map<String, Integer> jxj = new HashMap();
private j jxk;
private b jxl = new 6(this);
private d jxm = new 3(this);
private OnClickListener jxn = new 5(this);
private c<tt> jxo = new 13(this);
static /* synthetic */ void b(FTSMainUI fTSMainUI, String str) {
com.tencent.mm.plugin.fts.ui.c.b bVar = fTSMainUI.jxk.jwK;
bVar.jzl = fTSMainUI.jxk.getBlockCount() + 1;
int count = fTSMainUI.jxk.getCount();
int i = fTSMainUI.jsZ;
int i2 = com.tencent.mm.plugin.fts.a.d.Cx(str) ? 8 : 9;
int i3 = count + 1;
long currentTimeMillis = System.currentTimeMillis() - bVar.jyY;
if (currentTimeMillis < 0 || bVar.jyY == 0) {
currentTimeMillis = 0;
}
x.v("MicroMsg.FTS.FTSReportLogic", "report home page click: %d, %s", new Object[]{Integer.valueOf(10991), String.format("%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s", new Object[]{Integer.valueOf(i), Integer.valueOf(i2), Integer.valueOf(i3), Integer.valueOf(0), Integer.valueOf(0), "", "", Integer.valueOf(0), Integer.valueOf(0), Integer.valueOf(0), Integer.valueOf(0), "", Long.valueOf(currentTimeMillis), Integer.valueOf(bVar.jzb), Integer.valueOf(bVar.jzc), Integer.valueOf(bVar.jzd), Integer.valueOf(bVar.jze), Integer.valueOf(bVar.jzf), Integer.valueOf(bVar.jzg), Integer.valueOf(bVar.jzh), Integer.valueOf(bVar.jzj), Integer.valueOf(bVar.jzk), e.jqM, str, Integer.valueOf(bVar.jzi), Integer.valueOf(bVar.jzl)})});
x.i("MicroMsg.FTS.FTSReportLogic", "lxl, click blockpos:" + bVar.jzl);
h.mEJ.k(10991, r0);
j jVar = fTSMainUI.jxk;
jVar.jwG = true;
if (!bi.oW(jVar.bWm)) {
ad.h(jVar.bWm, jVar.jvU, 1, 3);
}
if (str != null && str.length() != 0 && str.trim().length() != 0) {
fTSMainUI.jvZ = Character.isDigit(str.charAt(0)) ? 15 : 3;
11 11 = new 11(fTSMainUI, str);
g.DF().a(s$l.AppCompatTheme_ratingBarStyle, 11);
f fVar = new f(str, 3);
g.DF().a(fVar, 0);
fTSMainUI.getString(n.g.app_tip);
fTSMainUI.iwc = com.tencent.mm.ui.base.h.a(fTSMainUI, fTSMainUI.getString(n.g.search_contact_doing), true, new 12(fTSMainUI, fVar, 11));
}
}
static /* synthetic */ void d(FTSMainUI fTSMainUI) {
fTSMainUI.jxk.jwG = true;
String str = fTSMainUI.bWm;
if (str != null && !bi.oW(str.trim()) && System.currentTimeMillis() - fTSMainUI.ghF > 1000) {
fTSMainUI.ghF = System.currentTimeMillis();
((com.tencent.mm.plugin.websearch.api.f) g.l(com.tencent.mm.plugin.websearch.api.f.class)).b(fTSMainUI.mController.tml, 3, str, e.jqM);
ad.Ac(3);
if (!bi.oW(fTSMainUI.bWm)) {
ad.h(fTSMainUI.bWm, 2, 2, 3);
}
fTSMainUI.jxa.setEnabled(false);
com.tencent.mm.plugin.fts.ui.c.b bVar = fTSMainUI.jxk.jwK;
if (fTSMainUI.jxf == null || fTSMainUI.jxf.getVisibility() != 0) {
bVar.jzl = fTSMainUI.jxk.getBlockCount() + 1;
} else {
bVar.jzl = fTSMainUI.jxk.getBlockCount() + 2;
}
int count = fTSMainUI.jxk.getCount();
int i = fTSMainUI.jsZ;
int i2 = count + 1;
long currentTimeMillis = System.currentTimeMillis() - bVar.jyY;
if (currentTimeMillis < 0 || bVar.jyY == 0) {
currentTimeMillis = 0;
}
x.v("MicroMsg.FTS.FTSReportLogic", "report home page click: %d, %s", new Object[]{Integer.valueOf(10991), String.format("%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s", new Object[]{Integer.valueOf(i), Integer.valueOf(18), Integer.valueOf(i2), Integer.valueOf(0), Integer.valueOf(0), "", "", Integer.valueOf(0), Integer.valueOf(0), Integer.valueOf(0), Integer.valueOf(0), "", Long.valueOf(currentTimeMillis), Integer.valueOf(bVar.jzb), Integer.valueOf(bVar.jzc), Integer.valueOf(bVar.jzd), Integer.valueOf(bVar.jze), Integer.valueOf(bVar.jzf), Integer.valueOf(bVar.jzg), Integer.valueOf(bVar.jzh), Integer.valueOf(bVar.jzj), Integer.valueOf(bVar.jzk), e.jqM, str, Integer.valueOf(bVar.jzi), Integer.valueOf(bVar.jzl)})});
x.i("MicroMsg.FTS.FTSReportLogic", "lxl, click blockpos:" + bVar.jzl);
h.mEJ.k(10991, r0);
}
}
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
if (VERSION.SDK_INT >= 21) {
Transition inflateTransition = TransitionInflater.from(this).inflateTransition(17760258);
TransitionInflater.from(this).inflateTransition(17760258);
inflateTransition.excludeTarget(getWindow().getDecorView().findViewById(n.d.action_bar_container), true);
inflateTransition.excludeTarget(16908335, true);
getWindow().setEnterTransition(inflateTransition);
}
cqh();
e.jqM = p.zK(3);
x.d("MicroMsg.FTS.FTSReportLogic", "reportFTSEnterClick: %d, %s", new Object[]{Integer.valueOf(10991), String.format("%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s", new Object[]{Integer.valueOf(this.jsZ), Integer.valueOf(1), Integer.valueOf(0), Integer.valueOf(0), Integer.valueOf(0), "", Integer.valueOf(0), Integer.valueOf(0), Integer.valueOf(0), Integer.valueOf(0), Integer.valueOf(0), "", Integer.valueOf(0), Integer.valueOf(0), Integer.valueOf(0), Integer.valueOf(0), Integer.valueOf(0), Integer.valueOf(0), Integer.valueOf(0), Integer.valueOf(0), Integer.valueOf(0), Integer.valueOf(0), e.jqM, ""})});
h.mEJ.k(10991, r0);
this.jwW = (FTSMainUIEducationLayout) findViewById(n.d.search_education_layout);
this.jwZ = (LinearLayout) findViewById(n.d.search_loading_view);
this.jwW.setOnCellClickListener(this.jxn);
this.jwW.setOnHotwordClickListener(new 1(this));
this.jwW.setNeedHotWord(false);
g.l(com.tencent.mm.plugin.appbrand.widget.recentview.d.class);
com.tencent.mm.modelgeo.c.OB().a(this, true);
if (((n) g.n(n.class)).getFTSImageLoader() == null) {
finish();
return;
}
((n) g.n(n.class)).getFTSImageLoader().aPO();
r.zZ(3);
com.tencent.mm.sdk.b.a.sFg.a(this.jxo);
}
public void onBackPressed() {
finish();
}
protected final void aQB() {
switch (getIntent().getIntExtra("from_tab_index", -1)) {
case 0:
this.jsZ = 1;
return;
case 1:
this.jsZ = 2;
return;
case 2:
this.jsZ = 3;
return;
case 3:
this.jsZ = 4;
return;
default:
this.jsZ = 0;
return;
}
}
protected final boolean aQH() {
return w.chM();
}
protected final d a(e eVar) {
this.jxk = new j(eVar, this.jsZ, this.jxl);
return this.jxk;
}
protected final int getLayoutId() {
return n.e.fts_main_ui;
}
public final void a(com.tencent.mm.plugin.fts.a.d.a.a aVar) {
}
protected void onDestroy() {
com.tencent.mm.modelgeo.c.OB().c(this);
if (((n) g.n(n.class)).getFTSImageLoader() != null) {
((n) g.n(n.class)).getFTSImageLoader().aPP();
}
com.tencent.mm.sdk.b.a.sFg.c(this.jxo);
super.onDestroy();
}
protected void onResume() {
super.onResume();
sh shVar = new sh();
shVar.cdd.btC = 0;
com.tencent.mm.sdk.b.a.sFg.m(shVar);
Intent intent = new Intent();
intent.setComponent(new ComponentName(i.thA, "com.tencent.mm.booter.MMReceivers$ToolsProcessReceiver"));
intent.putExtra("tools_process_action_code_key", "com.tencent.mm.intent.ACTION_START_TOOLS_PROCESS");
sendBroadcast(intent);
if (this.jxa != null) {
this.jxa.setEnabled(true);
}
if (!bi.oW(this.jxi)) {
this.bWm = this.jxi;
this.jxi = null;
}
p.bSQ();
}
public void finish() {
int i = 100;
if (!this.mController.hideVKB()) {
i = 0;
}
ah.i(new 7(this), (long) i);
}
public final boolean a(boolean z, float f, float f2, int i, double d, double d2, double d3) {
x.i("MicroMsg.FTS.FTSMainUI", "onGetLocation %b %f|%f", new Object[]{Boolean.valueOf(z), Float.valueOf(f), Float.valueOf(f2)});
com.tencent.mm.modelgeo.c.OB().c(this);
return false;
}
private void aQO() {
this.jwW.setVisibility(0);
this.jwW.aL();
}
private void aQP() {
this.jwW.setVisibility(8);
}
protected final void aQI() {
super.aQI();
aQP();
this.jwZ.setVisibility(8);
}
protected final void aQJ() {
super.aQJ();
aQO();
this.jwZ.setVisibility(8);
}
protected final void aQG() {
super.aQG();
aQO();
this.jwZ.setVisibility(8);
}
protected final void aQF() {
super.aQF();
aQP();
this.jwZ.setVisibility(8);
}
protected final void aQE() {
super.aQE();
aQP();
this.jwZ.setVisibility(8);
this.jwh.setVisibility(0);
this.jwj.setVisibility(8);
}
protected final void aQD() {
super.aQD();
aQP();
this.jwZ.setVisibility(8);
}
public final View ayg() {
if (this.jwX == null) {
this.jwX = (LinearLayout) getLayoutInflater().inflate(n.e.fts_loading_footer, null);
this.jxd = (TextView) this.jwX.findViewById(n.d.search_network_tv);
this.jxe = (TextView) this.jwX.findViewById(n.d.fts_on_search_network_tv);
try {
x.i("MicroMsg.FTS.FTSMainUI", "set searchNetworkTips %s", new Object[]{r.PX("webSearchBar").optString("wording")});
this.jxe.setText(r0);
} catch (Exception e) {
}
this.jxb = this.jwX.findViewById(n.d.search_network_divider);
this.jxa = this.jwX.findViewById(n.d.search_network_layout);
this.jxa.setOnClickListener(new 8(this));
this.jxc = new FTSLocalPageRelevantView(this);
this.jxc.setOnRelevantClickListener(new 9(this));
int indexOfChild = this.jwX.indexOfChild(this.jxa);
if (indexOfChild >= 0 && indexOfChild < this.jwX.getChildCount()) {
this.jwX.addView(this.jxc, indexOfChild + 1);
}
this.jxh = (TextView) this.jwX.findViewById(n.d.search_contact_tv);
this.jxg = this.jwX.findViewById(n.d.search_contact_divider);
this.jxf = this.jwX.findViewById(n.d.search_contact_layout);
this.jxf.setOnClickListener(new 10(this));
this.jwY = (LinearLayout) this.jwX.findViewById(n.d.footer_layout);
}
return this.jwX;
}
public final boolean pj(String str) {
return super.pj(str);
}
protected final void aQK() {
if (this.jwY != null) {
this.jwY.setVisibility(0);
}
}
protected final void aQL() {
if (this.jwY != null) {
this.jwY.setVisibility(8);
}
}
public final void a(boolean z, String[] strArr, long j, int i) {
super.a(z, strArr, j, i);
if (z) {
if (strArr == null || strArr.length <= 0) {
e.qf(2);
} else {
e.qf(1);
}
com.tencent.mm.bg.d.e(this, ".ui.voicesearch.VoiceSearchResultUI", new Intent().putExtra("VoiceSearchResultUI_Resultlist", strArr).putExtra("VoiceSearchResultUI_VoiceId", j).putExtra("VoiceSearchResultUI_ShowType", i));
return;
}
e.qf(4);
com.tencent.mm.bg.d.e(this, ".ui.voicesearch.VoiceSearchResultUI", new Intent().putExtra("VoiceSearchResultUI_Resultlist", new String[0]).putExtra("VoiceSearchResultUI_Error", this.mController.tml.getString(n.g.search_contact_iap_err)).putExtra("VoiceSearchResultUI_VoiceId", j).putExtra("VoiceSearchResultUI_ShowType", i));
}
public final void K(int i, boolean z) {
super.K(i, z);
this.jxc.setVisibility(8);
if (!z && i == 0 && this.jxk.jwS) {
this.jwZ.setVisibility(0);
} else {
this.jwZ.setVisibility(8);
}
if (z) {
boolean Cx = com.tencent.mm.plugin.fts.a.d.Cx(this.bWm);
boolean Cy = com.tencent.mm.plugin.fts.a.d.Cy(this.bWm);
if (i > 0) {
if (Cx || Cy) {
this.jxg.setVisibility(0);
}
this.jxb.setVisibility(0);
} else {
this.jxg.setVisibility(8);
if (Cx || Cy) {
this.jxb.setVisibility(0);
} else {
this.jxb.setVisibility(8);
}
}
if (Cx || Cy) {
this.jxf.setVisibility(0);
}
this.jxa.setVisibility(0);
if (this.bWm != null && this.bWm.length() > 0) {
((com.tencent.mm.plugin.websearch.api.e) g.l(com.tencent.mm.plugin.websearch.api.e.class)).a(this.bWm, this.jxm);
return;
}
return;
}
this.jxa.setVisibility(8);
this.jxf.setVisibility(8);
}
protected final void aQy() {
super.aQy();
this.jxd.setText(j.a(this, com.tencent.mm.plugin.fts.a.f.a(getString(n.g.fts_on_search_network), "", com.tencent.mm.plugin.fts.a.a.d.b(this.bWm, this.bWm)).jrO, com.tencent.mm.bp.a.ad(this, n.b.NormalTextSize)));
CharSequence charSequence = null;
if (com.tencent.mm.plugin.fts.a.d.Cx(this.bWm)) {
charSequence = com.tencent.mm.plugin.fts.a.f.a(getString(n.g.fts_find_phone_qq_tip_prefix), "", com.tencent.mm.plugin.fts.a.a.d.b(this.bWm, this.bWm)).jrO;
} else if (com.tencent.mm.plugin.fts.a.d.Cy(this.bWm)) {
charSequence = com.tencent.mm.plugin.fts.a.f.a(getString(n.g.fts_find_wxid_tip_prefix), "", com.tencent.mm.plugin.fts.a.a.d.b(this.bWm, this.bWm)).jrO;
}
this.jxh.setText(j.a(this, charSequence, com.tencent.mm.bp.a.ad(this, n.b.NormalTextSize)));
}
public void onClickWxApp(View view) {
if (view.getTag().equals("more-click")) {
((com.tencent.mm.plugin.appbrand.n.g) g.l(com.tencent.mm.plugin.appbrand.n.g.class)).a((Context) this, e.jqM, com.tencent.mm.plugin.appbrand.n.g.a.gsN);
} else if (view.getTag().equals("more-swipe")) {
((com.tencent.mm.plugin.appbrand.n.g) g.l(com.tencent.mm.plugin.appbrand.n.g.class)).a((Context) this, e.jqM, com.tencent.mm.plugin.appbrand.n.g.a.gsO);
} else {
((com.tencent.mm.plugin.appbrand.n.g) g.l(com.tencent.mm.plugin.appbrand.n.g.class)).a((Context) this, (com.tencent.mm.plugin.appbrand.n.g.c) view.getTag(), e.jqM);
}
}
}
|
package com.esc.fms.service.right;
import com.esc.fms.entity.User;
import com.esc.fms.entity.UserListElement;
import java.util.List;
import java.util.Set;
/**
* Created by tangjie on 2016/11/27.
*/
public interface UserService {
int insert(User user);
User getUserByUserName(String userName);
Set<String> getRolesByUserName(String userName);
Set<String> getPermissionsByUserName(String userName);
List<UserListElement> getUserList(String userName,String staffName, int offset,int pageSize);
Integer getCountByConditions(String userName,String staffName);
boolean addUser(User user,List<Integer> roles);
User selectByPrimaryKey(Integer userID);
boolean editUser(User user,List<Integer> oldRoles,List<Integer> newRoles);
boolean disableUser(List<Integer> userIDs);
int authenticateUser(String userName, String password);
int modifyPasswordByUserName(String userName, String password);
}
|
package com.gdcp.weibo.dao;
import com.gdcp.weibo.entity.Forward;
public interface ForwardDao {
/**
* ๆฐๅข่ฝฌๅ
* @param forward
* @return
*/
int insertForward(Forward forward);
}
|
package main;
public class EntityNotFoundException extends Exception{
private String message;
private long todoId;
public static EntityNotFoundException createWith(long todoId, String message) {
return new EntityNotFoundException(todoId, message);
}
public EntityNotFoundException(long todoId, String message) {
this.todoId = todoId;
this.message = message;
}
@Override
public String getMessage() {
return message;
}
}
|
package com.tencent.mm.plugin.sns.model;
import com.tencent.mm.plugin.sns.h.b;
public interface ae {
b bxT();
}
|
package com.pybeta.daymatter.ui;
import android.app.Activity;
import android.content.Intent;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager.NameNotFoundException;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.pybeta.daymatter.R;
import com.pybeta.daymatter.R.anim;
import com.pybeta.daymatter.R.id;
import com.pybeta.daymatter.R.layout;
import com.pybeta.daymatter.R.string;
import com.pybeta.ui.widget.UcTitleBar;
import com.pybeta.ui.widget.UcTitleBar.ITitleBarListener;
import com.umeng.fb.UMFeedbackService;
public class AboutRecActivity extends Activity {
private UcTitleBar mTitleBar = null;
private TextView mTvVersion = null;
private RelativeLayout mLayoutFeedBack = null;
private RelativeLayout mLayoutWebsite = null;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_about_rec);
mTitleBar = (UcTitleBar)this.findViewById(R.id.uc_titlebar);
mTvVersion = (TextView)this.findViewById(R.id.tv_version_about);
mLayoutFeedBack = (RelativeLayout)this.findViewById(R.id.layout_feedback_about);
mLayoutWebsite = (RelativeLayout)this.findViewById(R.id.layout_appweb_about);
initTitleBar();
initContentView();
}
private void initTitleBar(){
mTitleBar.setTitleText(getResources().getString(R.string.title_activity_about));
mTitleBar.setViewVisible(false, true, false, false, false, false, false, false);
mTitleBar.setListener(new ITitleBarListener() {
@Override
public void shareClick(Object obj) {
// TODO Auto-generated method stub
}
@Override
public void menuClick(Object obj) {
// TODO Auto-generated method stub
}
@Override
public void feedBackClick(Object obj) {
// TODO Auto-generated method stub
}
@Override
public void editClick(Object obj) {
// TODO Auto-generated method stub
}
@Override
public void completeClick(Object obj) {
// TODO Auto-generated method stub
}
@Override
public void closeClick(Object obj) {
// TODO Auto-generated method stub
}
@Override
public void backClick(Object obj) {
// TODO Auto-generated method stub
finish();
overridePendingTransition(R.anim.push_right_in, R.anim.push_right_out);
}
@Override
public void addClick(Object obj) {
// TODO Auto-generated method stub
}
});
}
private void initContentView(){
mTvVersion.setText(getVersionCode()+"");
mLayoutFeedBack.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
UMFeedbackService.openUmengFeedbackSDK(AboutRecActivity.this);
finish();
}
});
mLayoutWebsite.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
Intent intent= new Intent();
intent.setAction("android.intent.action.VIEW");
Uri content_url = Uri.parse("http://"+getResources().getString(R.string.website068));
intent.setData(content_url);
startActivity(intent);
}
});
}
private String getVersionCode(){
String versionCode = "";
try {
PackageInfo pi = this.getPackageManager().getPackageInfo(this.getPackageName(), 0);
versionCode = pi.versionName;
} catch (NameNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return versionCode;
}
}
|
package dk.au.cs.thor.robotium2espresso.widgets;
import dk.au.cs.thor.robotium2espresso.Solo;
import android.widget.Button;
public class WeakButton {
private Updater<Button> updater;
public WeakButton(Button widget, Solo solo) {
int id = widget.getId();
updater = Updater.<Button>fromId(id, solo);
}
public WeakButton(Updater<Button> updater) {
this.updater = updater;
}
public boolean isEnabled() {
return updater.update().isEnabled();
}
}
|
/*
* 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 snakesandladders.Squares;
import java.awt.Color;
import javax.swing.BoxLayout;
import javax.swing.JLabel;
import snakesandladders.main.Board;
import snakesandladders.main.Player;
import snakesandladders.main.SnakesAndLaddersV20;
/**
*Abstract class extended by all the types of squares of the board
* @author Zac
*/
public abstract class Square extends JLabel {
//Fields
private int number;
private Color myColor = Color.decode("#43B7BA");
//Constructors
/**
*Creates a square with the number given, adds the background color
* and the text of the square.
* @param number
*/
public Square(int number) {
this.number = number;
setLayout(new BoxLayout(this, BoxLayout.X_AXIS));
setOpaque(true);
setBackground(myColor);
setText("" + number);
setHorizontalAlignment(JLabel.RIGHT);
setVerticalAlignment(JLabel.BOTTOM);
revalidate();
}
//Methods
/**
*Overridden by special squares to apply effects to the players and board
* @param player1
* @param player2
* @param board
* @param snl
*/
public abstract void applyEffect(Player player1, Player player2, Board board, SnakesAndLaddersV20 snl);
//GetterSetters
/**
*
* @return
*/
public int getNumber() {
return number;
}
/**
*
* @param number
*/
public void setNumber(int number) {
this.number = number;
}
}
|
package ericlwan_CSCI201_FinalProject;
import java.util.Vector;
// Intermediate class used for storing historical data from SQL database
public class HistoricalData {
Vector<Car> cars = new Vector<Car>();
Vector<Averages> hourlyData = new Vector<Averages>();
int counter;
public HistoricalData() {
}
public Vector<Averages> updateData() {
counter = 0;
double daydivider=cars.size()/25.5;
int fourocounter = 0;
int oneOonecounter = 0;
int oneOfivecounter = 0;
int tencounter = 0;
double fourototal = 0;
double oneOonetotal = 0;
double oneOfivetotal = 0;
double tentotal = 0;
double fouroavg = 0;
double oneOoneavg = 0;
double oneOfiveavg = 0;
double tenavg = 0;
while (counter < cars.size()) {
if (cars.get(counter).freeway.equals("405")) {
fourototal += cars.get(counter).speed;
fourocounter++;
}
if (cars.get(counter).freeway.equals("101")) {
oneOonetotal += cars.get(counter).speed;
oneOonecounter++;
}
if (cars.get(counter).freeway.equals("105")) {
oneOfivetotal += cars.get(counter).speed;
oneOfivecounter++;
}
if (cars.get(counter).freeway.equals("10")) {
tentotal += cars.get(counter).speed;
tencounter++;
}
if ((counter % (int)daydivider) == 0 && counter != 0) {
/*
* System.out.println("405 total "+fourototal);
* System.out.println("405 counter "+fourocounter);
*
* System.out.println("101 total "+oneOonetotal);
* System.out.println("101 counter "+oneOonecounter);
*
* System.out.println("105 total "+oneOfivetotal);
* System.out.println("105 counter "+oneOfivecounter);
*
* System.out.println("10 total "+tentotal);
* System.out.println("10 counter "+tencounter);
*/
fouroavg = fourototal / fourocounter;
oneOoneavg = oneOonetotal / oneOonecounter;
oneOfiveavg = oneOfivetotal / oneOfivecounter;
tenavg = tentotal / tencounter;
Averages a = new Averages();
a.fouroavg = fouroavg;
a.oneOoneavg = oneOoneavg;
a.oneOfiveavg = oneOfiveavg;
a.tenavg = tenavg;
this.hourlyData.add(a);
fourocounter = 0;
oneOonecounter = 0;
oneOfivecounter = 0;
tencounter = 0;
fourototal = 0;
oneOonetotal = 0;
oneOfivetotal = 0;
tentotal = 0;
}
counter++;
}
int i = 0;
while (i < this.hourlyData.size()) {
/*
* System.out.println("405 avg at "+i+" is "+this.hourlyData.get(i).
* fouroavg);
* System.out.println("101 avg at "+i+" is "+this.hourlyData
* .get(i).oneOoneavg);
* System.out.println("105 avg at "+i+" is "+this
* .hourlyData.get(i).oneOfiveavg);
* System.out.println(" 10 avg at "+
* i+" is "+this.hourlyData.get(i).tenavg);
*/
i++;
}
return hourlyData;
}
class Averages {
public double fouroavg;
public double oneOoneavg;
public double oneOfiveavg;
public double tenavg;
public Averages() {
}
}
}
|
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
public class Pageload {
public static void main(String[] args) {
WebDriver driver=new ChromeDriver();
driver.get("https://www.magento.com");
driver.manage().timeouts().pageLoadTimeout(0,TimeUnit.SECONDS);
driver.findElement(By.linkText("My Account")).click();
}
}
|
package com.cloudogu.smeagol.wiki.infrastructure;
import com.cloudogu.smeagol.wiki.domain.Path;
import com.cloudogu.smeagol.wiki.domain.WikiId;
import jakarta.servlet.http.HttpServletRequest;
import org.springframework.stereotype.Component;
/**
* Extracts the wildcard part as {@link Path} from the request.
*/
@Component
public class WildcardPathExtractor {
/**
* Extracts the wildcard part of the request as {@link Path}, by using the servlet path to get the url of the
* endpoint.
*
* @param request http servlet request
* @param pathMapping mapping of the rest endpoint with placeholders e.g.: /v1/{repositoryId}/{branch}/mypath
* @param wikiId id of wiki
*
* @return wildcard part of the request as {@link Path}
*/
public Path extractPathFromRequest(HttpServletRequest request, String pathMapping, WikiId wikiId) {
// we need to extract the path from request, because there is no matcher which allows slashes in spring
// https://stackoverflow.com/questions/4542489/match-the-rest-of-the-url-using-spring-3-requestmapping-annotation
// and we must mock the path extractor in our tests, because request.getServletPath is empty in the tests.
String base = pathMapping.replace("{repositoryId}", wikiId.getRepositoryID())
.replace("{branch}", wikiId.getBranch());
return Path.valueOf(extract(request, base));
}
private String extract(HttpServletRequest request, String base) {
String servletPath = request.getServletPath();
String path = servletPath.substring(base.length());
if (path.startsWith("/")) {
path = path.substring(1);
}
return path;
}
}
|
package entity;
import java.io.Serializable;
import java.util.List;
public class ServerResponse implements Serializable {
private static final long serialVersionUID = 1L;
private boolean success;
private List<Book> books;
private String message;
public ServerResponse(){}
public boolean isSuccess() {
return success;
}
public void setError(String message) {
success = false;
this.message = message;
}
public List<Book> getBooks() {
return books;
}
public void setBooks(List<Book> Books) {
this.books = Books;
}
public String getMessage() {
return message;
}
public void setSuccess(String message) {
this.message = message;
success = true;
}
}
|
package android.support.v4.d;
interface e$c {
int b(CharSequence charSequence, int i);
}
|
package GUIModule;
import javax.swing.*;
import java.awt.*;
public class ReportTableWindow extends JFrame {
JTable table;
ReportTableWindow(JTable table){
super("ะะพะดัะพะฑะฝัะน ะพััะตั");
this.table = table;
initialize();
}
private void initialize() {
JScrollPane scrollPane = new JScrollPane(table);
JPanel mainPanel = new JPanel(new BorderLayout());
mainPanel.add(scrollPane, BorderLayout.CENTER);
setContentPane(mainPanel);
setSize(500,200);
setVisible(true);
}
}
|
package org.jfree.data.test;
import static org.junit.Assert.*;
import org.jfree.data.Range;
import org.junit.*;
/**
* A Test Suit for testing equals function of Range class
*
* @author Group 8 - Quan, Alex, Sebastian, Carlos
*
*/
public class RangeTestEqual{
private Range exampleRange;
@BeforeClass
public static void setUpBeforeClass()
throws Exception{}
/**
* Testing equal function from Range class
* With data:
* Range 1: (-1, 1)
* Range 2: null
*/
@Test
public void equalsWithNullRangeTest(){ //Passed
exampleRange = new Range(-1,1);
Range exampleRange2 = null;
boolean equal = exampleRange.equals(exampleRange2);
assertEquals("The boolean should be false", false, equal);
}
/**
* Testing equal function from Range class
* With data:
* Range 1: (-1, 1)
* Range 2: (-1, 1)
*/
@Test
public void SimpleEqualsTest() { //Pass
Range exampleRange1 = new Range(-1,1);
Range exampleRange2 = new Range(-1,1);
boolean areSame = exampleRange1.equals(exampleRange2);
assertEquals("The ranges should be the equal",true,areSame);
}
/**
* Testing equal function from Range class
* With data:
* Range 1: (-1, 1)
* Range 2: (-600, -500)
*/
@Test
public void SimpleNotEqualsTest() { //Pass
Range exampleRange1 = new Range(-1,1);
Range exampleRange2 = new Range(-600,-500);
boolean areDifferent = !exampleRange1.equals(exampleRange2);
assertEquals("The ranges should not be equal",true,areDifferent);
}
/**
* Testing equal function from Range class
* With data:
* Range 1: (-Double.MAX_VALUE, Double.MAX_VALUE)
* Range 2: (-Double.MAX_VALUE, Double.MAX_VALUE)
*/
@Test
public void MaxRangeEqualTest() { //Pass
Range exampleRange1 = new Range(-Double.MAX_VALUE,Double.MAX_VALUE);
Range exampleRange2 = new Range(-Double.MAX_VALUE,Double.MAX_VALUE);
boolean areSame = exampleRange1.equals(exampleRange2);
assertEquals("The ranges should be equal",true,areSame);
}
/**
* Testing equal function from Range class
* With data:
* Range 1: (-Double.MAX_VALUE-1, Double.MAX_VALUE+1)
* Range 2: (-Double.MAX_VALUE-1, Double.MAX_VALUE+1)
*/
@Test
public void OverMaxRangeEqualTest() { //Pass
Range exampleRange1 = new Range(-Double.MAX_VALUE-1,Double.MAX_VALUE+1);
Range exampleRange2 = new Range(-Double.MAX_VALUE-1,Double.MAX_VALUE+1);
boolean areSame = exampleRange1.equals(exampleRange2);
assertEquals("The ranges should be equal",true,areSame);
}
/**
* Testing equal function from Range class
* With data:
* Range 1: (-Double.MAX_VALUE-1, Double.MAX_VALUE+1)
* Range 2: (-Double.MAX_VALUE-1, Double.MAX_VALUE+1)
*/
@Test(expected = AssertionError.class)
public void overMaxRangeNotEqualTest() { //Fail
Range exampleRange1 = new Range(-Double.MAX_VALUE-1,Double.MAX_VALUE+1);
Range exampleRange2 = new Range(-Double.MAX_VALUE-2,Double.MAX_VALUE+2);
boolean areDifferent = !exampleRange1.equals(exampleRange2);
assertEquals("The ranges should be equal",true,areDifferent);
}
@After
public void tearDown() throws Exception{}
@AfterClass
public static void tearDownAfterClass() throws Exception{}
}
|
package javax.vecmath;
import java.io.Serializable;
public abstract class Tuple2d implements Serializable, Cloneable {
static final long serialVersionUID = 6205762482756093838L;
public double x;
public double y;
public Tuple2d(double x, double y) {
this.x = x;
this.y = y;
}
public Tuple2d(double[] t) {
this.x = t[0];
this.y = t[1];
}
public Tuple2d(Tuple2d t1) {
this.x = t1.x;
this.y = t1.y;
}
public Tuple2d(Tuple2f t1) {
this.x = t1.x;
this.y = t1.y;
}
public Tuple2d() {
this.x = 0.0D;
this.y = 0.0D;
}
public final void set(double x, double y) {
this.x = x;
this.y = y;
}
public final void set(double[] t) {
this.x = t[0];
this.y = t[1];
}
public final void set(Tuple2d t1) {
this.x = t1.x;
this.y = t1.y;
}
public final void set(Tuple2f t1) {
this.x = t1.x;
this.y = t1.y;
}
public final void get(double[] t) {
t[0] = this.x;
t[1] = this.y;
}
public final void add(Tuple2d t1, Tuple2d t2) {
t1.x += t2.x;
t1.y += t2.y;
}
public final void add(Tuple2d t1) {
this.x += t1.x;
this.y += t1.y;
}
public final void sub(Tuple2d t1, Tuple2d t2) {
t1.x -= t2.x;
t1.y -= t2.y;
}
public final void sub(Tuple2d t1) {
this.x -= t1.x;
this.y -= t1.y;
}
public final void negate(Tuple2d t1) {
this.x = -t1.x;
this.y = -t1.y;
}
public final void negate() {
this.x = -this.x;
this.y = -this.y;
}
public final void scale(double s, Tuple2d t1) {
this.x = s * t1.x;
this.y = s * t1.y;
}
public final void scale(double s) {
this.x *= s;
this.y *= s;
}
public final void scaleAdd(double s, Tuple2d t1, Tuple2d t2) {
this.x = s * t1.x + t2.x;
this.y = s * t1.y + t2.y;
}
public final void scaleAdd(double s, Tuple2d t1) {
this.x = s * this.x + t1.x;
this.y = s * this.y + t1.y;
}
public int hashCode() {
long bits = 1L;
bits = VecMathUtil.hashDoubleBits(bits, this.x);
bits = VecMathUtil.hashDoubleBits(bits, this.y);
return VecMathUtil.hashFinish(bits);
}
public boolean equals(Tuple2d t1) {
try {
return (this.x == t1.x && this.y == t1.y);
} catch (NullPointerException e2) {
return false;
}
}
public boolean equals(Object t1) {
try {
Tuple2d t2 = (Tuple2d)t1;
return (this.x == t2.x && this.y == t2.y);
} catch (NullPointerException e2) {
return false;
} catch (ClassCastException e1) {
return false;
}
}
public boolean epsilonEquals(Tuple2d t1, double epsilon) {
double diff = this.x - t1.x;
if (Double.isNaN(diff))
return false;
if (((diff < 0.0D) ? -diff : diff) > epsilon)
return false;
diff = this.y - t1.y;
if (Double.isNaN(diff))
return false;
if (((diff < 0.0D) ? -diff : diff) > epsilon)
return false;
return true;
}
public String toString() {
return "(" + this.x + ", " + this.y + ")";
}
public final void clamp(double min, double max, Tuple2d t) {
if (t.x > max) {
this.x = max;
} else if (t.x < min) {
this.x = min;
} else {
this.x = t.x;
}
if (t.y > max) {
this.y = max;
} else if (t.y < min) {
this.y = min;
} else {
this.y = t.y;
}
}
public final void clampMin(double min, Tuple2d t) {
if (t.x < min) {
this.x = min;
} else {
this.x = t.x;
}
if (t.y < min) {
this.y = min;
} else {
this.y = t.y;
}
}
public final void clampMax(double max, Tuple2d t) {
if (t.x > max) {
this.x = max;
} else {
this.x = t.x;
}
if (t.y > max) {
this.y = max;
} else {
this.y = t.y;
}
}
public final void absolute(Tuple2d t) {
this.x = Math.abs(t.x);
this.y = Math.abs(t.y);
}
public final void clamp(double min, double max) {
if (this.x > max) {
this.x = max;
} else if (this.x < min) {
this.x = min;
}
if (this.y > max) {
this.y = max;
} else if (this.y < min) {
this.y = min;
}
}
public final void clampMin(double min) {
if (this.x < min)
this.x = min;
if (this.y < min)
this.y = min;
}
public final void clampMax(double max) {
if (this.x > max)
this.x = max;
if (this.y > max)
this.y = max;
}
public final void absolute() {
this.x = Math.abs(this.x);
this.y = Math.abs(this.y);
}
public final void interpolate(Tuple2d t1, Tuple2d t2, double alpha) {
this.x = (1.0D - alpha) * t1.x + alpha * t2.x;
this.y = (1.0D - alpha) * t1.y + alpha * t2.y;
}
public final void interpolate(Tuple2d t1, double alpha) {
this.x = (1.0D - alpha) * this.x + alpha * t1.x;
this.y = (1.0D - alpha) * this.y + alpha * t1.y;
}
public Object clone() {
try {
return super.clone();
} catch (CloneNotSupportedException e) {
throw new InternalError();
}
}
public final double getX() {
return this.x;
}
public final void setX(double x) {
this.x = x;
}
public final double getY() {
return this.y;
}
public final void setY(double y) {
this.y = y;
}
}
/* Location: C:\Users\BSV\AppData\Local\Temp\Rar$DRa6216.20396\Preview\Preview.jar!\javax\vecmath\Tuple2d.class
* Java compiler version: 8 (52.0)
* JD-Core Version: 1.1.3
*/
|
package com.example.finalproject;
import android.os.AsyncTask;
import java.util.ArrayList;
import java.util.Map;
public class GetMatchesTask extends AsyncTask<Void, Void, ArrayList<Map<String,Object>>> {
MainActivity ma;
GetMatchesTask(MainActivity man ){
ma = man;
}
@Override
protected ArrayList<Map<String,Object>> doInBackground(Void... params) {
return ma.dbit.getMatches();
}
@Override
protected void onPostExecute(final ArrayList<Map<String,Object>> profiles) {
String result = "\n\t{";
for (Map<String, Object> m : profiles){
result += "\n\t\t{";
result += "\n\t\t\tname: " + m.get("name");
result += "\n\t\t\tdescription: " + m.get("description");
result += "\n\t\t\tphone_number: " + m.get("contactInfo");
result += "\n\t\t}";
}
result += "\n\t}";
ma.updateUI("grep 'ping success' profiles.json",result);
}
}
|
package com.tencent.mm.plugin.music.model.notification;
import android.content.Intent;
import com.tencent.mm.sdk.b.c;
import com.tencent.mm.sdk.platformtools.ad;
import com.tencent.mm.sdk.platformtools.x;
public final class b {
public c fIu;
public MMMusicPlayerService lzf;
volatile boolean lzl = false;
final synchronized void biq() {
if (this.lzf == null || !this.lzl) {
this.lzl = true;
Intent intent = new Intent();
intent.setClass(ad.getContext(), MMMusicPlayerService.class);
boolean bindService = ad.getContext().bindService(intent, new 2(this), 1);
x.i("MicroMsg.Music.MMMusicNotificationHelper", "isOk:%b", new Object[]{Boolean.valueOf(bindService)});
}
}
}
|
@NonNullApi
@NonNullFields
package fi.lassemaatta.temporaljooq.config.profile;
import org.springframework.lang.NonNullApi;
import org.springframework.lang.NonNullFields;
|
package com.mes.old.meta;
// Generated 2017-5-22 1:25:24 by Hibernate Tools 5.2.1.Final
/**
* BMeasureTool generated by hbm2java
*/
public class BMeasureTool implements java.io.Serializable {
private BMeasureToolId id;
private String toolName;
private String tolerancename;
private String tolerancetype;
private String barcode;
public BMeasureTool() {
}
public BMeasureTool(BMeasureToolId id, String toolName) {
this.id = id;
this.toolName = toolName;
}
public BMeasureTool(BMeasureToolId id, String toolName, String tolerancename, String tolerancetype,
String barcode) {
this.id = id;
this.toolName = toolName;
this.tolerancename = tolerancename;
this.tolerancetype = tolerancetype;
this.barcode = barcode;
}
public BMeasureToolId getId() {
return this.id;
}
public void setId(BMeasureToolId id) {
this.id = id;
}
public String getToolName() {
return this.toolName;
}
public void setToolName(String toolName) {
this.toolName = toolName;
}
public String getTolerancename() {
return this.tolerancename;
}
public void setTolerancename(String tolerancename) {
this.tolerancename = tolerancename;
}
public String getTolerancetype() {
return this.tolerancetype;
}
public void setTolerancetype(String tolerancetype) {
this.tolerancetype = tolerancetype;
}
public String getBarcode() {
return this.barcode;
}
public void setBarcode(String barcode) {
this.barcode = barcode;
}
}
|
package ru.cscenter.practice.recsys;
import org.openqa.selenium.*;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
import ru.cscenter.practice.recsys.exceptions.NoAreasException;
import ru.cscenter.practice.recsys.exceptions.TooManyAreasException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.TimeUnit;
public abstract class Parser<T> {
private final WebDriver htmlPage;
private final int TIMEOUT_FOR_FEATURES = 1; // in seconds
private final int TIMEOUT_FOR_BUTTON = 1; // in seconds
private final int FREQUENCY = 200; // in milliseconds
public abstract T parse();
public Parser(WebDriver htmlPage) {
if(htmlPage == null)
throw new IllegalArgumentException("driver's provided html page is null");
this.htmlPage = htmlPage;
}
public List<String> getFeatures(final String expression, String attribute) {
if (expression == null)
return new ArrayList<>();
List<WebElement> items;
final List<String> result = new ArrayList<>();
WebDriverWait wait = new WebDriverWait(htmlPage, TIMEOUT_FOR_FEATURES, FREQUENCY);
try {
wait.until(ExpectedConditions.presenceOfAllElementsLocatedBy(By.xpath(expression)));
items = htmlPage.findElements(By.xpath(expression));
} catch (NoSuchElementException | ElementNotVisibleException | TimeoutException e) {
return result;
}
for (WebElement item : items) {
if (attribute != null)
result.add(item.getAttribute(attribute));
else
result.add(item.getText());
}
return result;
}
public List<String> getFeatures(final String expression) {
return getFeatures(expression, null);
}
public String getFeature(final String expression, final String attribute) throws TooManyAreasException, NoAreasException {
final List<String> result = getFeatures(expression, attribute);
if (result.size() > 1)
throw new TooManyAreasException("html file contains more than one areas that fit for object");
if (result.size() == 0)
throw new NoAreasException("html file contains no areas that fit for object");
return result.get(0);
}
public String getFeature(final String expression) throws TooManyAreasException, NoAreasException {
return getFeature(expression, null);
}
public int countFeatures(final String expression, final String attribute) {
final List<String> features = getFeatures(expression, attribute);
return features.size();
}
public int countFeatures(final String expression) {
return countFeatures(expression, null);
}
public static int getNumber(final String string) // if string contains more than one number then method return wrong number
{
if (string == null)
return 0;
final String number = string.replaceAll("\\D+", "");
return number.matches("\\d+") ? Integer.parseInt(number) : 0;
}
public static String removeSkipSymbols(final String string) {
if (string == null)
return "";
final List<String> words = Arrays.asList(string.split("\\s+"));
final StringBuilder builder = new StringBuilder();
for (String currentWord : words) {
if (currentWord.matches("\\S+"))
builder.append(currentWord).append(" ");
}
if (builder.length() > 0)
builder.deleteCharAt(builder.length() - 1);
return builder.toString();
}
public boolean clickAndWait(String expression) {
try {
WebElement nextPage = new WebDriverWait(htmlPage, TIMEOUT_FOR_BUTTON, FREQUENCY)
.until(ExpectedConditions.presenceOfElementLocated(By.xpath(expression)));
nextPage.click();
htmlPage.manage().timeouts().setScriptTimeout(5, TimeUnit.SECONDS);
htmlPage.manage().timeouts().pageLoadTimeout(15, TimeUnit.SECONDS);
htmlPage.manage().timeouts().implicitlyWait(1, TimeUnit.SECONDS);
Thread.sleep(2000);
} catch (NoSuchElementException | ElementNotVisibleException | TimeoutException e) {
return false;
} catch (Exception e) {
e.printStackTrace();
return false;
}
return true;
}
}
|
package importDataProcess;
/**
* Created by csw on 2016/10/11 14:27.
* Explain:
*/
public class ExceptionProcess {
public static String getExceptionInfo(Long batchNum) {
String info = null;
if (batchNum != null) {
if (ExceptionData.exceptionMap != null) {
info = ExceptionData.exceptionMap.get(batchNum);
}
} else {
info = "ๆนๆฌกๅทไธ่ฝไธบnull";
}
return info;
}
public static void clearExceptionInfo(Long batchNum) {
if (batchNum != null) {
ExceptionData.exceptionMap.put(batchNum, "");
}
}
}
|
package ru.ibs.intern.service;
import ru.ibs.intern.entity.Area;
import ru.ibs.intern.entity.Currency;
public interface DictionariesService {
}
|
package jk.pp.ta.pubsub.kafka.consumer;
import java.util.concurrent.ExecutorService;
public class InermittenConsumerImpl {
@SuppressWarnings("unused")
private ExecutorService executorSvc = null;
public InermittenConsumerImpl() {
}
public InermittenConsumerImpl(ExecutorService executorSvc) {
this.setExecutorService(executorSvc);
}
public void setExecutorService(ExecutorService executorSvc) {
this.executorSvc = executorSvc;
}
}
|
package com.youthchina.dtos;
/**
* Created by zhongyangwu on 2/26/19.
*/
/*
@SpringBootTest
@RunWith(SpringRunner.class)
public class RichTextDTOTest {
@Test
public void readRichTextDTO() {
//language=JSON
String json = "{\n" +
" \"braftEditorRaw\": {\n" +
" \"blocks\": [\n" +
" {\n" +
" \"key\": \"dtj4a\",\n" +
" \"text\": \"dsfgdfgdfg\",\n" +
" \"type\": \"unstyled\",\n" +
" \"depth\": 0,\n" +
" \"inlineStyleRanges\": [],\n" +
" \"entityRanges\": [],\n" +
" \"data\": {}\n" +
" }\n" +
" ],\n" +
" \"entityMap\": {\n" +
" }\n" +
" },\n" +
" \"previewText\": \"sdfgdfgdfg\",\n" +
" \"resourceIdList\": []\n" +
"}";
RichTextResponseDTO richTextDTO = null;
try {
richTextDTO = new ObjectMapper().readValue(json, RichTextResponseDTO.class);
System.out.println(richTextDTO);
} catch (IOException e) {
Assert.fail();
}
Assert.assertEquals("sdfgdfgdfg", richTextDTO.getPreviewText());
String output = null;
try {
output = new ObjectMapper().writeValueAsString(richTextDTO);
System.out.println(output);
} catch (JsonProcessingException e) {
Assert.fail();
}
}
}*/
|
package com.pduleba.spring.data.services;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.pduleba.jpa.model.OwnerModel;
import com.pduleba.spring.data.dao.OwnerDao;
@Service
public class OwnerServiceImpl implements OwnerService {
@Autowired
private OwnerDao ownerDao;
@Override
public void create(OwnerModel owner) {
ownerDao.saveAndFlush(owner);
}
@Override
public void createAll(List<OwnerModel> owners) {
ownerDao.save(owners);
}
@Override
public OwnerModel getById(long ownerId) {
return ownerDao.getById(ownerId);
}
@Override
public void update(OwnerModel owner) {
ownerDao.saveAndFlush(owner);
}
@Override
public void delete(OwnerModel owner) {
ownerDao.delete(owner);
}
@Override
public long count() {
return ownerDao.count();
}
// ------------------------------------------------
// Query methods
// ------------------------------------------------
@Override
public List<OwnerModel> getByFirstName(String firstName) {
return ownerDao.getByFirstName(firstName);
}
}
|
/*
* Copyright 2014, Stratio.
*
* 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.stratio.cassandra.index.service;
import org.apache.cassandra.dht.Token;
import org.apache.lucene.search.FieldComparator;
import org.apache.lucene.util.BytesRef;
/**
* {@link FieldComparator} that compares {@link Token} field sorting by its Cassandra's partitioner.
*
* @author Andres de la Pena <adelapena@stratio.com>
*/
public class TokenMapperGenericSorter extends FieldComparator.TermValComparator {
/** The PartitionKeyComparator to be used. */
private final TokenMapperGeneric tokenMapperGeneric;
/**
* Returns a new {@code TokenMapperGenericSorter}
*
* @param tokenMapperGeneric The {@code TokenMapperGenericSorter} to be used.
* @param numHits The number of hits.
* @param field The field name.
*/
public TokenMapperGenericSorter(TokenMapperGeneric tokenMapperGeneric, int numHits, String field) {
super(numHits, field, false);
this.tokenMapperGeneric = tokenMapperGeneric;
}
/**
* Compares its two field value arguments for order. Returns a negative integer, zero, or a positive integer as the
* first argument is less than, equal to, or greater than the second.
*
* @param val1 The first field value to be compared.
* @param val2 The second field value to be compared.
* @return A negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater
* than the second.
*/
@SuppressWarnings({"unchecked", "rawtypes"})
@Override
public int compareValues(BytesRef val1, BytesRef val2) {
if (val1 == null) {
if (val2 == null) {
return 0;
}
return -1;
} else if (val2 == null) {
return 1;
}
Token t1 = tokenMapperGeneric.token(val1);
Token t2 = tokenMapperGeneric.token(val2);
return t1.compareTo(t2);
}
}
|
package se.gareth.swm;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Color;
import java.util.ArrayList;
import java.util.LinkedList;
public class Owl1 extends Creature {
private static ArrayList<Sprite> mFlyingSprite;
private static ArrayList<LinkedList<Sprite>> mSplittedSpriteList;
private Vector2D mAcceleration;
private double mSpeed;
enum State {
ShowUp,
GoBack,
Go,
};
private State mState;
/* The number of levels supported for this creature */
protected static final int numLevels = 5;
private static int colorList[] = {
Color.rgb(0xc8, 0x71, 0x37),
Color.rgb(0x9f, 0x5a, 0x2c),
Color.rgb(0x7d, 0x47, 0x22),
Color.rgb(0x13, 0x11, 0x07),
Color.rgb(0x05, 0x05, 0x05)
};
public Owl1(GameBase gameBase, int level) {
/* Can take 100.0 damage, gives 10 points */
super(gameBase, 100 + 100 * level, 25 + level * 5);
mSpeed = 700 + level * 200;
if (mFlyingSprite == null) {
mFlyingSprite = new ArrayList<Sprite>();
mSplittedSpriteList = new ArrayList<LinkedList<Sprite>>();
for (int i = 0; i < numLevels; i ++) {
Bitmap tmpBitmap = BitmapFactory.decodeResource(game.res, R.drawable.owl1_flying);
Sprite sprite = new Sprite(Sprite.replaceColor(tmpBitmap,
Sprite.ColorChannel.GREEN, colorList[i]), 6);
mFlyingSprite.add(sprite);
LinkedList<Sprite> splittedSpriteList = createSplittedSprite(sprite);
mSplittedSpriteList.add(splittedSpriteList);
}
}
setSplittedSprite(mSplittedSpriteList.get(level));
setAnimation(new Animation(mFlyingSprite.get(level), 16, 0));
mAcceleration = new Vector2D(-400.0, 0);
applyForce(mAcceleration);
setDensity(400);
mState = State.ShowUp;
/* How big is our hit area */
setHitableRadius((double)(Math.min(getWidth(), getHeight()))/2.0);
/* Set default start position */
setPosition(game.getScreenWidth() + getWidth() / 2,
getHeight() / 2 + mRandom.nextInt((game.getPlayfieldHeight()/2 - (int)getHeight())));
}
@Override
protected void wasDestroyed(int damage) {
deleteMe();
}
@Override
public double isHit(ActiveObject object) {
/* Ignore being hit if not in Go state */
if (mState == State.Go) {
return super.isHit(object);
}
return 0.0;
}
@Override
protected void wasHit(int damage) {
super.wasHit(damage);
setSpeed(0.0);
}
@Override
public void update(final TimeStep timeStep) {
super.update(timeStep);
if (mState == State.ShowUp && (getX() - getWidth()/4) < game.getScreenWidth()) {
mAcceleration.set(400.0, 0);
mState = State.GoBack;
}
else if (mState == State.GoBack && (getX() - getWidth() / 2) > game.getScreenWidth()) {
mState = State.Go;
lookAt(0, getHeight() / 2 + mRandom.nextInt((game.getPlayfieldHeight()/2 - (int)getHeight())) + game.getPlayfieldHeight()/2);
mAcceleration.set(-mSpeed, 0);
mAcceleration.setDirection(this.mVelocity.getDirection());
}
if (getX() < 0) {
if ((getX() + getWidth()) < 0) {
deleteMe();
}
}
}
}
|
package com.legalzoom.api.test.dto;
/**
*
*/
public class CreateProcessingStatusCategoryIdDTO implements DTO {
private String processingStatusCategoryId; //pkProcessingCategory from ProcessingCategory
private String processId; //pkProcess from Process
public String getProcessingStatusCategoryId() {
return processingStatusCategoryId;
}
public void setProcessingStatusCategoryId(String processingStatusCategoryId) {
this.processingStatusCategoryId = processingStatusCategoryId;
}
public String getProcessId() {
return processId;
}
public void setProcessId(String processId) {
this.processId = processId;
}
}
|
package net.somethingnew.kawatan.flower;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.util.DisplayMetrics;
import android.util.SparseArray;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.widget.ImageView;
import android.widget.TabHost;
import android.widget.Toast;
import androidx.appcompat.app.AlertDialog;
import androidx.fragment.app.DialogFragment;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentTransaction;
import androidx.recyclerview.widget.RecyclerView;
import androidx.viewpager.widget.ViewPager;
import com.google.android.material.bottomnavigation.BottomNavigationView;
import net.somethingnew.kawatan.flower.db.dao.CardDao;
import net.somethingnew.kawatan.flower.db.dao.FolderDao;
import net.somethingnew.kawatan.flower.model.CardModel;
import net.somethingnew.kawatan.flower.model.FolderModel;
import net.somethingnew.kawatan.flower.util.LogUtility;
import java.util.Arrays;
import java.util.LinkedList;
public class CardSettingsDialogFragment extends DialogFragment {
GlobalManager globalMgr = GlobalManager.getInstance();
View mView;
RecyclerView.Adapter mRecyclerViewAdapter; // CardListใฎAdapterใๆฐ่ฆ่ฟฝๅ ใๅคๆดใๅณๆใซCardListใซๅๆ ใใใใใ
CardModel mCardModel;
FolderModel mFolder;
LinkedList<CardModel> mCardLinkedList;
LayoutInflater mInflater;
SparseArray<Fragment> mRegisteredFragments = new SparseArray<>();
int mMode; // ๆฐ่ฆ่ฟฝๅ or ็ทจ้
int mPosition; // ้ธๆใใCardใฎCardใฎไธ่ฆงๅ
ใงใฎไฝ็ฝฎ
CardSettingsDialogFragment(RecyclerView.Adapter recyclerViewAdapter, CardModel cardModel, int position) {
this.mRecyclerViewAdapter = recyclerViewAdapter;
this.mCardModel = cardModel;
this.mCardLinkedList = globalMgr.mCardListMap.get(globalMgr.mFolderLinkedList.get(globalMgr.mCurrentFolderIndex).getId());
this.mPosition = position;
for (int category = 0; category < Constants.NUM_OF_CATEGORY; category++) {
Fragment fragment = new CategoryIconFragment(category, Constants.CATEGORY_ICON_IN_CARD_SETTINGS);
mRegisteredFragments.put(category, fragment);
}
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
// ๅผใณๅบใๅดใใใฎๅผๆฐใฎๅใๅใ
mMode = getArguments().getInt(Constants.FOLDER_SETTINGS_DIALOG_ARG_KEY_MODE);
mFolder = globalMgr.mFolderLinkedList.get(globalMgr.mCurrentFolderIndex);
mInflater = (LayoutInflater) getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
mView = inflater.inflate(R.layout.dialog_card_settings, container, false);
mView.findViewById(R.id.linearLayoutWhole).setBackgroundColor(globalMgr.skinBodyColor);
mView.findViewById(R.id.linearLayoutMenu).setBackgroundColor(globalMgr.skinHeaderColor);
globalMgr.mCardSettings.cardViewFront = mView.findViewById(R.id.card_view_front);
globalMgr.mCardSettings.cardViewBack = mView.findViewById(R.id.card_view_back);
globalMgr.mCardSettings.editTextFront = mView.findViewById(R.id.editTextFront);
globalMgr.mCardSettings.editTextBack = mView.findViewById(R.id.editTextBack);
globalMgr.mCardSettings.imageViewIconFront = mView.findViewById(R.id.imageViewIconFront);
globalMgr.mCardSettings.imageViewIconBack = mView.findViewById(R.id.imageViewIconBack);
globalMgr.mChangedCardSettings = false;
buildEventListener();
buildBottomNavigationMenu();
// ใกใใฅใผๅ
ใขใคใณใณ
ImageView imageView1 = mView.findViewById(R.id.imageViewReserved1);
imageView1.setImageResource(IconManager.getResIdAtRandom(globalMgr.mCategory));
ImageView imageView2 = mView.findViewById(R.id.imageViewReserved2);
imageView2.setImageResource(IconManager.getResIdAtRandom(globalMgr.mCategory));
// ใใคใขใญใฐ่กจ็คบไธญใฎใฆใผใถใผใฎ่จญๅฎๅคๆดๆ
ๅ ฑใไธๆใคใณในใฟใณในใซไฟๆใใใใใซใคใณในใฟใณในไฝๆ๏ผๆฐ่ฆใClone๏ผ
if (mMode == Constants.CARD_SETTINGS_FOR_NEW) {
// ใขใคใณใณ่ชๅ่กจ็คบONใฎๅ ดๅใฏใAutoใ็ปๅใ่กจ็คบใใใใOFFใฎๅ ดๅใฏใฉใณใใ ใซ้ธใใ ใใฎใๅๆ่กจ็คบใจใใฆไธๆฆใ่กจ็คบใใ
int iconResId = globalMgr.isIconAuto ? IconManager.getAutoIconResId(globalMgr.mCategory) : IconManager.getResIdAtRandom(globalMgr.mCategory);
globalMgr.mTempCard = new CardModel(mFolder.getId(), iconResId);
} else {
// ้ธๆใใใCardใฎใฏใญใผใณ
globalMgr.mTempCard = mCardModel.clone();
}
// ใใใฆใจใใใฎใซใผใใธใฎๅๆ่กจ็คบ
globalMgr.mCardSettings.cardViewFront.setCardBackgroundColor(mFolder.getFrontBackgroundColor());
globalMgr.mCardSettings.cardViewBack.setCardBackgroundColor(mFolder.getBackBackgroundColor());
globalMgr.mCardSettings.editTextFront.setText(globalMgr.mTempCard.getFrontText());
globalMgr.mCardSettings.editTextFront.setTextColor(mFolder.getFrontTextColor());
globalMgr.mCardSettings.editTextBack.setText(globalMgr.mTempCard.getBackText());
globalMgr.mCardSettings.editTextBack.setTextColor(mFolder.getBackTextColor());
globalMgr.mCardSettings.imageViewIconFront.setImageResource(
globalMgr.isIconAuto ? IconManager.getAutoIconResId(globalMgr.mCategory) : globalMgr.mTempCard.getImageIconResId());
globalMgr.mCardSettings.imageViewIconBack.setImageResource(
globalMgr.isIconAuto ? IconManager.getAutoIconResId(globalMgr.mCategory) : globalMgr.mTempCard.getImageIconResId());
getDialog().getWindow().requestFeature(Window.FEATURE_NO_TITLE);
getDialog().setCanceledOnTouchOutside(true);
// OSใฎๆปใใใฟใณใฎ็กๅนๅ
// ใกใใฅใผๅ
ใฎๆปใใใฟใณใๅฎ่ฃ
ใใใพใงใฏใจใใใใใณใกใณใ
//this.setCancelable(false);
return mView;
}
/**
* ไธ่จใฎ้ใใonCloseใฎๅพใซๅผใณๅบใใใใใจใฏใชใใชใฃใใใ
* ็ขบ่ชAlertDialogใงgetDialog().dismiss()ใๅผใฐใใใจใใฏใใใซๆฅใ
*/
@Override
public void onDismiss(DialogInterface dialog) {
super.onDismiss(dialog);
//Toast.makeText(getActivity().getApplicationContext(), "onDismiss", Toast.LENGTH_LONG).show();
LogUtility.d("onDismiss");
}
@Override
public void onDestroy() {
super.onDestroy();
LogUtility.d("onDestroy");
}
/**
* ไธ้จใกใใฅใผ้ ๅใฎๅใขใคใณใณ็ปๅใใซใผใใฎ็ทจ้็ฎๆใฎใคใใณใใใณใใฉ
*/
public void buildEventListener() {
// ๆปใ
mView.findViewById(R.id.imageViewGoBack).setOnClickListener(v -> {
//Toast.makeText(getActivity().getApplicationContext(), "ใญใฃใณใปใซ", Toast.LENGTH_LONG).show();
if (mMode == Constants.FOLDER_SETTINGS_FOR_NEW) {
getDialog().dismiss(); // ไธ่ฆงใซๆปใ
return;
}
if (!globalMgr.mChangedCardSettings) {
// ๅคๆดใชใใฎๅ ดๅใฏ็ขบ่ชใใคใขใญใฐ็กใใงใใใซไธ่ฆงใซๆปใ
getDialog().dismiss();
return;
}
LogUtility.d("imageViewGoBack onClick");
new AlertDialog.Builder(getContext())
.setIcon(IconManager.getResIdAtRandom(globalMgr.mCategory))
.setTitle(R.string.dlg_title_goback_list)
.setMessage(R.string.dlg_msg_go_back_to_list)
.setPositiveButton(
R.string.go_back_list,
(dialog, which) -> {
LogUtility.d("[ไธ่ฆงใซๆปใ]ใ้ธๆใใใพใใ");
getDialog().dismiss(); // ่ฆชใๆถใ
})
.setNegativeButton(
R.string.cancel,
(dialog, which) -> {
LogUtility.d("[ใญใฃใณใปใซ]ใ้ธๆใใใพใใ");
// ใใฎAlertDialogใ ใใๆถใใ่ฆชใฎใใคใขใญใฐ่กจ็คบ็ถๆ
ใซๆปใ
})
.show();
});
// ไฟๅญ
mView.findViewById(R.id.imageViewSave).setOnClickListener(v -> {
if (!globalMgr.mChangedCardSettings) {
new AlertDialog.Builder(getContext())
.setIcon(IconManager.getResIdAtRandom(globalMgr.mCategory))
.setTitle(R.string.dlg_title_save_confirm)
.setMessage("ๅคๆดใใใใพใใ")
.setPositiveButton(
R.string.close,
(dialog, which) -> {
// ๅใซใใคใขใญใฐใๆถใใฆไฝใใใชใ
})
.show();
return;
}
if (globalMgr.mTempCard.getFrontText().isEmpty() || globalMgr.mTempCard.getBackText().isEmpty()) {
new AlertDialog.Builder(getContext())
.setIcon(IconManager.getResIdAtRandom(globalMgr.mCategory))
.setTitle(R.string.dlg_title_save_confirm)
.setMessage("[ใใใฆ]ใจ[ใใ]ใฎไธกๆนใๅ
ฅๅใใฆใใ ใใ")
.setPositiveButton(
R.string.close,
(dialog, which) -> {
// ๅใซใใคใขใญใฐใๆถใใฆไฝใใใชใ
})
.show();
return;
}
// ใฆใผใถใผใซใใ่จญๅฎๆ
ๅ ฑใฎๅคๆดใmCardLinkedListใซๅๆ ใใ
new AlertDialog.Builder(getContext())
.setIcon(IconManager.getResIdAtRandom(globalMgr.mCategory))
.setTitle(R.string.dlg_title_save_confirm)
.setMessage(R.string.dlg_msg_save)
.setPositiveButton(
R.string.save,
(dialog, which) -> {
LogUtility.d("[ไฟๅญ]ใ้ธๆใใใพใใ");
CardDao cardDao = new CardDao(getActivity().getApplicationContext());
if (mMode == Constants.CARD_SETTINGS_FOR_NEW) {
// ๅ
้ ญใซ่ฟฝๅ
mCardLinkedList.add(0, globalMgr.mTempCard);
cardDao.insert(globalMgr.mTempCard); // DBไธใฏ็นใซ้ ็ชใฏๆ่ญใใชใ
// ใซใผใๆฐๆดๆฐ
globalMgr.mFolderLinkedList.get(globalMgr.mCurrentFolderIndex).incrementNumOfAllCards();
FolderDao folderDao = new FolderDao(getActivity().getApplicationContext());
folderDao.update(globalMgr.mFolderLinkedList.get(globalMgr.mCurrentFolderIndex));
globalMgr.mCardStatsChanged = true; // Folderไธ่ฆง่กจ็คบๆใฎใชใใฌใใทใฅๅไฝใงๅ็
ง
} else {
// ไธๆธใ
mCardLinkedList.set(mPosition, globalMgr.mTempCard);
cardDao.update(globalMgr.mTempCard);
// TODO ใซใผใๆฐใ็ฟๅพๆธใฟๆฐใซๅคๆดใใใฃใๅ ดๅใซใFOLDER_TBLใธใฎๅๆ
// ใใใฎไฟๅญใๅผใฐใใใพใงใฏtempFolderใซๅๆ ใใฆใใใฆใๆๅพใซๆดๆฐใใๆนใใใใใปใปใป
// ใใฎใๆๅพใใจใใใฎใใฉใฎใฟใคใใณใฐใซใในใใใๆ็ขบใซใงใใชใใปใปใป
// ใจใใใใใใใใงๅๆ
globalMgr.mFolderLinkedList.get(globalMgr.mCurrentFolderIndex).incrementNumOfAllCards();
FolderDao folderDao = new FolderDao(getActivity().getApplicationContext());
folderDao.update(globalMgr.mFolderLinkedList.get(globalMgr.mCurrentFolderIndex));
}
mRecyclerViewAdapter.notifyDataSetChanged();
getDialog().dismiss(); // ่ฆชใๆถใ
})
.setNegativeButton(
R.string.cancel,
(dialog, which) -> {
LogUtility.d("[ใญใฃใณใปใซ]ใ้ธๆใใใพใใ");
// ใใฎAlertDialogใ ใใๆถใใ่ฆชใฎใใคใขใญใฐ่กจ็คบ็ถๆ
ใซๆปใ
})
.show();
});
// ใดใ็ฎฑ๏ผ็ ดๆฃ๏ผ
mView.findViewById(R.id.imageViewTrash).setOnClickListener(v -> {
if (mMode == Constants.CARD_SETTINGS_FOR_NEW) {
getDialog().dismiss(); // ไธ่ฆงใซๆปใ
return;
}
//Toast.makeText(getActivity().getApplicationContext(), "ใดใ็ฎฑ", Toast.LENGTH_LONG).show();
new AlertDialog.Builder(getContext())
.setIcon(IconManager.getResIdAtRandom(globalMgr.mCategory))
.setTitle(R.string.dlg_title_delete_confirm)
.setMessage(R.string.dlg_msg_delete_card)
.setPositiveButton(
R.string.delete,
(dialog, which) -> {
LogUtility.d("[ๅ้ค]ใ้ธๆใใใพใใ");
// LinkedListใใๅ้ค
mCardLinkedList.remove(mPosition);
// Folderใง็ฎก็ใใฆใใใซใผใๆฐใชใฉใๆดๆฐ
globalMgr.mFolderLinkedList.get(globalMgr.mCurrentFolderIndex).decrementNumOfAllCards();
if (globalMgr.mTempCard.isLearned())
globalMgr.mFolderLinkedList.get(globalMgr.mCurrentFolderIndex).decrementNumOfLearnedCards();
// DBใซๅๆ
FolderDao folderDao = new FolderDao(getActivity().getApplicationContext());
CardDao cardDao = new CardDao(getActivity().getApplicationContext());
folderDao.update(globalMgr.mFolderLinkedList.get(globalMgr.mCurrentFolderIndex));
cardDao.deleteByCardId(globalMgr.mTempCard.getId());
globalMgr.mCardStatsChanged = true; // Folderไธ่ฆง่กจ็คบๆใฎใชใใฌใใทใฅๅไฝใงๅ็
ง
mRecyclerViewAdapter.notifyItemRemoved(mPosition);
getDialog().dismiss();
})
.setNegativeButton(
R.string.no_delete,
(dialog, which) -> {
LogUtility.d("[ใญใฃใณใปใซ]ใ้ธๆใใใพใใ");
// ใใฎAlertDialogใ ใใๆถใใ่ฆชใฎใใคใขใญใฐ่กจ็คบ็ถๆ
ใซๆปใ
})
.show();
});
// ใใซใ
mView.findViewById(R.id.imageViewHelp).setOnClickListener(v -> {
if (globalMgr.isJapanese) {
CardSettingsHelpDialogFragment cardSettingsHelpDialogFragment = new CardSettingsHelpDialogFragment();
cardSettingsHelpDialogFragment.show(getChildFragmentManager(),
FolderSettingsDialogFragment.class.getSimpleName());
}
});
// Card FrontใฎEditTextใฎใคใใณใใชในใ
globalMgr.mCardSettings.editTextFront.addTextChangedListener(new TextWatcher() {
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
// TODO Auto-generated method stub
}
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
// TODO Auto-generated method stub
}
@Override
public void afterTextChanged(Editable s) {
// TODO Auto-generated method stub
if (mMode == Constants.CARD_SETTINGS_FOR_NEW) {
globalMgr.mTempCard.setFrontText(s.toString());
globalMgr.mChangedCardSettings = true;
} else {
if (!mCardModel.getFrontText().equals(s.toString())) {
globalMgr.mTempCard.setFrontText(s.toString());
globalMgr.mChangedCardSettings = true;
}
}
}
});
// Card BackใฎEditTextใฎใคใใณใใชในใ
globalMgr.mCardSettings.editTextBack.addTextChangedListener(new TextWatcher() {
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
// TODO Auto-generated method stub
}
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
// TODO Auto-generated method stub
}
@Override
public void afterTextChanged(Editable s) {
// TODO Auto-generated method stub
if (mMode == Constants.CARD_SETTINGS_FOR_NEW) {
globalMgr.mTempCard.setBackText(s.toString());
globalMgr.mChangedCardSettings = true;
} else {
if (!mCardModel.getBackText().equals(s.toString())) {
globalMgr.mTempCard.setBackText(s.toString());
globalMgr.mChangedCardSettings = true;
}
}
}
});
}
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
Dialog dialog = getDialog();
WindowManager.LayoutParams lp = dialog.getWindow().getAttributes();
DisplayMetrics metrics = getResources().getDisplayMetrics();
int dialogWidth = (int) (metrics.widthPixels * Constants.DIALOG_FRAGMENT_WIDTH_RATIO);
int dialogHeight = (int) (metrics.heightPixels * Constants.DIALOG_FRAGMENT_HEIGHT_RATIO);
lp.width = dialogWidth;
lp.height = dialogHeight;
dialog.getWindow().setAttributes(lp);
LogUtility.d("CardSettingsDialog: W" + dialogWidth + " x H" + dialogHeight);
}
/**
* BottomNavigationMenuใฎๆง็ฏใจใชในใใผ็ป้ฒ
*/
public void buildBottomNavigationMenu() {
// BottomNavigationใงๅใๆฟใใ๏ผใคใฎใขใคใณใณใซใใดใชใผใฎFragmentใไฝๆ
BottomNavigationView bottomNavigationView = (BottomNavigationView) mView.findViewById(R.id.icon_bottom_navigation);
Menu menu = bottomNavigationView.getMenu();
for (int category = Constants.CATEGORY_INDEX_FLOWER; category < Constants.NUM_OF_CATEGORY; category++) {
menu.getItem(category).setIcon(IconManager.getResIdAtRandom(category));
}
bottomNavigationView.setItemIconTintList(null);
bottomNavigationView.setBackgroundColor(globalMgr.skinHeaderColor);
bottomNavigationView.setOnNavigationItemSelectedListener(item -> {
switch (item.getItemId()) {
case R.id.navigation_flower:
globalMgr.currentCategoryPosition = Constants.CATEGORY_INDEX_FLOWER;
showFragment(mRegisteredFragments.get(Constants.CATEGORY_INDEX_FLOWER));
break;
case R.id.navigation_jewelry:
globalMgr.currentCategoryPosition = Constants.CATEGORY_INDEX_JEWELRY;
showFragment(mRegisteredFragments.get(Constants.CATEGORY_INDEX_JEWELRY));
break;
case R.id.navigation_fashion:
globalMgr.currentCategoryPosition = Constants.CATEGORY_INDEX_FASHION;
showFragment(mRegisteredFragments.get(Constants.CATEGORY_INDEX_FASHION));
break;
case R.id.navigation_food:
globalMgr.currentCategoryPosition = Constants.CATEGORY_INDEX_FOOD;
showFragment(mRegisteredFragments.get(Constants.CATEGORY_INDEX_FOOD));
break;
case R.id.navigation_others:
globalMgr.currentCategoryPosition = Constants.CATEGORY_INDEX_OTHERS;
showFragment(mRegisteredFragments.get(Constants.CATEGORY_INDEX_OTHERS));
break;
}
return true;
});
// ๅๆ่กจ็คบ
showFragment(mRegisteredFragments.get(globalMgr.currentCategoryPosition));
}
// ใฌใคใขใฆใใฎicon_container้จๅ(LinearLayout)ใๅผๆฐใฎfragmentใงๅ
ฅใๆฟใ่กจ็คบใใ
public void showFragment(Fragment fragment) {
// FragmentTransaction transaction = getActivity().getSupportFragmentManager().beginTransaction();
FragmentTransaction transaction = getChildFragmentManager().beginTransaction();
transaction.addToBackStack(null)
.replace(R.id.icon_container, fragment)
.commit();
}
}
|
package com.nรฃosei.entities;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.image.BufferedImage;
import com.nรฃosei.world.Camera;
public class Heart extends Entity{
public Heart(int x, int y, int width, int heigth, BufferedImage sprite) {
super(x, y, width, heigth, sprite);
setMask(0, 0, 16, 16);
}
/*public void render(Graphics g) {
g.setColor(Color.red);
g.fillRect(this.getX() + maskx - Camera.x, this.getY() + masky - Camera.y, mwidth, mheight);
}
*/
}
|
package com.brainmentors.testengine.models.user;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotEmpty;
public class Student {
@NotEmpty(message="Name is Required")
private String name;
@Min(value = 18,message = "Min is 18")
@Max(value = 26,message = "Max is 26")
private int age;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
@Override
public String toString() {
return "Student [name=" + name + ", age=" + age + "]";
}
}
|
package _00_Binary_Conversion;
import javax.swing.JOptionPane;
public class DecimalToBinary {
public static void main(String[] args) {
//Converting a decimal number to binary is a little trickier.
//EXAMPLE: Convert 43 to binary
/*
* Step 1: Start with one and add a digit the left that is double the value of the previous number.
* Stop when you've passed the target number
* eg. 43
* 64 32 16 8 4 2 1
*
* Step 2: Remove the left most value (the one that is higher than the target).
* eg. 43
* 32 16 8 4 2 1
*
* Step 3: Find the combination of values that add up to the target number.
* eg. 43
* 32 16 8 4 2 1
* 43 = 32 + 8 + 2 + 1
*
* Step 4: Every matching number in the list is a 1, and non-matching is a 0.
* eg. 43
* 32 16 8 4 2 1
* 43 = 32 + 8 + 2 + 1
*
* 1 0 1 0 1 1
* 32 16 8 4 2 1
*
* 43 in decimal is 101011 in binary!
*/
String input = "";
int decimal = 0;
while(true) {
input = JOptionPane.showInputDialog("Please enter a decimal number. Zero if you want to quit");
if(input.contentEquals("0")) {
System.exit(0);
}
decimal = Integer.parseInt(input);
String binaryNumber = "";
while(decimal>0) {
int remainder = decimal%2;
binaryNumber = String.valueOf(remainder) + binaryNumber;
decimal /=2;
}
JOptionPane.showMessageDialog(null, input + " in binary is " + binaryNumber);
}
}
}
|
import java.io.*;
class StringRead
{
public static void main(String args[]) throws IOException
{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
System.out.print("Enter Your Name: ");
String name=br.readLine();
System.out.println("Your name is: "+name);
}
}
|
package com.espendwise.manta.util.validation.rules;
import com.espendwise.manta.model.data.StoreMessageData;
import com.espendwise.manta.util.RefCodeNames;
import com.espendwise.manta.util.Utility;
import com.espendwise.manta.util.arguments.Args;
import com.espendwise.manta.util.trace.ExceptionReason;
import com.espendwise.manta.util.validation.ValidationRule;
import com.espendwise.manta.util.validation.ValidationRuleResult;
import java.util.Date;
public class StoreMessageDateRangeRule implements ValidationRule {
private StoreMessageData storeMessageData;
@Override
public ValidationRuleResult apply() {
StoreMessageData storeMessageData = getStoreMessageData();
ValidationRuleResult result = new ValidationRuleResult();
result.success();
if (getStoreMessageData() == null ) {
return null;
}
// if (getStoreMessageData() == null || !RefCodeNames.BUS_ENTITY_STATUS_CD.ACTIVE.equals(storeMessageData.getStoreMessageStatusCd())) {
// return null;
// }
// if (!RefCodeNames.BUS_ENTITY_STATUS_CD.ACTIVE.equals(storeMessageData.getStoreMessageStatusCd())) {
// return result;
// }
Date endDate = storeMessageData.getEndDate();
Date postedDate = storeMessageData.getPostedDate();
Date now = Utility.setToMidnight(new Date());
if (postedDate != null && endDate != null) {
if (endDate.compareTo(postedDate) < 0) {
result.failed(
ExceptionReason.StoreMessageUpdateReason.STORE_MESSAGE_END_DATE_BEFORE_POSTED_DATE,
Args.typed(endDate, postedDate)
);
}
}
if (postedDate != null) {
if (!Utility.isTrue(storeMessageData.getPublished()) && postedDate.compareTo(now) < 0) {
result.failed(
ExceptionReason.StoreMessageUpdateReason.STORE_MESSAGE_POSTED_DATE_BEFORE_CURRENT_DATE,
Args.typed(postedDate, now)
);
}
}
if (endDate != null) {
if (endDate.compareTo(now) < 0) {
result.failed(
ExceptionReason.StoreMessageUpdateReason.STORE_MESSAGE_END_DATE_BEFORE_CURRENT_DATE,
Args.typed(endDate, now)
);
}
}
return result;
}
public StoreMessageData getStoreMessageData() {
return storeMessageData;
}
public StoreMessageDateRangeRule(StoreMessageData storeMessageData) {
this.storeMessageData = storeMessageData;
}
}
|
import java.util.Random;
import java.util.Scanner;
/***********************************************
* Assignment:
* Program:
* Author:
* Description:
***********************************************/
public class Mission5 {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
Random rand = new Random();
System.out.println("Welcome to Rock, Paper, Scissors!");
System.out.print("Please enter the number of rounds you would like to play: ");
int numGames = input.nextInt();
input.nextLine();
while(numGames % 2 == 0){
System.out.print("Sorry, you need to enter an odd number. Please try again: ");
numGames = input.nextInt();
input.nextLine();
}
String userChoice, compChoice = "";
String[] options = {"Rock", "Paper", "Scissors"};
int userWins = 0, computerWins = 0;
for(int i = 0; i < numGames; i++){
System.out.print("Rock, Paper, or Scissors?: ");
userChoice = input.nextLine();
if(userChoice.equalsIgnoreCase("rock") || userChoice.equalsIgnoreCase("paper") ||
userChoice.equalsIgnoreCase("scissors")){
compChoice = options[rand.nextInt(3)];
if(compChoice.equalsIgnoreCase(userChoice)){
System.out.println("Computer chooses " + compChoice + ". It's a tie.");
i--;
}else if(compChoice.equalsIgnoreCase("Rock") &&
userChoice.equalsIgnoreCase("Paper")){
System.out.println("Computer chooses " + compChoice + ". You win!");
userWins++;
}else if(compChoice.equalsIgnoreCase("Paper") &&
userChoice.equalsIgnoreCase("Scissors")){
System.out.println("Computer chooses " + compChoice + ". You win!");
userWins++;
}else if(compChoice.equalsIgnoreCase("Scissors") &&
userChoice.equalsIgnoreCase("Rock")){
System.out.println("Computer chooses " + compChoice + ". You win!");
userWins++;
}else{
System.out.println("Computer chooses " + compChoice + ". You lose.");
computerWins++;
}
}else{
System.out.println("Sorry, \""+ userChoice + "\" is not a valid entry.");
i--;
}
}
System.out.println("\nUser wins: " + userWins);
System.out.println("Computer wins: " + computerWins + "\n");
if(userWins > computerWins){
System.out.println("User wins the game!");
}else{
System.out.println("Computer wins the game!");
}
}
}
|
package com.myblog.version3.service.impl;
import com.myblog.version3.entity.Article;
import com.myblog.version3.mapper.articleMapper;
import com.myblog.version3.service.articleService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class ArticleServiceImpl implements articleService {
private Logger logger = LoggerFactory.getLogger(ArticleServiceImpl.class);
@Autowired
articleMapper mapper;
@Override
public Article getByID(String ID) {
return mapper.getByID(ID);
}
@Override
public List<Article> getByUid(String Uid) {
return mapper.getByUid(Uid);
}
@Override
public List<Article> getAll(int pageNum , int pageSize) {
return mapper.getAll();
}
@Override
public Boolean Insert(Article article) {
return mapper.insert(article);
}
@Override
public Boolean update(Article article) {
return mapper.update(article);
}
@Override
public Boolean status(Integer status, String ID) {
return mapper.status(status,ID);
}
@Override
public Boolean serPrivate(Boolean isPrivate, String ID) {
return mapper.setPrivate(isPrivate,ID);
}
@Override
public Boolean commentStatus(Boolean comment, String ID) {
return mapper.commentStatus(comment ,ID);
}
@Override
public Boolean hit(String ID) {
return mapper.updateHit(ID);
}
}
|
package myproject.game.mappers;
import myproject.game.models.dto.SessionDto;
import myproject.game.models.entities.Session;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
import java.util.List;
@Mapper
public interface SessionMapper {
SessionMapper INSTANCE = Mappers.getMapper(SessionMapper.class);
Session sessionDtoToSession(SessionDto sessionDto);
SessionDto sessionToSessionDto(Session session);
List<Session> sessionDtosToSessions(List<SessionDto> sessionDtos);
List<SessionDto> sessionsToSessionDtos(List<Session> sessions);
}
|
package com.tencent.mm.plugin.product.ui;
import android.content.Intent;
import android.view.View;
import android.view.View.OnClickListener;
import com.tencent.mm.plugin.report.service.h;
import com.tencent.mm.plugin.wxpay.a.i;
import com.tencent.mm.ui.base.s;
class MallProductUI$6 implements OnClickListener {
final /* synthetic */ MallProductUI lUa;
MallProductUI$6(MallProductUI mallProductUI) {
this.lUa = mallProductUI;
}
public final void onClick(View view) {
f e = MallProductUI.e(this.lUa);
if (e.lSG.bmS()) {
e.ftd.startActivity(new Intent(e.ftd, MallProductSelectSkuUI.class));
h.mEJ.h(11008, new Object[]{e.lSG.bmO(), e.lSG.lQL.lRl, Integer.valueOf(f.fdx), Integer.valueOf(1)});
return;
}
s.makeText(e.ftd, i.mall_product_data_loading, 1).show();
}
}
|
package lab_3.pkg2;
/**
*
* @author sameeh boshra
*/
public interface animal {
public void animal_eat(String eat);
public void animal_travel(boolean b );
}
|
import java.util.ArrayList;
import java.util.Scanner;
public class Exam {
public static void main(String[] args) {
Scanner nya = new Scanner(System.in);
ArrayList<Integer> stuff = new ArrayList<>(nya.nextInt());
for(int x: stuff)
stuff.add(nya.nextInt());
ArrayList<ArrayList<Integer>> ms = new ArrayList<>();
}
public static boolean recur(ArrayList<Integer> x, int y, int z){
if(y < x.get(z))
return false;
return true;
}
}
|
package ar.edu.utn.frlp.app.domain;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import javax.persistence.*;
import java.util.List;
@Entity
@Table(name = "User")
public class User {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(name = "username")
private String username;
@Column(name = "firstname")
private String firstname;
@Column(name = "lastname")
private String lastname;
@OneToMany(mappedBy = "user")
@JsonIgnoreProperties(value = {"user", "columnBoard"}, allowSetters = true)
private List<Board> boards;
public User() {
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getFirstname() {
return firstname;
}
public void setFirstname(String firstname) {
this.firstname = firstname;
}
public String getLastname() {
return lastname;
}
public void setLastname(String lastname) {
this.lastname = lastname;
}
public List<Board> getBoards() {
return boards;
}
public void setBoards(List<Board> boards) {
this.boards = boards;
}
}
|
package com.tencent.mm.plugin.appbrand.canvas.widget;
import android.view.View;
import android.view.ViewParent;
class MCanvasView$1 implements Runnable {
final /* synthetic */ MCanvasView fnF;
MCanvasView$1(MCanvasView mCanvasView) {
this.fnF = mCanvasView;
}
public final void run() {
ViewParent parent = this.fnF.getParent();
do {
((View) parent).forceLayout();
parent = parent.getParent();
} while (parent instanceof View);
if (parent != null) {
parent.requestLayout();
this.fnF.invalidate();
}
}
}
|
package com.example.server.utils;
public interface AppConstants {
String DEFAULT_PAGE_NUMBER="0";
String DEFAULT_PAGE_SIZE="10";
String START_DATE="1970-01-01";
String END_DATE="2100-01-01";
int MAX_PAGE_SIZE = 20;
}
|
package com.tencent.tencentmap.mapsdk.a;
public final class li extends mf implements Cloneable {
static final /* synthetic */ boolean j = (!li.class.desiredAssertionStatus());
public String a = "";
public String b = "";
public String c = "";
public String d = "";
public String e = "";
public String f = "";
public int g = 0;
public int h = 0;
public int i = 0;
public final boolean equals(Object obj) {
if (obj == null) {
return false;
}
li liVar = (li) obj;
if (mg.a(this.a, liVar.a) && mg.a(this.b, liVar.b) && mg.a(this.c, liVar.c) && mg.a(this.d, liVar.d) && mg.a(this.e, liVar.e) && mg.a(this.f, liVar.f) && mg.a(this.g, liVar.g) && mg.a(this.h, liVar.h) && mg.a(this.i, liVar.i)) {
return true;
}
return false;
}
public final int hashCode() {
try {
throw new Exception("Need define key first!");
} catch (Exception e) {
return 0;
}
}
public final Object clone() {
Object obj = null;
try {
return super.clone();
} catch (CloneNotSupportedException e) {
if (j) {
return obj;
}
throw new AssertionError();
}
}
public final void writeTo(me meVar) {
meVar.a(this.a, 0);
meVar.a(this.b, 1);
meVar.a(this.c, 2);
meVar.a(this.d, 3);
meVar.a(this.e, 4);
meVar.a(this.f, 5);
meVar.a(this.g, 6);
meVar.a(this.h, 7);
meVar.a(this.i, 8);
}
public final void readFrom(md mdVar) {
this.a = mdVar.a(0, true);
this.b = mdVar.a(1, true);
this.c = mdVar.a(2, true);
this.d = mdVar.a(3, true);
this.e = mdVar.a(4, true);
this.f = mdVar.a(5, true);
this.g = mdVar.a(this.g, 6, true);
this.h = mdVar.a(this.h, 7, true);
this.i = mdVar.a(this.i, 8, true);
}
public final void display(StringBuilder stringBuilder, int i) {
mb mbVar = new mb(stringBuilder, i);
mbVar.a(this.a, "unid");
mbVar.a(this.b, "masterName");
mbVar.a(this.c, "slaveName");
mbVar.a(this.d, "interfaceName");
mbVar.a(this.e, "masterIp");
mbVar.a(this.f, "slaveIp");
mbVar.a(this.g, "depth");
mbVar.a(this.h, "width");
mbVar.a(this.i, "parentWidth");
}
public final void displaySimple(StringBuilder stringBuilder, int i) {
mb mbVar = new mb(stringBuilder, i);
mbVar.a(this.a, true);
mbVar.a(this.b, true);
mbVar.a(this.c, true);
mbVar.a(this.d, true);
mbVar.a(this.e, true);
mbVar.a(this.f, true);
mbVar.a(this.g, true);
mbVar.a(this.h, true);
mbVar.a(this.i, false);
}
}
|
package com.ebupt.portal.User.service;
import com.ebupt.portal.User.entity.User;
import com.ebupt.portal.common.Results.JSONResult;
public interface UserService {
JSONResult findAll();
JSONResult findByName(String name);
JSONResult update(User user);
JSONResult deleteById(int id);
}
|
package fooBarQix;
public class FooBarQix {
public static String process(int number) {
if(number % 3 == 0)
return "FOO";
if(number % 5 == 0)
return "BAR";
if(number % 7 == 0)
return "QIX";
if(number % 2 == 0)
return "FOOBARQIX";
if(number % 2 == 0 && number % 3 == 0 && number % 5 == 0 && number % 7 == 0)
return "FOOBARQIX";
return number+"";
}
}
|
package com.webcloud.webservice;
/**
* @class:LoginService.java
* @author๏ผWangwei
* @date๏ผ2013-12-20
* @comment๏ผ
*/
import com.webcloud.model.UserAuth;
public interface LoginService {
/**
* ่ทๅ็ญไฟก้ช่ฏ็
* @param phoneNum ๆๆบๅท
* @param productKey ไบงๅ็ผๅท
* @return 0๏ผ ๆๅ
*/
public String getMsgCheckCode(String mobile,String productKey);
/**
* ็จๆทๆณจๅ
* @param mobile ๆๆบๅท
* @param productKey ไบงๅ็ผๅท
* @param checkCode ็ญไฟก้ช่ฏ็
* @param imsi imsiๅท,็งปๅจ็จๆทๆ ่ฏ
* @param imei ๆๆบimeiไธฒๅท
* @param mac ๆๆบmacๅฐๅ
*/
public String registration(String mobile,String productKey,String checkCode,String imsi,String imei,String mac);
/**
* ็จๆทๆณจๅ
* @param mobile ๆๆบๅท
* @param productKey ไบงๅ็ผๅท
* @param checkCode ็ญไฟก้ช่ฏ็
*/
public String registration(String mobile,String productKey,String checkCode);
/**
* ็จๆท้ดๆ
* @param mobile ๆๆบๅท
* @param productKey ไบงๅ็ผๅท
* @param ecCode ไผไธ็ผ็
* @param imsi imsiๅท,็งปๅจ็จๆทๆ ่ฏ
* @param version ๅฝๅๅฎขๆท็ซฏ็็ๆฌ
* @return
*/
public UserAuth getUserAuth(String mobile,String productKey,String ecCode,String imsi,String version);
/**
* ็จๆท้ดๆ
* @param mobile ๆๆบๅท
* @param productKey ไบงๅ็ผๅท
* @param ecCode ไผไธ็ผ็
* @return
*/
public UserAuth getUserAuth(String mobile,String productKey,String ecCode);
/**
* ๆต้ๆฅๅฟ๏ผไธไผ ๆต้ไฝฟ็จๆ
ๅต
* @param productKey ไบงๅ็ผๅท
* @param ecCode ไผไธ็ผ็
* @param startTime ๅผๅงๆถ้ด 2013-09-10 18:21:59
* @param endTime ็ปๆๆถ้ด 2013-09-10 18:21:59
* @param flowNum_3g 3Gๆต้
* @param flowNum_wifi wifiๆต้
* @param imsi imsiๅท,็งปๅจ็จๆทๆ ่ฏ
* @param mobile ๆๆบๅท
* @return
*/
public String uploadFlow(String productKey,String ecCode,String startTime,String endTime,String flowNum_3g,
String flowNum_wifi,String imsi,String mobile);
}
|
package com.hakim.registration.controllers;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import com.hakim.registration.forms.FORM_REGI_01_00;
import com.hakim.registration.logic.LOGIC_REGI_01_00;
@Controller
public class CTRL_REGI_01_00{
@Autowired
private LOGIC_REGI_01_00 logic_regi_01_00;
/**
*
**/
@GetMapping(value = "/regi_01_00")
public String showView(@ModelAttribute("form_regi_01_00") FORM_REGI_01_00 form_regi_01_00,Model model) {
return logic_regi_01_00.showView(form_regi_01_00,model);
}
/**
*
*
* */
@PostMapping(value = "/regi_01_00/nextPage")
public String nextPage(@ModelAttribute("form_regi_01_00")FORM_REGI_01_00 form_regi_01_00,BindingResult result,RedirectAttributes redirDirAtt) throws Exception{
return logic_regi_01_00.nextPage(form_regi_01_00,result,redirDirAtt);
}
}
|
package com.spring.demo.configuration;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.Environment;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
// NOTE: Access Swagger docs at /swagger-ui.html
@Configuration
@EnableSwagger2
public class SwaggerConfiguration {
@Autowired private Environment env;
@Bean public Docket api() {
return new Docket(DocumentationType.SWAGGER_2)
.select()
.apis(RequestHandlerSelectors.any())
.paths(PathSelectors.any())
.build()
.apiInfo(apiInfo());
}
private ApiInfo apiInfo(){
return new ApiInfo(
"DEMO PI",
"DEMO TO LEARN SPRING",
env.getProperty("application.version", "undefined"),
"",
"",
"License of API",
""
);
}
}
|
package com.github.netudima.jmeter.junit.report;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
import java.io.File;
import static org.assertj.core.api.Assertions.assertThat;
public class JtlToJUnitReportTransformerTest {
@Rule
public TemporaryFolder tmpFolder = new TemporaryFolder();
@Test
public void testTransform() throws Exception {
JtlToJUnitReportTransformer transformer = new JtlToJUnitReportTransformer();
File output = tmpFolder.newFile("test.xml");
transformer.transform(TestUtils.getTestFilePath("/csv_with_failures.jtl"),
output.getAbsolutePath(), "testSuiteName");
assertThat(output).hasSameContentAs(TestUtils.getTestFile("/csv_with_failures_converted.xml"));
}
}
|
package com.tencent.mm.g.a;
public final class ru$b {
public boolean ccK;
}
|
package service;
import org.junit.Before;
import org.junit.Test;
import uk.gov.dwp.maze.model.Grid;
import uk.gov.dwp.maze.model.Maze;
import uk.gov.dwp.maze.service.MazeService;
import uk.gov.dwp.maze.service.PrintMaze;
import static org.junit.Assert.assertEquals;
public class PrintMazeTest {
PrintMaze printMaze;
private static String EXPECTED_OUTPUT = "XXXXXXXXXXXXXXXXXXXXXXXXXX\n" +
"X S X X X X X\n" +
"XXXXXXXXXXXXXXXXXXXXXXXXXX\n" +
"X * X X X X X\n" +
"XXXXXXXXXXXXXXXXXXXXXXXXXX\n" +
"X X X X X X\n" +
"XXXXXXXXXXXXXXXXXXXXXXXXXX\n" +
"X X X X X X\n" +
"XXXXXXXXXXXXXXXXXXXXXXXXXX\n" +
"X X X X X F X\n" +
"XXXXXXXXXXXXXXXXXXXXXXXXXX\n";
@Before
public void setUp(){
printMaze = new PrintMaze();
}
@Test
public void print() {
MazeService mazeService = new MazeService();
Maze maze = mazeService.initMaze(5, 5);
mazeService.markStart(new Grid(0, 0));
mazeService.markEnd(new Grid(4, 4));
mazeService.visit(new Grid(1, 0));
mazeService.path(new Grid(1, 0));
String print = printMaze.print(5, 5, maze);
assertEquals(EXPECTED_OUTPUT, print);
}
}
|
import static org.junit.jupiter.api.Assertions.*;
import org.junit.jupiter.api.Test;
class Floydtest {
@Test
void test() {
Floyd gg= new Floyd();
gg.add("City1","City2","1");
gg.add("City2","City4","2");
gg.add("City4","City6","3");
gg.add("City3","City8","4");
gg.add("City5","City10","5");
}
void agregartest() {
gg.agregar("City1","City2");
assertEquals(0,gg.recorrido("City1","City2"));
}
void existetest() {
gg.existe("City1","City3");
return true
}
void shorter_rutetest() {
gg.shorter_rute();
assertEquals(3,gg.recorrido("City2","City4"));
}
void centertest() {
gg.center();
assertEquals("city4");
}
void cercatest() {
gg.cerca("City1","City2");
assertEquals("City4");
}
void recorridotest() {
gg.cerca("City1","City2");
assertEquals(1);
}
}
|
package com.tencent.mm.kernel.a.b;
public final class h {
public Class dsO;
public Class dsP;
public Class dsf;
}
|
package jc.sugar.JiaHui.jmeter.assertion;
import jc.sugar.JiaHui.jmeter.*;
import org.apache.jmeter.assertions.DurationAssertion;
import java.util.HashMap;
import java.util.Map;
import static org.apache.jorphan.util.Converter.getLong;
@JMeterElementMapperFor(value = JMeterElementType.DurationAssertion, testGuiClass = JMeterElement.DurationAssertion)
public class DurationAssertionMapper extends AbstractJMeterElementMapper<DurationAssertion> {
public static final String WEB_DURATION = "duration";
private DurationAssertionMapper(DurationAssertion element, Map<String, Object> attributes) {
super(element, attributes);
}
public DurationAssertionMapper(Map<String, Object> attributes){
this(new DurationAssertion(), attributes);
}
public DurationAssertionMapper(DurationAssertion element){
this(element, new HashMap<>());
}
@Override
public DurationAssertion fromAttributes() {
element.setAllowedDuration(getLong(attributes.get(WEB_DURATION)));
return element;
}
@Override
public Map<String, Object> toAttributes() {
attributes.put(WEB_CATEGORY, JMeterElementCategory.Assertion);
attributes.put(WEB_TYPE, JMeterElementType.DurationAssertion);
attributes.put(WEB_DURATION, element.getPropertyAsString(DurationAssertion.DURATION_KEY));
return attributes;
}
}
|
package com.polsl.edziennik.desktopclient.view.common.panels.button;
public class ExamTaskTypeButtonPanel extends AddRemoveButtonPanel {
@Override
public void create() {
add = Button.getButton("addIcon", "addExamTaskTypesHint");
remove = Button.getButton("removeIcon", "removeExamTaskTypesHint");
}
}
|
/**
* Contains Rocket.Chat REST API Client.
*
* @since 0.0.1
* @version 0.1.0
*/
package com.github.baloise.rocketchatrestclient;
|
package be.klak.whatsthat.api;
import static be.klak.whatsthat.OfyService.ofy;
import be.klak.whatsthat.domain.Rebus;
import com.google.api.server.spi.config.Api;
import com.google.api.server.spi.config.ApiMethod;
@Api(name = "whatsthat")
public class WhatsThatApi {
@ApiMethod(name = "rebus.random")
public Rebus getRandomRebus() {
return ofy().load().type(Rebus.class).offset(getRandomRebusIndex()).first().safeGet();
}
private int getRandomRebusIndex() {
return rand(0, ofy().load().type(Rebus.class).count());
}
private int rand(int Min, int Max) {
return Min + (int) (Math.random() * ((Max - Min)));
}
@ApiMethod(name = "rebus.set", httpMethod = "POST")
public Rebus uploadRebus(Rebus rebus) {
ofy().save().entities(rebus).now();
return rebus;
}
}
|
package com.rc.panels;
import com.rc.app.Launcher;
import com.rc.components.*;
import com.rc.components.message.ChatEditorPopupMenu;
import com.rc.frames.ScreenShotFrame;
import com.rc.helper.HotKeyHelper;
import com.rc.listener.ExpressionListener;
import com.rc.res.Colors;
import com.rc.res.Cursors;
import com.rc.utils.FontUtil;
import com.rc.utils.IconUtil;
import com.tulskiy.keymaster.common.HotKey;
import com.tulskiy.keymaster.common.HotKeyListener;
import javax.swing.*;
import java.awt.*;
import java.awt.event.FocusAdapter;
import java.awt.event.FocusEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
/**
* Created by song on 17-5-30.
*
* <P>ไธๅพ #MessageEditorPanel# ๅฏนๅบ็ไฝ็ฝฎ</P>
* <p>
* ๆถๆฏ็ผ่พๅบๅ
*
* <P>ๆจ่ไฝฟ็จMenloๆConsolasๅญไฝ</P>
* โโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
* โ โโโโโโโ โ Room Title โก โ
* โ โ โ name โก โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
* โ โโโโโโโ โ โ
* โโโโโโโโโโโโโโโโโโโโโโโโโโค message time โ
* โ search โ โโโโ โโโโโโโโโโโโโโ โ
* โโโโโโโโโโโโโโโโโโโโโโโโโโค โโโโ โ message โ โ
* โ โ โ โ โ โ โ โโโโโโโโโโโโโโ โ
* โโโโโโโโโโโโโโโโโโโโโโโโโโค โ
* โ โโโโ name 14:01โ โ
* โ โโโโ message 99+โ message time โ
* โโโโโโโโโโโโโโโโโโโโโโโโโโค โโโโโโโโโโโโโโ โโโโ โ
* โ โ โ message โ โโโโ โ
* โ โ โโโโโโโโโโโโโโ โ
* โ โ โ
* โ Room โ โ
* โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
* โ โ โ
* โ List โ โ
* โ โ #MessageEditorPanel# โ
* โ โ โ
* โ โ โ
* โโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
*/
public class MessageEditorPanel extends ParentAvailablePanel
{
private JPanel controlPanel;
private JLabel fileLabel;
private JLabel expressionLabel;
private JLabel cutLabel;
private JScrollPane textScrollPane;
private RCTextEditor textEditor;
private JPanel sendPanel;
private RCButton sendButton;
private ChatEditorPopupMenu chatEditorPopupMenu;
private ImageIcon fileNormalIcon;
private ImageIcon fileActiveIcon;
private ImageIcon emotionNormalIcon;
private ImageIcon emotionActiveIcon;
private ImageIcon cutNormalIcon;
private ImageIcon cutActiveIcon;
private ExpressionPopup expressionPopup;
private ScreenShotFrame screenShotFrame;
public MessageEditorPanel(JPanel parent)
{
super(parent);
initComponents();
initView();
setListeners();
registerHotKey();
}
private void registerHotKey()
{
HotKeyHelper.getInstance().register(Launcher.hotKeyMap.get(Launcher.HOT_KEY_SCREEN_SHOT), new HotKeyListener()
{
@Override
public void onHotKey(HotKey hotKey)
{
screenShot();
}
}, "ๅฑๅนๆชๅพ");
}
private void initComponents()
{
controlPanel = new JPanel();
controlPanel.setLayout(new FlowLayout(FlowLayout.LEFT, 20, 7));
fileLabel = new JLabel();
fileNormalIcon = IconUtil.getIcon(this, "/image/file.png", false);
fileActiveIcon = IconUtil.getIcon(this, "/image/file_active.png", false);
fileLabel.setIcon(fileNormalIcon);
fileLabel.setCursor(Cursors.HAND_CURSOR);
fileLabel.setToolTipText("ๅ้ๆไปถ/ๅพ็");
expressionLabel = new JLabel();
emotionNormalIcon = IconUtil.getIcon(this, "/image/emotion.png", false);
emotionActiveIcon = IconUtil.getIcon(this, "/image/emotion_active.png", false);
expressionLabel.setIcon(emotionNormalIcon);
expressionLabel.setCursor(Cursors.HAND_CURSOR);
expressionLabel.setToolTipText("่กจๆ
");
cutLabel = new JLabel();
cutNormalIcon = IconUtil.getIcon(this, "/image/cut.png", false);
cutActiveIcon = IconUtil.getIcon(this, "/image/cut_active.png", false);
cutLabel.setIcon(cutNormalIcon);
cutLabel.setCursor(Cursors.HAND_CURSOR);
cutLabel.setToolTipText("ๆชๅพ(Ctrl + Alt + A)");
textEditor = new RCTextEditor();
textEditor.setBackground(Colors.WINDOW_BACKGROUND);
textEditor.setFont(FontUtil.getDefaultFont(14));
textEditor.setMargin(new Insets(0, 15, 0, 0));
textScrollPane = new JScrollPane(textEditor);
textScrollPane.getVerticalScrollBar().setUI(new ScrollUI(Colors.SCROLL_BAR_THUMB, Colors.WINDOW_BACKGROUND));
textScrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
textScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
textScrollPane.setBorder(null);
sendPanel = new JPanel();
sendPanel.setLayout(new BorderLayout());
sendButton = new RCButton("ๅ ้");
sendPanel.add(sendButton, BorderLayout.EAST);
sendButton.setForeground(Colors.DARKER);
sendButton.setFont(FontUtil.getDefaultFont(13));
sendButton.setPreferredSize(new Dimension(75, 29));
sendButton.setToolTipText("Enterๅ้ๆถๆฏ๏ผCtrl+Enterๆข่ก");
chatEditorPopupMenu = new ChatEditorPopupMenu();
expressionPopup = new ExpressionPopup();
screenShotFrame = new ScreenShotFrame();
}
private void initView()
{
this.setLayout(new GridBagLayout());
controlPanel.add(expressionLabel);
controlPanel.add(fileLabel);
controlPanel.add(cutLabel);
add(controlPanel, new GBC(0, 0).setFill(GBC.HORIZONTAL).setWeight(1, 50));
add(textScrollPane, new GBC(0, 1).setFill(GBC.BOTH).setWeight(1, 750));
add(sendPanel, new GBC(0, 2).setFill(GBC.BOTH).setWeight(1, 1).setInsets(0, 0, 10, 10));
}
private void setListeners()
{
fileLabel.addMouseListener(new MouseAdapter()
{
@Override
public void mouseEntered(MouseEvent e)
{
fileLabel.setIcon(fileActiveIcon);
super.mouseEntered(e);
}
@Override
public void mouseExited(MouseEvent e)
{
fileLabel.setIcon(fileNormalIcon);
super.mouseExited(e);
}
});
expressionLabel.addMouseListener(new MouseAdapter()
{
@Override
public void mouseEntered(MouseEvent e)
{
expressionLabel.setIcon(emotionActiveIcon);
super.mouseEntered(e);
}
@Override
public void mouseExited(MouseEvent e)
{
expressionLabel.setIcon(emotionNormalIcon);
super.mouseExited(e);
}
@Override
public void mouseClicked(MouseEvent e)
{
//expressionPopup.show((Component) e.getSource(), e.getX() - 200, e.getY() - 320);
Point location = e.getLocationOnScreen();
int x = location.x + e.getX() - 200;
int y = location.y + e.getY() - 330;
expressionPopup.setLocation(x, y);
expressionPopup.setVisible(true);
super.mouseClicked(e);
}
});
cutLabel.addMouseListener(new MouseAdapter()
{
@Override
public void mouseEntered(MouseEvent e)
{
cutLabel.setIcon(cutActiveIcon);
super.mouseEntered(e);
}
@Override
public void mouseExited(MouseEvent e)
{
cutLabel.setIcon(cutNormalIcon);
super.mouseExited(e);
}
@Override
public void mouseClicked(MouseEvent e)
{
screenShot();
super.mouseClicked(e);
}
});
textEditor.addMouseListener(new MouseAdapter()
{
@Override
public void mouseReleased(MouseEvent e)
{
if (e.getButton() == MouseEvent.BUTTON3)
{
chatEditorPopupMenu.show((Component) e.getSource(), e.getX(), e.getY());
}
super.mouseClicked(e);
}
});
textEditor.addFocusListener(new FocusAdapter()
{
@Override
public void focusGained(FocusEvent e)
{
textEditor.setBackground(Colors.WINDOW_BACKGROUND_LIGHT);
controlPanel.setBackground(Colors.WINDOW_BACKGROUND_LIGHT);
sendPanel.setBackground(Colors.WINDOW_BACKGROUND_LIGHT);
MessageEditorPanel.this.setBackground(Colors.WINDOW_BACKGROUND_LIGHT);
super.focusGained(e);
}
@Override
public void focusLost(FocusEvent e)
{
textEditor.setBackground(Colors.WINDOW_BACKGROUND);
controlPanel.setBackground(Colors.WINDOW_BACKGROUND);
sendPanel.setBackground(Colors.WINDOW_BACKGROUND);
MessageEditorPanel.this.setBackground(Colors.WINDOW_BACKGROUND);
super.focusLost(e);
}
@Override
public int hashCode()
{
return super.hashCode();
}
@Override
public boolean equals(Object obj)
{
return super.equals(obj);
}
@Override
protected Object clone() throws CloneNotSupportedException
{
return super.clone();
}
@Override
public String toString()
{
return super.toString();
}
@Override
protected void finalize() throws Throwable
{
super.finalize();
}
});
}
private void screenShot()
{
if (!ScreenShotFrame.visible)
{
screenShotFrame = new ScreenShotFrame();
screenShotFrame.setVisible(true);
}
}
public void setExpressionListener(ExpressionListener listener)
{
expressionPopup.setExpressionListener(listener);
}
public RCTextEditor getEditor()
{
return textEditor;
}
public JButton getSendButton()
{
return sendButton;
}
public JLabel getUploadFileLabel()
{
return fileLabel;
}
}
|
package api.longpoll.bots.model.events.video;
import api.longpoll.bots.model.events.EventObject;
import com.google.gson.annotations.SerializedName;
/**
* Describes <b>video_comment_delete</b> event objects.
*/
public class VideoCommentDeleteEvent implements EventObject {
/**
* Comment ID.
*/
@SerializedName("id")
private Integer id;
/**
* Video owner ID.
*/
@SerializedName("owner_id")
private Integer ownerId;
/**
* User ID who deleted the comment.
*/
@SerializedName("deleter_id")
private Integer deleterId;
/**
* Video ID.
*/
@SerializedName("video_id")
private Integer videoId;
/**
* ID of the user who deleted a comment.
*/
@SerializedName("user_id")
private Integer userId;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getOwnerId() {
return ownerId;
}
public void setOwnerId(Integer ownerId) {
this.ownerId = ownerId;
}
public Integer getDeleterId() {
return deleterId;
}
public void setDeleterId(Integer deleterId) {
this.deleterId = deleterId;
}
public Integer getVideoId() {
return videoId;
}
public void setVideoId(Integer videoId) {
this.videoId = videoId;
}
public Integer getUserId() {
return userId;
}
public void setUserId(Integer userId) {
this.userId = userId;
}
@Override
public String toString() {
return "VideoCommentDeleteEvent{" +
"id=" + id +
", ownerId=" + ownerId +
", deleterId=" + deleterId +
", videoId=" + videoId +
", userId=" + userId +
'}';
}
}
|
package ars.ramsey.interviewhelper.widget.FloatingMenu;
import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import android.util.Log;
import android.util.TypedValue;
import android.view.View;
import android.view.ViewGroup;
import ars.ramsey.interviewhelper.R;
/**
* Created by Ramsey on 2017/5/20.
*/
public class MenuItem extends ViewGroup {
public String mTagText;
private MenuTag mMenuTag;
private onMenuClickListener mListener;
public interface onMenuClickListener{
void onMenuClick();
}
public MenuItem(Context context, AttributeSet attrs) {
super(context, attrs);
TypedArray typedArray = context.obtainStyledAttributes(attrs
, R.styleable.MenuItem);
mTagText = typedArray.getString(R.styleable.MenuItem_tagText);
typedArray.recycle();
mMenuTag = new MenuTag(context);
mMenuTag.setText(mTagText);
addView(mMenuTag);
}
@Override
protected void onLayout(boolean changed, int l, int t, int r, int b) {
View tagView = getChildAt(0);
View iconView = getChildAt(1);
int tl = dp2px(8);
int tt = (getMeasuredHeight() - tagView.getMeasuredHeight()) / 2;
int tr = tl + tagView.getMeasuredWidth();
int tb = tt + tagView.getMeasuredHeight();
int il = tr + dp2px(8);
int it = (getMeasuredHeight() - iconView.getMeasuredHeight()) / 2;
int ir = il + iconView.getMeasuredWidth();
int ib = it + iconView.getMeasuredHeight();
tagView.layout(tl,tt,tr,tb);
iconView.layout(il,it,ir,ib);
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
int width = 0;
int height = 0;
int childCount = getChildCount();
for(int i=0;i<childCount;i++)
{
View view = getChildAt(i);
measureChild(view,widthMeasureSpec,heightMeasureSpec);
width += view.getMeasuredWidth();
height = Math.max(height,view.getMeasuredHeight());
}
width += dp2px(8 + 8 + 8);
height += dp2px(8 + 8);
setMeasuredDimension(width,height);
}
private int dp2px(int value){
return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP
, value, getResources().getDisplayMetrics());
}
public void setOnMenuClickListener(onMenuClickListener listener)
{
this.mListener = listener;
this.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
mListener.onMenuClick();
}
});
}
public void setBackgroundColor(int color){
mMenuTag.setBackgroundColor(color);
}
public void setTextColor(int color){
mMenuTag.setTextColor(color);
}
public void setTextSize(float size){
mMenuTag.setTextSize(size);
}
}
|
package com.lubarov.daniel.nagger.messages.c2s;
public class C2sCreateRecipientMessage {
public String name;
public String command;
}
|
package net.suntrans.suntranscomponents.utils;
import android.os.Handler;
import android.os.Looper;
import android.text.TextUtils;
import android.widget.Toast;
import android.content.Context;
/**
* Created by Looney on 2018/9/18.
* Des:
*/
public class ToastUtils {
private static Handler handler = new Handler(Looper.getMainLooper());
private static Toast mToast;
public static void showToast(final String str,final Context context) {
if (Thread.currentThread()!= Looper.getMainLooper().getThread()){
handler.post(new Runnable() {
@Override
public void run() {
String str1 =str;
if (TextUtils.isEmpty(str1)) {
str1 = "";
}
if (mToast == null) {
mToast = Toast.makeText(context, str1, Toast.LENGTH_SHORT);
}
mToast.setText(str1);
mToast.show();
}
});
}else {
String str1 =str;
if (TextUtils.isEmpty(str1)) {
str1 = "";
}
if (mToast == null) {
mToast = Toast.makeText(context, str1, Toast.LENGTH_SHORT);
}
mToast.setText(str1);
mToast.show();
}
}
}
|
package com.bytedance.sandboxapp.b.a.b;
import android.util.Log;
import d.f.b.l;
public final class b implements a {
public static a a;
public static final b b = new b();
public static String a(Object[] paramArrayOfObject) {
l.b(paramArrayOfObject, "messages");
StringBuilder stringBuilder = new StringBuilder();
if (com.bytedance.sandboxapp.b.a.a.b.b.isDebugMode()) {
byte b1;
String str1;
String str2;
StackTraceElement[] arrayOfStackTraceElement = (new Throwable()).getStackTrace();
if (arrayOfStackTraceElement.length > 2) {
StackTraceElement stackTraceElement1 = arrayOfStackTraceElement[2];
l.a(stackTraceElement1, "sElements[2]");
str1 = stackTraceElement1.getFileName();
l.a(str1, "sElements[2].fileName");
StackTraceElement stackTraceElement2 = arrayOfStackTraceElement[2];
l.a(stackTraceElement2, "sElements[2]");
str2 = stackTraceElement2.getMethodName();
l.a(str2, "sElements[2].methodName");
StackTraceElement stackTraceElement3 = arrayOfStackTraceElement[2];
l.a(stackTraceElement3, "sElements[2]");
b1 = stackTraceElement3.getLineNumber();
} else {
b1 = -1;
str1 = "unknown file";
str2 = "unknown";
}
stringBuilder.append(str2);
stringBuilder.append("(");
stringBuilder.append(str1);
stringBuilder.append(":");
stringBuilder.append(b1);
stringBuilder.append(") ");
}
int i = paramArrayOfObject.length;
boolean bool = false;
if (i == 0) {
i = 1;
} else {
i = 0;
}
if ((i ^ 0x1) != 0) {
int j = paramArrayOfObject.length;
for (i = bool; i < j; i++) {
Object object1 = paramArrayOfObject[i];
stringBuilder.append(" ");
if (object1 != null) {
stringBuilder.append(object1);
} else {
stringBuilder.append("null");
}
}
Object object = paramArrayOfObject[paramArrayOfObject.length - 1];
if (object instanceof Throwable) {
stringBuilder.append('\n');
stringBuilder.append(Log.getStackTraceString((Throwable)object));
}
}
String str = stringBuilder.toString();
l.a(str, "buffer.toString()");
return str;
}
public final void d(String paramString, Object... paramVarArgs) {
l.b(paramVarArgs, "messages");
a a1 = a;
if (a1 != null)
a1.d(paramString, new Object[] { a(paramVarArgs) });
}
public final void e(String paramString, Object... paramVarArgs) {
l.b(paramVarArgs, "messages");
a a1 = a;
if (a1 != null)
a1.e(paramString, new Object[] { a(paramVarArgs) });
}
}
/* Location: C:\Users\august\Desktop\tik\df_miniapp\classes.jar!\com\bytedance\sandboxapp\b\a\b\b.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 1.1.3
*/
|
package dia04feb;
import java.util.Scanner;
public class ejercicio4 {
public static void main(String[] args) {
// TODO Auto-generated method stub
int numIngresado, numMasAlto, guardaNumeroAlto, numMasBajo, acumNumeros,sumNegativos,sumPositivos;
Scanner Teclado = new Scanner(System.in);
numIngresado = 0;
numMasAlto = 0;
numMasBajo = 0;
guardaNumeroAlto = 0;
acumNumeros =0;
sumNegativos=0;
sumPositivos=0;
do {
System.out.println("ingrese un numero:");
numIngresado = Teclado.nextInt();
if (numIngresado > numMasAlto && numIngresado != -1) {
numMasAlto = numIngresado;
acumNumeros = acumNumeros + numIngresado;
}else if(numIngresado < numMasAlto && numIngresado != -1) {
numMasBajo = numIngresado;
acumNumeros = acumNumeros + numIngresado;
}
if (numIngresado >=0) {
sumPositivos = sumPositivos + numIngresado;
}else if (numIngresado<0) {
sumNegativos = sumNegativos + numIngresado;
}
} while (numIngresado !=-1);
System.out.printf("El numero mas alto fue: %s",numMasAlto);
System.out.printf("\nEl numero mas bajo fue: %s",numMasBajo);
System.out.printf("\nEl acumulado es: %s",acumNumeros);
System.out.printf("La suma de positivos es: %s",sumPositivos);
}
}
|
package com.mes.cep.meta.personnelModel;
/**
* @author StephenยฐยงWen
* @email 872003894@qq.com
* @date 2017ลร5โยฌ2ยปโ
* @Chinesename
*/
public class PersonnelClassProperty {
}
|
package com.gzeinnumer.module_2.ui;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import com.gzeinnumer.module_2.R;
import com.gzeinnumer.module_2.di.provider.Module_2_ComponentProvider;
import javax.inject.Inject;
import javax.inject.Named;
public class Module_2_Activity extends AppCompatActivity {
private static final String TAG = "Module_2_Activity";
@Inject
@Named("Module2")
String str;
@Inject
Module_2_VM module2VM;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_module_2_);
((Module_2_ComponentProvider) getApplication()).getModule_2_Component().inject(this);
int sum = module2VM.execute(10, 50);
Log.d(TAG, "onCreate: "+sum);
Log.d(TAG, "onCreate: "+str);
}
}
|
package com.company.Triangle;
public class Triangle {
int aA;
int bB;
int cC;
public Triangle(int aA, int bB, int cC) {
this.aA = aA;
this.bB = bB;
this.cC = cC;
}
@Override
public String toString() {
return "Triangle{" +
"aA=" + aA +
", bB=" + bB +
", cC=" + cC +
'}';
}
public void show() {
System.out.println(" " + aA + "," + bB + "," + cC + " ");
}
public boolean isRectangular() {
int z = aA * aA + bB * bB;
int q = cC * cC;
if (z == q) {
return true;
}
return false;
}
public boolean isTriangle() {
if (aA < (bB + cC) && cC < (aA + bB) && bB < (aA + cC)) {
return true;
}
return false;
}
public boolean isEqualiteral() {
if ((aA == bB) || (aA == cC) || (bB == cC)) {
return true;
}
return false;
}
public int sum(){
int c= aA + bB + cC;
return c;
}
}
|
package com.espendwise.manta.spi;
public interface Typed<T> {
public T getType();
}
|
/**
* ListDialog.java
*
* This class is the dialog responsible for showing the list of available parties
*
* Trent Begin, Matt Shore, Becky Torrey
* 5/5/2014
*
* Variables:
* private ArrayList<String> displayList: The list of device names
* private String title Dialog Title
* private ListView mListView UI List View
* private AdapterView.OnItemClickListener mOnItemClickListener Listener for List Item Click
*
*
*
* Known Faults:
*
*
*
*/
package com.itspartytime.dialogs;
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.DialogFragment;
import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.LinearLayout;
import android.widget.ListAdapter;
import android.widget.ListView;
import com.itspartytime.R;
import java.lang.reflect.Array;
import java.util.ArrayList;
public class ListDialog extends DialogFragment
{
private ArrayList<String> displayList;
private String title;
private ListView mListView;
private AdapterView.OnItemClickListener mOnItemClickListener;
public ListDialog()
{
}
@Override
public Dialog onCreateDialog(Bundle savedInstanceState)
{
LayoutInflater inflater = getActivity().getLayoutInflater();
LinearLayout mLinearLayout = (LinearLayout)inflater.inflate(R.layout.list_dialog_layout, null);
ListView mListView = (ListView) mLinearLayout.findViewById(R.id.display_list);
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
builder.setView(mLinearLayout);
builder.setCancelable(true);
builder.setTitle(title);
ArrayAdapter<String> mArrayAdapter = new ArrayAdapter<String>(getActivity(), android.R.layout.simple_list_item_1, displayList);
mListView.setAdapter(mArrayAdapter);
mListView.setOnItemClickListener(mOnItemClickListener);
this.mListView = mListView;
return builder.create();
}
/**
* Creates a dialog based on parameters
* @param displayList
* @param title
* @param onItemClickListener
*/
public void createDialog(ArrayList<String> displayList, String title, AdapterView.OnItemClickListener onItemClickListener)
{
this.displayList = displayList;
this.title = title;
this.mOnItemClickListener = onItemClickListener;
}
}
|
package com.tencent.mm.ui;
import android.content.DialogInterface;
import android.content.DialogInterface.OnCancelListener;
class ServiceNotifySettingsUI$2 implements OnCancelListener {
final /* synthetic */ ServiceNotifySettingsUI tqb;
ServiceNotifySettingsUI$2(ServiceNotifySettingsUI serviceNotifySettingsUI) {
this.tqb = serviceNotifySettingsUI;
}
public final void onCancel(DialogInterface dialogInterface) {
this.tqb.finish();
}
}
|
package com.liuhy.hikari;
import com.liuhy.domain.User;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import java.util.List;
/**
* Created by liuhy on 2017/2/22.
*/
public class TestHikari {
@Test
public void testHikari() {
String path = "hikari.xml";
ApplicationContext applicationContext = new ClassPathXmlApplicationContext(path);
UserDao userDao = (UserDao) applicationContext.getBean("userDao");
User user = new User();
user.setUsername("jack");
user.setPassword("rose");
userDao.addUser(user);
}
@Test
public void testQueryAll() {
String path = "hikari.xml";
ApplicationContext applicationContext = new ClassPathXmlApplicationContext(path);
UserDao userDao = (UserDao) applicationContext.getBean("userDao");
List<User> users = userDao.findAll();
for (User u : users) {
System.out.println(u);
}
}
}
|
package com.ifre.service.brms;
import java.util.Set;
import org.jeecgframework.core.common.service.CommonService;
import org.jeecgframework.web.system.pojo.base.TSFunction;
import org.jeecgframework.web.system.pojo.base.TSIcon;
import org.jeecgframework.web.system.pojo.base.TSUser;
import com.ifre.entity.brms.VarType;
import com.ifre.entity.brms.VarTypegroup;
/**
*
* @author caojianmiao
*
*/
public interface ModelVarServiceI extends CommonService{
/**
* ๆฅๅฟๆทปๅ
* @param LogContent ๅ
ๅฎน
* @param loglevel ็บงๅซ
* @param operatetype ็ฑปๅ
* @param TUser ๆไฝไบบ
*/
public void addLog(String LogContent,Short operatetype, Short loglevel);
/**
* ๆฅๅฟๆทปๅ
* @param LogContent ๅ
ๅฎน
* @param loglevel ็บงๅซ
* @param operatetype ๆไฝ็ฑปๅ
* @param businesstype ไธๅก็ฑปๅ
*/
public void addIfreLog(String LogContent, Short loglevel,Short operatetype,Short businesstype);
/**
* ๆฅๅฟๆทปๅ
* @param LogContent ๅ
ๅฎน
* @param loglevel ็บงๅซ
* @param operatetype ๆไฝ็ฑปๅ
*/
public void addIfreLog(String LogContent, Short loglevel,Short operatetype);
/**
* ๅทๆฐๅญๅ
ธๅ็ป็ผๅญ
*/
public void refleshVarTypegroupCach();
/**
* @param type
*/
public void refleshTypesCach(VarType type);
}
|
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package pl.panryba.mc.duels;
/**
*
* @author PanRyba.pl
*/
public class CanDuelResult {
private boolean result;
private CanDuelReason reason;
public CanDuelResult(boolean result, CanDuelReason reason) {
this.result = result;
this.reason = reason;
}
public boolean getResult() {
return this.result;
}
public CanDuelReason getReason() {
return this.reason;
}
}
|
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
/**
* Class responsible for loading
* book data from file.
*/
public class LibraryFileLoader {
/**
* Contains all lines read from a book data file using
* the loadFileContent method.
*
* This field can be null if loadFileContent was not called
* for a valid Path yet.
*
* NOTE: Individual line entries do not include line breaks at the
* end of each line.
*/
private List<String> fileContent;
/** Create a new loader. No file content has been loaded yet. */
public LibraryFileLoader() {
fileContent = null;
}
/**
* Load all lines from the specified book data file and
* save them for later parsing with the parseFileContent method.
*
* This method has to be called before the parseFileContent method
* can be executed successfully.
*
* @param fileName file path with book data
* @return true if book data could be loaded successfully, false otherwise
* @throws NullPointerException if the given file name is null
*/
public boolean loadFileContent(Path fileName) {
Objects.requireNonNull(fileName, "Given filename must not be null.");
boolean success = false;
try {
fileContent = Files.readAllLines(fileName);
success = true;
} catch (IOException | SecurityException e) {
System.err.println("ERROR: Reading file content failed: " + e);
}
return success;
}
/**
* Has file content been loaded already?
* @return true if file content has been loaded already.
*/
public boolean contentLoaded() {
return fileContent != null;
}
/**
* Parse file content loaded previously with the loadFileContent method.
*
* @return books parsed from the previously loaded book data or an empty list
* if no book data has been loaded yet.
*/
public List<BookEntry> parseFileContent() {
if (!contentLoaded()){
System.err.println("ERROR: No content loaded before parsing.");
return Collections.emptyList();
}
else{
List<BookEntry> BookEntries = new ArrayList<>();
addBookEntries(BookEntries);
return BookEntries;
}
}
/**
* Iterate through the csv file and add the book data to the book entries.
* @param bookEntries a list of book entry that book data added to
*/
private void addBookEntries(List<BookEntry> bookEntries) {
/** The for-loop start from index of 1 because the first line is a column header and not actual data.*/
for (int i = 1 ; i< fileContent.size();i++){
String[] bookEntryData = fileContent.get(i).split(",");
String title = bookEntryData[0];
String[] authors = bookEntryData[1].split("-");
float rating = Float.parseFloat(bookEntryData[2]);
String ISBN = bookEntryData[3];
int pages = Integer.parseInt(bookEntryData[4]);
bookEntries.add(new BookEntry(title,authors,rating,ISBN,pages));
}
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.