text stringlengths 10 2.72M |
|---|
package com.example.android.contextexample;
import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import android.support.annotation.ColorRes;
import android.support.v4.media.RatingCompat;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.google.android.gms.appindexing.Action;
import com.google.android.gms.appindexing.AppIndex;
import com.google.android.gms.common.api.GoogleApiClient;
public class Activity1 extends AppCompatActivity {
TextView textViewApp;
/**
* ATTENTION: This was auto-generated to implement the App Indexing API.
* See https://g.co/AppIndexing/AndroidStudio for more information.
*/
private GoogleApiClient client;
// comment added to text/document upload to GitHub
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_1);
String message;
message = "Activity 1 Context: \n" + String.valueOf(this);
TextView textViewActivity = new TextView(this);
textViewActivity.setTextSize(20);
textViewActivity.setText(message);
message = "Application Context: \n" + String.valueOf(getApplicationContext());
//TextView
textViewApp = new TextView(getApplicationContext());
textViewApp.setTextSize(20);
textViewApp.setText(message);
textViewApp.setId(R.id.contextTest);
LinearLayout layout = (LinearLayout) findViewById(R.id.LinearLayout);
//LinearLayout layout = new LinearLayout(this, );
layout.addView(textViewActivity);
layout.addView(textViewApp);
// ATTENTION: This was auto-generated to implement the App Indexing API.
// See https://g.co/AppIndexing/AndroidStudio for more information.
client = new GoogleApiClient.Builder(this).addApi(AppIndex.API).build();
}
public void sendMessage(View view) {
Log.i("Activity1", "In sendMessage");
Log.i("Activity1", "textViewApp: " + String.valueOf(textViewApp));
Log.i("Activity1", "textViewApp: " + String.valueOf(R.id.contextTest));
Bundle myBundle = new Bundle();
myBundle.putInt("passedTextView", R.id.contextTest);
Intent intent = new Intent(getApplicationContext(), Activity2.class);
intent.putExtras(myBundle);
startActivity(intent);
}
@Override
public void onStart() {
super.onStart();
// ATTENTION: This was auto-generated to implement the App Indexing API.
// See https://g.co/AppIndexing/AndroidStudio for more information.
client.connect();
Action viewAction = Action.newAction(
Action.TYPE_VIEW, // TODO: choose an action type.
"Activity1 Page", // TODO: Define a title for the content shown.
// TODO: If you have web page content that matches this app activity's content,
// make sure this auto-generated web page URL is correct.
// Otherwise, set the URL to null.
Uri.parse("http://host/path"),
// TODO: Make sure this auto-generated app deep link URI is correct.
Uri.parse("android-app://com.example.android.contextexample/http/host/path")
);
AppIndex.AppIndexApi.start(client, viewAction);
}
@Override
public void onStop() {
super.onStop();
// ATTENTION: This was auto-generated to implement the App Indexing API.
// See https://g.co/AppIndexing/AndroidStudio for more information.
Action viewAction = Action.newAction(
Action.TYPE_VIEW, // TODO: choose an action type.
"Activity1 Page", // TODO: Define a title for the content shown.
// TODO: If you have web page content that matches this app activity's content,
// make sure this auto-generated web page URL is correct.
// Otherwise, set the URL to null.
Uri.parse("http://host/path"),
// TODO: Make sure this auto-generated app deep link URI is correct.
Uri.parse("android-app://com.example.android.contextexample/http/host/path")
);
AppIndex.AppIndexApi.end(client, viewAction);
client.disconnect();
}
}
|
package com.example.ecommerce.ViewHolder;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import androidx.recyclerview.widget.RecyclerView;
import com.example.ecommerce.R;
public class CashOutViewHolder extends RecyclerView.ViewHolder{
public TextView seeProfileCashOut,amountCashOut,dateTimeCashOut;
public EditText trsnIdCashOut;
public Button submitBtnCashOut;
public CashOutViewHolder(View itemView) {
super(itemView);
seeProfileCashOut=itemView.findViewById(R.id.see_profile_cash_out);
amountCashOut=itemView.findViewById(R.id.amount_cash_out);
dateTimeCashOut=itemView.findViewById(R.id.date_time_cash_out);
trsnIdCashOut=itemView.findViewById(R.id.trsn_id_cash_out);
submitBtnCashOut=itemView.findViewById(R.id.submit_btn_cash_out);
}
}
|
package com.tencent.mm.plugin.appbrand.launching;
public enum ad$a {
Ok,
Fail,
Timeout,
CgiFail,
ResponseInvalid,
AwaitFail;
public static ad$a ld(int i) {
if (i < 0) {
return null;
}
for (ad$a ad_a : values()) {
if (ad_a.ordinal() == i) {
return ad_a;
}
}
return null;
}
}
|
package com.freejavaman;
import android.app.Activity;
import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.ListView;
public class UI_ListView extends Activity {
String[] stations = {"台北", "桃園", "新竹", "苗栗", "台中", "彰化", "雲林", "嘉義", "台南", "高雄", "屏東"};
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
ListView myListView = (ListView)this.findViewById(R.id.myListView);
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, stations);
myListView.setAdapter(adapter);
}
} |
package com.ybg.rbac.resources.domain;
import java.util.LinkedList;
import java.util.List;
import com.ybg.component.org.inter.Organization;
/** 菜单抽象类 **/
public abstract class AbstractResources implements Organization {
/** 编号 **/
private String id;
/** 菜单名称 **/
private String name;
/** 父级编号 **/
private String parentid;
/** 菜单标识 **/
private String reskey;
/** 种类 1 目录,2菜单 ,3 按钮 **/
private String type;
/** 菜单地址 **/
private String resurl;
/** 菜单等级 **/
private Integer level;
/** 菜单图标 **/
private String icon;
/** 是否隐藏 **/
private Integer ishide;
/** 描述 **/
private String description;
/** 是否删除 **/
private Integer isdelete;
/** 颜色ID **/
private Integer colorid;
public List<AbstractResources> list;
public AbstractResources() {
list = new LinkedList<AbstractResources>();
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getParentid() {
return parentid;
}
public void setParentid(String parentid) {
this.parentid = parentid;
}
public String getReskey() {
return reskey;
}
public void setReskey(String reskey) {
this.reskey = reskey;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getResurl() {
return resurl;
}
public void setResurl(String resurl) {
this.resurl = resurl;
}
public Integer getLevel() {
return level;
}
public void setLevel(Integer level) {
this.level = level;
}
public String getIcon() {
return icon;
}
public void setIcon(String icon) {
this.icon = icon;
}
public Integer getIshide() {
return ishide;
}
public void setIshide(Integer ishide) {
this.ishide = ishide;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public Integer getIsdelete() {
return isdelete;
}
public void setIsdelete(Integer isdelete) {
this.isdelete = isdelete;
}
public Integer getColorid() {
return colorid;
}
public void setColorid(Integer colorid) {
this.colorid = colorid;
}
public abstract boolean isLeaf();
public abstract void add(Organization org);
public abstract void remove(Organization org);
}
|
public class Miscellaneous {
private int x;
private int y;
public Miscellaneous() {
x = 5;
y = 2;
}
public void go() {
if (x > y) {
while (x > 0) {
x--;
}
do {
x++;
} while (x < 10);
}
switch (y) {
case 2:
System.out.println("y is 2");
break;
case 3:
System.out.println("y is 3");
break;
case 4:
System.out.println("y is 4");
break;
default:
System.out.println("y is something else");
}
}
public static void main(String[] args) {
Miscellaneous misc = new Miscellaneous();
misc.go();
}
public void setX(int x) {
this.x = x;
}
public void setY(int y) {
this.y = y;
}
}
|
package listener;
import java.awt.Component;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import management.NJDE;
public class KeyboardListener implements KeyListener {
private boolean[] keys = new boolean[256];
public KeyboardListener(Component c) {
c.addKeyListener(this);
}
public boolean isKeyDown(int keycode){
if(keycode > 0 && keycode < 256){
return keys[keycode];
}
return false;
}
@Override
public void keyPressed(KeyEvent e) {
NJDE.print("Key Pressed: " + e.getKeyChar());
if(e.getKeyCode() > 0 && e.getKeyCode() < 256){
keys[e.getKeyCode()] = true;
}
}
@Override
public void keyReleased(KeyEvent e) {
if(e.getKeyCode() > 0 && e.getKeyCode() < 256){
keys[e.getKeyCode()] = false;
}
}
@Override
public void keyTyped(KeyEvent e) {
}
}
|
package com.simpson.kisen.unofficial.model.dao;
import java.util.List;
import java.util.Map;
import com.simpson.kisen.fan.model.vo.Fan;
import com.simpson.kisen.idol.model.vo.Idol;
import com.simpson.kisen.unofficial.model.vo.DemandpdImg;
import com.simpson.kisen.unofficial.model.vo.DepositpdImg;
import com.simpson.kisen.unofficial.model.vo.UnofficialDemand;
import com.simpson.kisen.unofficial.model.vo.UnofficialDeposit;
import com.simpson.kisen.unofficial.model.vo.UnofficialPdImgExt;
import com.simpson.kisen.unofficial.model.vo.UnofficialPdImgExt2;
public interface UnOfficialDao {
int insertdemandEnroll(UnofficialPdImgExt unofficialdemand);
int insertdepositEnroll(UnofficialDeposit unofficialdeposit);
int insertDemandpdImg(DemandpdImg productImg);
int insertDepositpdImg(DepositpdImg productImg);
List<UnofficialPdImgExt> selectunofficialdemandList();
UnofficialPdImgExt selectunofficialdemand(String demandNo);
List<UnofficialPdImgExt2> selectunofficialdeposit();
UnofficialPdImgExt2 selectunofficialdeposit(String dno);
UnofficialPdImgExt selectOneDemand(String demandNo);
int deletedemand(String delNo);
int updateDemand(UnofficialPdImgExt unofficialdemand);
int updateDemandImg(DemandpdImg pdImg);
int updateStock(Map<String, Object> map);
Fan selectOneMemberByEmail(String email);
}
|
package com.sunteam.library.asynctask;
import java.util.ArrayList;
import android.content.Context;
import android.content.Intent;
import android.os.AsyncTask;
import com.sunteam.common.menu.MenuConstant;
import com.sunteam.common.tts.TtsUtils;
import com.sunteam.library.R;
import com.sunteam.library.activity.ResourceListForRecommend;
import com.sunteam.library.entity.EbookInfoEntity;
import com.sunteam.library.entity.EbookNodeEntity;
import com.sunteam.library.net.HttpDao;
import com.sunteam.library.utils.LibraryConstant;
import com.sunteam.library.utils.PublicUtils;
/**
* 得到推荐资源异步加载类
*
* @author wzp
* @Created 2017/01/25
*/
public class GetRecommendAsyncTask extends AsyncTask<Integer, Void, Boolean>
{
private Context mContext;
private String mFatherPath;
private String mTitle;
private int type; // 个性推荐、最新更新、精品专区
private int bookCount = 0; // 资源总数,即当前分类下的书本总数
public static ArrayList<EbookNodeEntity> mEbookNodeEntityList = new ArrayList<EbookNodeEntity>();
public GetRecommendAsyncTask(Context context, String fatherPath, String title)
{
mContext = context;
mFatherPath = fatherPath+title+"/";
mTitle = title;
}
@Override
protected Boolean doInBackground(Integer... params)
{
type = params[0];
String username = PublicUtils.getUserName(mContext);
EbookInfoEntity entity = HttpDao.getRecommendList(params[0], username);
if( ( null == entity ) || ( ( null == entity.list ) || ( 0 == entity.list.size() ) ) )
{
return false;
}
bookCount = entity.itemCount;
if( ( entity.list != null ) && ( entity.list.size() > 0 ) )
{
mEbookNodeEntityList.addAll(entity.list);
int size1 = entity.list.size();
for( int i = 0; i < size1; i++ )
{
String type = entity.list.get(i).dbCode.toLowerCase();
int resType = LibraryConstant.LIBRARY_DATATYPE_EBOOK;
if(type.contains(LibraryConstant.LIBRARY_DBCODE_EBOOK))
{
resType = LibraryConstant.LIBRARY_DATATYPE_EBOOK;
}
else if(type.contains(LibraryConstant.LIBRARY_DBCODE_AUDIO))
{
resType = LibraryConstant.LIBRARY_DATATYPE_AUDIO;
}
else if(type.contains(LibraryConstant.LIBRARY_DBCODE_VIDEO))
{
resType = LibraryConstant.LIBRARY_DATATYPE_VIDEO;
}
entity.list.get(i).resType = resType;
entity.list.get(i).categoryName = HttpDao.getCategoryName( resType, entity.list.get(i).categoryCode );
entity.list.get(i).categoryFullName = PublicUtils.getCategoryName(mContext, resType) + "-" + entity.list.get(i).categoryName + "-" + entity.list.get(i).title;
}
}
return true;
}
@Override
protected void onPreExecute()
{
super.onPreExecute();
PublicUtils.showProgress(mContext, this);
String s = mContext.getResources().getString(R.string.library_wait_reading_data);
TtsUtils.getInstance().speak(s);
mEbookNodeEntityList.clear();
}
@Override
protected void onPostExecute(Boolean result)
{
super.onPostExecute(result);
PublicUtils.cancelProgress();
if(null != mEbookNodeEntityList && mEbookNodeEntityList.size() > 0)
{
startNextActivity();
}
else
{
String s = mContext.getResources().getString(R.string.library_reading_data_error);
PublicUtils.showToast(mContext, s);
}
}
private void startNextActivity() {
Intent intent = new Intent();
intent.putExtra(MenuConstant.INTENT_KEY_TITLE, mTitle); // 菜单名称
intent.putExtra(MenuConstant.INTENT_KEY_LIST, mEbookNodeEntityList); // 菜单名称
intent.putExtra(LibraryConstant.INTENT_KEY_TYPE, type); // 数据类别:个性推荐、最新更新、精品专区
intent.putExtra(LibraryConstant.INTENT_KEY_BOOKCOUNT, bookCount); // 资源总数
intent.putExtra(LibraryConstant.INTENT_KEY_FATHER_PATH, mFatherPath); //父目录
intent.setClass(mContext, ResourceListForRecommend.class);
mContext.startActivity(intent);
}
}
|
import java.io.IOException;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Job;
import org.apache.hadoop.mapreduce.Mapper;
import org.apache.hadoop.mapreduce.Reducer;
import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;
public class HitsFromIP {
public static class TokenizerMapper
extends Mapper<Object,Text,Text,IntWritable>{
public void map(Object key,Text value,Context context)
throws IOException, InterruptedException {
String[] line=value.toString().split(" ");
if(line.length > 1) {
Text word = new Text();
word.set(line[0]);
context.write(word,new IntWritable(1));
}
}
}
public static class HitsFromIPReducer extends Reducer<Text,IntWritable,Text,IntWritable>{
public void reduce(Text key,Iterable<IntWritable> values,Context context)
throws IOException, InterruptedException{
int sum=0;
for(IntWritable value : values) {
sum+=value.get();
}
context.write(key,new IntWritable(sum));
}
}
public static void main(String[] args) throws Exception {
Configuration conf = new Configuration();
Job job = Job.getInstance(conf, "HitsFromIP");
job.setJarByClass(HitsFromIP.class);
job.setMapperClass(TokenizerMapper.class);
job.setMapOutputKeyClass(Text.class);
job.setMapOutputValueClass(IntWritable.class);
job.setCombinerClass(HitsFromIPReducer.class);
job.setReducerClass(HitsFromIPReducer.class);
job.setOutputKeyClass(Text.class);
job.setOutputValueClass(IntWritable.class);
FileInputFormat.addInputPath(job, new Path(args[0]));
FileSystem.get(conf).delete(new Path(args[1]),true);
FileOutputFormat.setOutputPath(job, new Path(args[1]));
System.exit(job.waitForCompletion(true) ? 0 : 1);
}
}
|
package com.rc.portal.dao.impl;
import java.sql.SQLException;
import java.util.List;
import com.ibatis.sqlmap.client.SqlMapClient;
import com.rc.app.framework.webapp.model.page.PageManager;
import com.rc.app.framework.webapp.model.page.PageWraper;
import com.rc.portal.dao.TLeaderAgentDAO;
import com.rc.portal.vo.TLeaderAgent;
import com.rc.portal.vo.TLeaderAgentExample;
public class TLeaderAgentDAOImpl implements TLeaderAgentDAO {
private SqlMapClient sqlMapClient;
public void setSqlMapClient(SqlMapClient sqlMapClient) {
this.sqlMapClient = sqlMapClient;
}
public SqlMapClient getSqlMapClient() {
return sqlMapClient;
}
public TLeaderAgentDAOImpl() {
super();
}
public TLeaderAgentDAOImpl(SqlMapClient sqlMapClient) {
super();
this.sqlMapClient = sqlMapClient;
}
public int countByExample(TLeaderAgentExample example) throws SQLException {
Integer count = (Integer) sqlMapClient.queryForObject("t_leader_agent.ibatorgenerated_countByExample", example);
return count.intValue();
}
public int deleteByExample(TLeaderAgentExample example) throws SQLException {
int rows = sqlMapClient.delete("t_leader_agent.ibatorgenerated_deleteByExample", example);
return rows;
}
public int deleteByPrimaryKey(Long id) throws SQLException {
TLeaderAgent key = new TLeaderAgent();
key.setId(id);
int rows = sqlMapClient.delete("t_leader_agent.ibatorgenerated_deleteByPrimaryKey", key);
return rows;
}
public Long insert(TLeaderAgent record) throws SQLException {
return (Long) sqlMapClient.insert("t_leader_agent.ibatorgenerated_insert", record);
}
public Long insertSelective(TLeaderAgent record) throws SQLException {
return (Long) sqlMapClient.insert("t_leader_agent.ibatorgenerated_insertSelective", record);
}
public List selectByExample(TLeaderAgentExample example) throws SQLException {
List list = sqlMapClient.queryForList("t_leader_agent.ibatorgenerated_selectByExample", example);
return list;
}
public TLeaderAgent selectByPrimaryKey(Long id) throws SQLException {
TLeaderAgent key = new TLeaderAgent();
key.setId(id);
TLeaderAgent record = (TLeaderAgent) sqlMapClient.queryForObject("t_leader_agent.ibatorgenerated_selectByPrimaryKey", key);
return record;
}
public int updateByExampleSelective(TLeaderAgent record, TLeaderAgentExample example) throws SQLException {
UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
int rows = sqlMapClient.update("t_leader_agent.ibatorgenerated_updateByExampleSelective", parms);
return rows;
}
public int updateByExample(TLeaderAgent record, TLeaderAgentExample example) throws SQLException {
UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
int rows = sqlMapClient.update("t_leader_agent.ibatorgenerated_updateByExample", parms);
return rows;
}
public int updateByPrimaryKeySelective(TLeaderAgent record) throws SQLException {
int rows = sqlMapClient.update("t_leader_agent.ibatorgenerated_updateByPrimaryKeySelective", record);
return rows;
}
public int updateByPrimaryKey(TLeaderAgent record) throws SQLException {
int rows = sqlMapClient.update("t_leader_agent.ibatorgenerated_updateByPrimaryKey", record);
return rows;
}
private static class UpdateByExampleParms extends TLeaderAgentExample {
private Object record;
public UpdateByExampleParms(Object record, TLeaderAgentExample example) {
super(example);
this.record = record;
}
public Object getRecord() {
return record;
}
}
public PageWraper selectByRepositoryByPage(TLeaderAgentExample example) throws SQLException {
PageWraper pw=null;
int count=this.countByExample(example);
List list = sqlMapClient.queryForList("t_leader_agent.selectByExampleByPage", example);
System.out.println("��Դ��ҳ��ѯlist.size="+list.size());
pw=PageManager.getPageWraper(example.getPageInfo(), list, count);
return pw;
}
}
|
package mensaje;
import java.util.ArrayList;
import entornoGrafico.VentanaJuego;
import game.Jugador;
public class MsjPartidaObjetoUsado extends Mensaje {
private static final long serialVersionUID = 1L;
private String objeto;
private String jugadorAct;
private ArrayList<Jugador> jugadores;
public MsjPartidaObjetoUsado(String jugadorAct, String objetoUtilizado, ArrayList<Jugador> jugadores) {
clase = getClass().getSimpleName();
this.jugadorAct = jugadorAct;
this.objeto = objetoUtilizado;
this.jugadores = jugadores;
}
@Override
public void ejecutar() {
((VentanaJuego) listenerClient.getCliente().getVentanaActual()).getPanel().informarObjetoUtilizado(jugadorAct,
objeto);
ArrayList<Jugador> game = listenerClient.getCliente().getPartidaActual().getJugadores();
for (int i = 0; i < game.size(); i++) {
game.get(i).setMonedas(jugadores.get(i).getMonedas());
game.get(i).setPierdeTurno(jugadores.get(i).isPierdeTurno());
}
((VentanaJuego) listenerClient.getCliente().getVentanaActual()).getPanel().movimiento();
}
public String getObjeto() {
return objeto;
}
public String getJugadorAct() {
return jugadorAct;
}
public ArrayList<Jugador> getJugadores() {
return jugadores;
}
public void setObjeto(String objeto) {
this.objeto = objeto;
}
public void setJugadorAct(String jugadorAct) {
this.jugadorAct = jugadorAct;
}
public void setJugadores(ArrayList<Jugador> jugadores) {
this.jugadores = jugadores;
}
}
|
package com.shopify.order.popup;
import java.util.Date;
import lombok.Data;
@Data
public class OrderCourierData {
private int idx;
private String id;
private String code;
private String zone;
private int weight;
private int price;
private String startDate;
private String endDate;
private String useYn;
private Date regDate;
private String comCode;
private String comName;
private String codeName;
private String boxType;
private int minDeliveryDate;
private int maxDeliveryDate;
private String serviceCode;
private String nationCode;
private int paymentIdx;
private String masterCode;
private String payId;
private String paymentCode;
private String invoice;
private String courier;
private String courierId;
private String courierCompany;
private int payment;
private int rankPrice;
private String payWeight;
private String payWeightUnit;
private String payState;
private Date paymentDate;
private Date paymentUpdate;
private int salePrice;
private int orderCourier;
private String email;
private String nowDate;
private int shopIdx;
private String shopName;
private String orderCode;
private String proc;
private String locale;
private String shippingLineName;
private String shippingLineCode;
private String codeKname;
private String codeEname;
private int discount;
private int divisor;
}
|
package com.shopify.mapper;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.annotations.Mapper;
import com.shopify.admin.statis.AdminStatisData;
import com.shopify.admin.statis.AdminStatisMakeData;
import com.shopify.admin.statis.AdminStatisRowData;
//import com.shopify.admin.statis.AdminStatisTotalData;
import com.shopify.admin.statis.AdminStatisTotalData;
@Mapper
public interface AdminStatisMapper {
/**
* 관리자 > 정산 > 매출원장
*/
public void insertStatisSales(String nowDate);
public List<AdminStatisData> selectStatisSales(AdminStatisData statis);
public AdminStatisData selectStatisSalesCount(AdminStatisData statis);
public AdminStatisData selectStatisSalesLocalCount(AdminStatisData statis); // 조한두
public List<AdminStatisData> selectStatisLocalSales(AdminStatisData statis); // 조한두
public List<AdminStatisTotalData> selectStatisSalesTotal(AdminStatisTotalData statis);
public List<AdminStatisTotalData> selectStatisSalesTotalNew(AdminStatisTotalData statis);
public List<AdminStatisData> selectStatisSalesReport(AdminStatisData statis); // 매출원장 요약
public void updateCalcul(AdminStatisData statis); // 택배사/셀러정산 여부 업데이트
public void updateVolumeWeightData(Map map); // 엑셀 부피 무게 업로드
public AdminStatisMakeData selectStatisAddSalePrice(AdminStatisMakeData statis); // 추가요금계산
public void insertAddFeesVolumePayment(AdminStatisMakeData statis); // 공시가 추가요금
public void insertAddSaleVolumePayment(AdminStatisMakeData statis); // 매입가 추가요금
public void deleteStatisSales(AdminStatisMakeData statis); // 매출원장 삭제
public void deleteStatisPayment(String nowDate); // 손익통계 삭제
public void deleteStatisAddPayment(AdminStatisMakeData statis); // 추가요금 삭제
public void insertStatisSalesNew(AdminStatisMakeData statis); // 매출원장 입력
public void updateWeight(AdminStatisMakeData statis); // 부피무게 재계산
public List<AdminStatisRowData> selectStatisAddPriceDesc(AdminStatisRowData statis);// 추가요금 상세 사유 보기 팝업
/**
* 관리자 > 정산 > 손익통계
*/
public void insertStatisPayment(String nowDate);
public void insertStatisPaymentNew(AdminStatisMakeData statis); // 신규 : 손익통계
public List<AdminStatisData> selectStatisPayment(AdminStatisData statis);
public List<AdminStatisData> selectStatisPaymentNew(AdminStatisData statis);
}
|
package com.example.autowiredemo;
import com.example.autowiredemo.FortuneService;
import org.springframework.stereotype.Component;
@Component
public class DatabaseFortuneService implements FortuneService {
@Override
public String getFortune() {
return "Database fortune !!";
}
}
|
package ModeType.Impl;
import ModeType.PayType;
/**
* @Author: lty
* @Date: 2020/11/20 14:11
*/
public class GtPayTypeImpl implements PayType {
public String toPay() {
System.out.println("使用GT支付..");
return "使用GT支付成功";
}
}
|
package util;
import static org.lwjgl.opengl.GL11.*;
import static org.lwjgl.opengl.GL20.*;
import static org.lwjgl.util.glu.GLU.*;
public class GL {
public static void checkError() {
int errorValue = glGetError();
if (errorValue != GL_NO_ERROR) {
try {
throw new GLException(gluErrorString(errorValue));
}
catch (GLException e) {
e.printStackTrace();
}
}
}
public static void checkShaderInfo(int id) {
String s = glGetShaderInfoLog(id, 1000);
if (!s.isEmpty() && !s.trim().contains("No errors.")) {
try {
throw new GLException(s);
}
catch (GLException e) {
e.printStackTrace();
}
}
}
}
|
package com.liufeng.common.utils;
import com.liufeng.common.enums.ResultCodeEnums;
import com.liufeng.common.exception.BusinessException;
import lombok.extern.slf4j.Slf4j;
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
/**
* md5加密出来的长度是32位
*/
@Slf4j
public final class EncryptUtils {
/**
* md5加密
*/
public static String md5(String inputText) {
return encrypt(inputText);
}
/**
* md5或者sha-1加密
*/
private static String encrypt(String inputText) {
if (inputText == null || "".equals(inputText.trim())) {
throw new BusinessException(ResultCodeEnums.VAILD_PARAMETER, "加密内容不能为空");
}
String encryptText = null;
try {
MessageDigest m = MessageDigest.getInstance("md5");
m.update(inputText.getBytes(StandardCharsets.UTF_8));
byte s[] = m.digest();
encryptText = hex(s);
} catch (NoSuchAlgorithmException e) {
log.error("Encrypt encrypt error {}", e);
}
return encryptText;
}
/**
* 返回十六进制字符串
* 该方法的左右是减少占用空间
*/
private static String hex(byte[] arr) {
StringBuffer sb = new StringBuffer();
for (int i = 0; i < arr.length; ++i) {
sb.append(Integer.toHexString((arr[i] & 0xFF) | 0x100).substring(1, 3));
}
return sb.toString();
}
}
|
package com.espendwise.manta.model.view;
// Generated by Hibernate Tools
import com.espendwise.manta.model.ValueObject;
import com.espendwise.manta.model.data.BusEntityData;
/**
* AccountIdentView generated by hbm2java
*/
public class AccountIdentView extends ValueObject implements java.io.Serializable {
private static final long serialVersionUID = -1;
public static final String BUS_ENTITY_DATA = "busEntityData";
public static final String ACCOUNT_CONTACT = "accountContact";
public static final String PROPERTIES = "properties";
private BusEntityData busEntityData;
private AccountContactView accountContact;
private AccountIdentPropertiesView properties;
public AccountIdentView() {
}
public AccountIdentView(BusEntityData busEntityData) {
this.setBusEntityData(busEntityData);
}
public AccountIdentView(BusEntityData busEntityData, AccountContactView accountContact, AccountIdentPropertiesView properties) {
this.setBusEntityData(busEntityData);
this.setAccountContact(accountContact);
this.setProperties(properties);
}
public BusEntityData getBusEntityData() {
return this.busEntityData;
}
public void setBusEntityData(BusEntityData busEntityData) {
this.busEntityData = busEntityData;
setDirty(true);
}
public AccountContactView getAccountContact() {
return this.accountContact;
}
public void setAccountContact(AccountContactView accountContact) {
this.accountContact = accountContact;
setDirty(true);
}
public AccountIdentPropertiesView getProperties() {
return this.properties;
}
public void setProperties(AccountIdentPropertiesView properties) {
this.properties = properties;
setDirty(true);
}
}
|
package jpa.project.config;
import jpa.project.cache.CacheKey;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.cache.CacheKeyPrefix;
import org.springframework.data.redis.cache.RedisCacheConfiguration;
import org.springframework.data.redis.cache.RedisCacheManager;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.serializer.RedisSerializationContext;
import org.springframework.data.redis.serializer.StringRedisSerializer;
import java.time.Duration;
import java.util.HashMap;
import java.util.Map;
@EnableCaching
@Configuration
@RequiredArgsConstructor
public class RedisConfig {
@Value("${spring.redis.port}")
private int port;
@Value("${spring.redis.host}")
private String host;
@Bean
public RedisConnectionFactory redisConnectionFactory() {
return new LettuceConnectionFactory(host, port);
}
@Bean
public RedisTemplate<String, Object> redisTemplate() {
RedisTemplate<String, Object> redisTemplate = new RedisTemplate<>();
redisTemplate.setKeySerializer(new StringRedisSerializer());
redisTemplate.setConnectionFactory(redisConnectionFactory());
return redisTemplate;
}
@Bean
public RedisCacheManager cacheManager() {
RedisCacheConfiguration configuration = RedisCacheConfiguration.defaultCacheConfig()
.disableCachingNullValues() // null value 캐시안함
.entryTtl(Duration.ofSeconds(CacheKey.DEFAULT_EXPIRE_SEC)) // 캐시의 기본 유효시간 설정
.computePrefixWith(CacheKeyPrefix.simple())
.serializeKeysWith(RedisSerializationContext.SerializationPair.fromSerializer(new StringRedisSerializer())); // redis 캐시 데이터 저장방식을 StringSeriallizer로 지정
// 캐시키별 default 유효시간 설정
Map<String, RedisCacheConfiguration> cacheConfigurations = new HashMap<>();
cacheConfigurations.put(CacheKey.MEMBER, RedisCacheConfiguration.defaultCacheConfig()
.entryTtl(Duration.ofSeconds(CacheKey.MEMBER_EXPIRE_SEC)));
cacheConfigurations.put(CacheKey.BOARD, RedisCacheConfiguration.defaultCacheConfig()
.entryTtl(Duration.ofSeconds(CacheKey.BOARD_EXPIRE_SEC)));
cacheConfigurations.put(CacheKey.ORDERS, RedisCacheConfiguration.defaultCacheConfig()
.entryTtl(Duration.ofSeconds(CacheKey.ORDER_EXPIRE_SEC)));
cacheConfigurations.put(CacheKey.ORDERS_PURCHASE, RedisCacheConfiguration.defaultCacheConfig()
.entryTtl(Duration.ofSeconds(CacheKey.ORDER_EXPIRE_SEC)));
cacheConfigurations.put(CacheKey.ORDERS_SALES, RedisCacheConfiguration.defaultCacheConfig()
.entryTtl(Duration.ofSeconds(CacheKey.ORDER_EXPIRE_SEC)));
cacheConfigurations.put(CacheKey.ORDER, RedisCacheConfiguration.defaultCacheConfig()
.entryTtl(Duration.ofSeconds(CacheKey.ORDER_EXPIRE_SEC)));
cacheConfigurations.put(CacheKey.REGISTEDSHOES, RedisCacheConfiguration.defaultCacheConfig()
.entryTtl(Duration.ofSeconds(CacheKey.REGISTEDSHOES_EXPIRE_SEC)));
cacheConfigurations.put(CacheKey.REGISTEDSHOES_LIST, RedisCacheConfiguration.defaultCacheConfig()
.entryTtl(Duration.ofSeconds(CacheKey.REGISTEDSHOES_EXPIRE_SEC)));
// cacheConfigurations.put(CacheKey.MESSAGE, RedisCacheConfiguration.defaultCacheConfig()
// .entryTtl(Duration.ofSeconds(CacheKey.MESSAGE_EXPIRE_SEC)));
return RedisCacheManager.RedisCacheManagerBuilder.fromConnectionFactory(redisConnectionFactory()).cacheDefaults(configuration)
.withInitialCacheConfigurations(cacheConfigurations).build();
}
} |
package com.sobey.exportExcel.model;
import org.junit.Test;
/**
* Created by lijunhong on 17/3/29.
*/
public class ExcelModelTest {
@Test
public void test1(){
}
} |
package com.pangpang6.books.binlog;
import java.util.Set;
public class BinlogParamEntity {
private String tableName;
private Set<String> eventTypes;
private Set<String> fields;
public BinlogParamEntity() {
}
public BinlogParamEntity(String tableName, Set<String> eventTypes, Set<String> fields) {
this.tableName = tableName;
this.eventTypes = eventTypes;
this.fields = fields;
}
public String getTableName() {
return tableName;
}
public void setTableName(String tableName) {
this.tableName = tableName;
}
public Set<String> getEventTypes() {
return eventTypes;
}
public void setEventTypes(Set<String> eventTypes) {
this.eventTypes = eventTypes;
}
public Set<String> getFields() {
return fields;
}
public void setFields(Set<String> fields) {
this.fields = fields;
}
}
|
package com.trs.om.service;
import java.util.Set;
import com.trs.om.bean.Permission;
import com.trs.om.bean.User;
import com.trs.om.rbac.AuthorizationException;
/**
* 权限服务
* @author changguanghua
* 2012-5-11 14:41:13
* */
public interface PermissionService {
/**
* 判断用户在哪些组具有权限。
* 对于admin用户(不属于任何组),列出所有已经分配了该权限(具有该权限的角色)的用户组
* */
Set<Long> listGroupIdsForPermission(User user,String[] permissionString);
/**
* 列出哪些角色中授予了权限
* */
Set<Long> listRoleIdsForPermission(String[] permissionString);
/**
* 根据用户Id列出某个用户拥有的权限列表
* @param userId
* @return
*/
Set<Permission> listPermissionsForUser(Long userId) throws AuthorizationException;
}
|
import java.awt.*;
public class Obstacles extends Sprite{
public Obstacles(Color color, int x, int y, int width, int height, Board board) {
super(color, x, y, width, height, board);
}
@Override
public void paint(Graphics g) {
g.setColor(this.getColor());
g.fillRect(x,y,width,height);
}
}
|
package com.zzjmay.netty.lesson3;
import io.netty.channel.Channel;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;
import io.netty.channel.group.ChannelGroup;
import io.netty.channel.group.DefaultChannelGroup;
import io.netty.util.concurrent.GlobalEventExecutor;
/**
* Created by zzjmay on 2019/3/14.
*/
public class MyChatServerHandler extends SimpleChannelInboundHandler<String> {
//channelGroup
private static ChannelGroup channelGroup = new DefaultChannelGroup(GlobalEventExecutor.INSTANCE);
@Override
protected void channelRead0(ChannelHandlerContext channelHandlerContext, String s) throws Exception {
//获取当前的channel连接
Channel channel = channelHandlerContext.channel();
channelGroup.forEach(channel1 -> {
if(channel != channel1){
//如果循环到的不是
channel1.writeAndFlush(channel.remoteAddress() +"发送消息"+s+"\n");
}else{
channel1.writeAndFlush("[自己]"+ s);
}
});
}
/**
* 连接建立进来
* @param ctx
* @throws Exception
*/
@Override
public void handlerAdded(ChannelHandlerContext ctx) throws Exception {
Channel channel = ctx.channel();
//将连接好的channel,放入channelGroup中
channelGroup.writeAndFlush("【服务器】"+channel.remoteAddress()+"加入\n");
channelGroup.add(channel);
}
/**
* 连接断连接
* @param ctx
* @throws Exception
*/
@Override
public void handlerRemoved(ChannelHandlerContext ctx) throws Exception {
Channel channel = ctx.channel();
channelGroup.writeAndFlush("【服务器】"+channel.remoteAddress()+"离开\n");
}
@Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
super.exceptionCaught(ctx, cause);
ctx.close();
}
/**
* 链接激活
* @param ctx
* @throws Exception
*/
@Override
public void channelActive(ChannelHandlerContext ctx) throws Exception {
Channel channel = ctx.channel();
System.out.println(channel.remoteAddress() +"上线");
}
@Override
public void channelInactive(ChannelHandlerContext ctx) throws Exception {
Channel channel = ctx.channel();
System.out.println(channel.remoteAddress()+"下线");
}
}
|
package View;
import Controller.Auction;
import Controller.Control;
import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
/**
* Created by Patrick on 2/8/15.
*/
public class ImportForm extends JFrame{
private JButton importBiddersButton;
private JButton importItemsButton;
private JButton backButton;
public JPanel contentPane;
private JLabel importedBidders;
private JLabel importedItems;
private String lastLocation;
// public JPanel contentPane;
public ImportForm(){
ActionListener listener = new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
final JFileChooser fc = new JFileChooser(lastLocation);
if(e.getActionCommand().equalsIgnoreCase("Import Bidders")){
String file1 = "";
fc.setDialogTitle("Choose Bidder File");
int returnVal = fc.showOpenDialog(contentPane);
if (returnVal == JFileChooser.APPROVE_OPTION) {
File file = fc.getSelectedFile();
try {
file1 = file.getCanonicalPath();
lastLocation = file.getCanonicalPath();
}catch (Exception e2){
e2.printStackTrace();
}
//This is where a real application would open the file.
importedBidders.setText("Opening: " + file.getName());
String retMessage = Auction.importBidders(file1);
importedBidders.setText(importedBidders.getText() + "\n" + retMessage);
importedBidders.setText(importedBidders.getText() + "\n" + Auction.bidders.size() + " Bidders added");
} else {
System.out.println("Open command cancelled by user.");
}
} else if(e.getActionCommand().equalsIgnoreCase("Import Items")){
String file2 = "";
fc.setDialogTitle("Choose Item File");
int returnVal = fc.showOpenDialog(contentPane);
if (returnVal == JFileChooser.APPROVE_OPTION) {
File file = fc.getSelectedFile();
try {
file2 = file.getCanonicalPath();
lastLocation = file.getCanonicalPath();
}catch (Exception e2){
e2.printStackTrace();
}
//This is where a real application would open the file.
importedItems.setText("Opening: " + file.getName());
String retMessage = Auction.importItems(file2);
importedItems.setText(importedItems.getText() + "\n" + retMessage);
importedItems.setText(importedItems.getText() + "\n" + Auction.bidders.size() + " Items added");
} else {
System.out.println("Open command cancelled by user.");
}
} else if(e.getActionCommand().equalsIgnoreCase("Back")){
importedBidders.setText("");
importItemsButton.setText("");
Control.showMainMenu();
}
}
};
importBiddersButton.addActionListener(listener);
importItemsButton.addActionListener(listener);
backButton.addActionListener(listener);
}
}
|
package inter;
import lexer.Num;
import lexer.Token;
import lexer.Word;
import symbols.Type;
public class Constant extends Expr {
public Constant(Token tok, Type p) {
super(tok, p);
}
public Constant(int i) {
super(new Num(i),Type.Int);
}
public static final Constant
True=new Constant(Word.True,Type.Bool),
False =new Constant(Word.False,Type.Bool);
public void jumping(int t,int f) {
if(this==True&&t!=0)emit(" goto L"+t);
else if(this==False&&f!=0)emit(" goto L"+f);
}
}
|
package co.edu.udea.appempresariales;
import java.net.UnknownHostException;
import com.mongodb.BasicDBObject;
import com.mongodb.DB;
import com.mongodb.DBCollection;
import com.mongodb.DBObject;
import com.mongodb.MongoClient;
public class MongoDB {
MongoClient mongo = null;
DB db = null ;
public MongoDB(String databaseName, String host, int port){
mongo = null;
try {
mongo = new MongoClient(host, port);
db = mongo.getDB(databaseName);
}
catch (UnknownHostException e) {
e.printStackTrace();
}
}
public void addDocumentToCollection(String collectionName,BasicDBObject document){
DBCollection table = this.db.getCollection(collectionName);
table.insert(document);
}
public DBObject findOneDocument(String collectionName,BasicDBObject document){
DBCollection table = db.getCollection(collectionName);
return table.findOne(document);
}
}
|
package com.MQ.www;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
public class Basic {
public static void main(String[] args) {
WebDriver driver=new ChromeDriver();
driver.get("https://www.flipkart.com");
}
}
|
package com.orangehrmlive.demo.pages;
import com.orangehrmlive.demo.annotations.RelativeUrl;
import org.openqa.selenium.By;
import org.openqa.selenium.NoSuchElementException;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.interactions.Actions;
import org.openqa.selenium.support.FindBy;
@RelativeUrl("/index.php/admin/saveJobTitle")
public class SaveJobTitlePage extends Page {
@FindBy(id = "jobTitle_jobTitle")
private WebElement inputJobTitle;
@FindBy(css = "span.validation-error[for='jobTitle_jobTitle']")
private WebElement validatorJobTitle;
@FindBy(id = "jobTitle_jobDescription")
private WebElement inputJobDescription;
@FindBy(id = "jobTitle_jobSpec")
private WebElement inputJobSpecification;
@FindBy(css = "#fileLink a")
private WebElement linkJobSpecification;
@FindBy(id = "jobTitle_jobSpecUpdate_2")
private WebElement buttonDeleteJobSpecification;
@FindBy(id = "jobTitle_jobSpecUpdate_3")
private WebElement buttonReplaceJobSpecification;
@FindBy(id = "jobTitle_note")
private WebElement inputJobNote;
@FindBy(css = "span.validation-error[for='jobTitle_note']")
private WebElement validatorJobNote;
@FindBy(id = "btnSave")
private WebElement buttonSave;
@FindBy(id = "btnCancel")
private WebElement buttonCancel;
public SaveJobTitlePage(WebDriver driver) {
super(driver);
}
public void setJobTitle(String jobTitle) {
inputJobTitle.clear();
inputJobTitle.sendKeys(jobTitle);
}
public String getJobTitle() {
return String.valueOf(jse.executeScript("return arguments[0].value;", inputJobTitle));
}
public void setJobDescription(String jobDescription) {
inputJobDescription.clear();
inputJobDescription.sendKeys(jobDescription);
}
public String getJobDescription() {
return String.valueOf(jse.executeScript("return arguments[0].value;", inputJobDescription));
}
public void setJobSpecification(String jobSpecification) {
inputJobSpecification.clear();
if (!jobSpecification.isEmpty()) {
inputJobSpecification.sendKeys(jobSpecification);
}
}
public String getJobSpecification() {
if (isElementPresent(linkJobSpecification)) {
return String.valueOf(jse.executeScript("return arguments[0].text;", linkJobSpecification));
} else {
return String.valueOf(jse.executeScript("return arguments[0].value;", inputJobSpecification));
}
}
public void setJobNote(String jobNote) {
inputJobNote.clear();
inputJobNote.sendKeys(jobNote);
}
public String getJobNote() {
return String.valueOf(jse.executeScript("return arguments[0].value;", inputJobNote));
}
public void clickSave() {
buttonSave.click();
}
public void dblClickSave() {
Actions action = new Actions(driver);
action.doubleClick(buttonSave).perform();
}
public void clickCancel() {
buttonCancel.click();
}
public boolean isEnabledJobTitle() {
return inputJobTitle.isEnabled();
}
public boolean isEnabledJobDescription() {
return inputJobDescription.isEnabled();
}
public boolean isEnabledJobSpecification() {
return inputJobSpecification.isEnabled();
}
public boolean isEnabledJobNote() {
return inputJobNote.isEnabled();
}
public String getValidationMessageJobTitle() {
if (isElementPresent(validatorJobTitle)) {
return validatorJobTitle.getText();
} else {
return "";
}
}
public String getValidationMessageJobNote() {
if (isElementPresent(validatorJobNote)) {
return validatorJobNote.getText();
} else {
return "";
}
}
public String getMessage() {
try {
return driver.findElement(By.cssSelector("div.fadable")).getText();
} catch (NoSuchElementException e) {
return "";
}
}
public void clickDeleteJobSpecification() {
buttonDeleteJobSpecification.click();
}
public void clickReplaceJobSpecification() {
buttonReplaceJobSpecification.click();
}
}
|
package FunctionalProgramming;
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;
import java.util.stream.Collectors;
public class SortEven1 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String[] input = sc.nextLine().split(", ");
List<Integer> evens = Arrays.stream(input)
.map(Integer::parseInt)
.filter(x -> x % 2 == 0)
.collect(Collectors.toList());
List<String> nums = evens.stream()
.map(String::valueOf)
.collect(Collectors.toList());
System.out.println(String.join(", ", nums));
evens.sort(Integer::compare);
List<String> sorted = evens.stream()
.map(String::valueOf)
.collect(Collectors.toList());
System.out.println(String.join(", ", sorted));
}
}
|
package graphana.operationsystem;
import graphana.MainControl;
import scriptinterface.execution.ExecuterInterface;
import scriptinterface.execution.returnvalues.ExecutionReturn;
import java.util.concurrent.Callable;
/**
* Thread for executing an Executer
*
* @author Andreas Fender
*/
public class ExecuterThread extends GraphanaThread {
private ExecuterInterface executer;
/**
* Creates an instance with the given executer
*/
public ExecuterThread(ExecuterInterface executer, MainControl mainControl) {
super(mainControl);
this.executer = executer;
result = null;
}
/**
* Creates and returns a Callable of the executer to be executed using a FutureTask
*/
@Override
protected Callable<ExecutionReturn> getCallable() {
return () -> executer.execute();
}
}
|
package com.pathfinding;
import com.badlogic.gdx.math.Vector2;
/**
* Node used in A* pathfinding.
*
* @author jl3293
*/
public class AStarNode {
// Position of this node in space
private Vector2 pos;
// Position from which pathfinding began
private Vector2 source;
// Position to pathfind to
private Vector2 target;
// g(x): the distance travelled from the source so far. A value of -1 indicates that g has not yet been calculated, use incrDistFromSource
private float gVal;
// h(x): the value of the heuristic function (defined in com.pathfinding.AStarNodeComparator.java)
private float hVal;
// f(x): g(x) + h(x). A value of -1 indicates that g has not yeet been calculated, use incrDistFromSource
private float fVal;
// The parent node. Null if this is the root of the tree
private AStarNode parent;
/**
* Constructor calculating the heuristic, and initialising f and g as invalid.
*
* @param source Position from which pathfinding began
* @param pos Position of this node in space
* @param target Position to pathfind to
*/
public AStarNode(Vector2 source, Vector2 pos, Vector2 target, AStarNode parent, float distFromParent) {
// Save arguments locally
this.pos = pos;
this.source = source;
this.target = target;
this.parent = parent;
// Set g and f to null values, and calculate the heuristic
gVal = distFromParent;
hVal = PathFindUtil.calculateHeuristic(pos, target);
fVal = gVal + hVal;
}
/**
* Get the value of the heuristic function for this node.
*
* @return The value of the heuristic function for this node.
*/
public float getHeuristic() {
return hVal;
}
/**
* Get the total A* weight for this node (f = g + h)
*
* @return The A* weighting for this node
*/
public float getWeight() {
return fVal;
}
/**
* Get the current distance from the source node
*
* @return The current distance from the source node
*/
public float getDistFromSource () {
return gVal;
}
/**
* Get the position of this node in space
*
* @return The position of this node in space
*/
public Vector2 getPos() {
return pos;
}
/**
* Get the position from which pathfanding began
*
* @return The position from which pathfinding began
*/
public Vector2 getSource() {
return source;
}
/**
* Get the position the A* algorithm is pathfinding to
*
* @return The position pathfinding is attempting to reach
*/
public Vector2 getTarget() {
return target;
}
/**
* Get the parent of this node. Null if this is the root of the tree.
* @return The parent of this node
*/
public AStarNode getParent() {
return parent;
}
/**
* Get a representation of this node in string form, including all relevant information.
*/
public String toString() {
return "AStarNode (" + source.x + ", " + source.y + ") -> " +
"[" + pos.x + ", " + pos.y + "] -> " +
"(" + target.x + ", " + target.y + ") | " +
"g=" + gVal + " h=" + hVal + " f=" + fVal;
}
@Override
/**
* Test whether two AStarNodes are equal, based on their source, position, target, and g values.
* If an object other than an AStarNode is passed, false is returned.
*/
public boolean equals(Object other) {
if (other instanceof AStarNode) {
return source.equals(((AStarNode) other).source) &&
pos.equals(((AStarNode) other).pos) &&
target.equals(((AStarNode) other).target) &&
gVal == ((AStarNode) other).getDistFromSource();
}
return false;
}
}
|
public class ElfWizard extends Wizard{
static int warriorNumber = 1;
public ElfWizard(){
this.setRace("Elfs");
this.setName("-ElfWizard[" + warriorNumber++ +"]");
this.setRangeAtkPower(10);
}
}
|
package com.wxapp.entity.msg;
import java.util.List;
public class CardMsg {
private List<String> toWxIds;
private String cardWxId;
private String cardNickName;
private String cardAlias;
private String wxId;
public CardMsg( ) {
}
public CardMsg(List<String> toWxIds, String cardWxId, String cardNickName, String cardAlias, String wxId) {
this.toWxIds = toWxIds;
this.cardWxId = cardWxId;
this.cardNickName = cardNickName;
this.cardAlias = cardAlias;
this.wxId = wxId;
}
public List<String> getToWxIds() {
return toWxIds;
}
public void setToWxIds(List<String> toWxIds) {
this.toWxIds = toWxIds;
}
public String getCardWxId() {
return cardWxId;
}
public void setCardWxId(String cardWxId) {
this.cardWxId = cardWxId;
}
public String getCardNickName() {
return cardNickName;
}
public void setCardNickName(String cardNickName) {
this.cardNickName = cardNickName;
}
public String getCardAlias() {
return cardAlias;
}
public void setCardAlias(String cardAlias) {
this.cardAlias = cardAlias;
}
public String getWxId() {
return wxId;
}
public void setWxId(String wxId) {
this.wxId = wxId;
}
}
|
package com.vesakha.vesakhaindonesia.model;
import java.io.Serializable;
public class Product implements Serializable {
String idProduct;
String idDivisi;
String idCategory;
String nameProduct;
String description;
String detail;
String spec;
String specVal;
String urlImage;
String priceProduct;
String weight;
String stockProduct;
String disc;
String dDisc;
String addDate;
String link;
public Product(String idProduct, String idDivisi, String idCategory, String nameProduct, String description, String detail, String spec, String specVal, String urlImage, String priceProduct, String weight, String stockProduct, String disc, String dDisc, String addDate, String link) {
this.idProduct = idProduct;
this.idDivisi = idDivisi;
this.idCategory = idCategory;
this.nameProduct = nameProduct;
this.description = description;
this.detail = detail;
this.spec = spec;
this.specVal = specVal;
this.urlImage = urlImage;
this.priceProduct = priceProduct;
this.weight = weight;
this.stockProduct = stockProduct;
this.disc = disc;
this.dDisc = dDisc;
this.addDate = addDate;
this.link = link;
}
public String getIdProduct() {
return idProduct;
}
public void setIdProduct(String idProduct) {
this.idProduct = idProduct;
}
public String getIdDivisi() {
return idDivisi;
}
public void setIdDivisi(String idDivisi) {
this.idDivisi = idDivisi;
}
public String getIdCategory() {
return idCategory;
}
public void setIdCategory(String idCategory) {
this.idCategory = idCategory;
}
public String getNameProduct() {
return nameProduct;
}
public void setNameProduct(String nameProduct) {
this.nameProduct = nameProduct;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getDetail() {
return detail;
}
public void setDetail(String detail) {
this.detail = detail;
}
public String getSpec() {
return spec;
}
public void setSpec(String spec) {
this.spec = spec;
}
public String getSpecVal() {
return specVal;
}
public void setSpecVal(String specVal) {
this.specVal = specVal;
}
public String getUrlImage() {
return urlImage;
}
public void setUrlImage(String urlImage) {
this.urlImage = urlImage;
}
public String getPriceProduct() {
return priceProduct;
}
public void setPriceProduct(String priceProduct) {
this.priceProduct = priceProduct;
}
public String getWeight() {
return weight;
}
public void setWeight(String weight) {
this.weight = weight;
}
public String getStockProduct() {
return stockProduct;
}
public void setStockProduct(String stockProduct) {
this.stockProduct = stockProduct;
}
public String getDisc() {
return disc;
}
public void setDisc(String disc) {
this.disc = disc;
}
public String getdDisc() {
return dDisc;
}
public void setdDisc(String dDisc) {
this.dDisc = dDisc;
}
public String getAddDate() {
return addDate;
}
public void setAddDate(String addDate) {
this.addDate = addDate;
}
public String getLink() {
return link;
}
public void setLink(String link) {
this.link = link;
}
}
|
// Insertion Sort
//
// Input: list of n comparable elements indexed 0 to n-1
//
// Output: list of elements sorted in ascending order
//
// 1. for i = 1 to n-1
// 1.1. compare the current value with elements i-1 down to 0
// 1.2. shift each element that is greater than the current value one position to the right
// 1.3. insert current value into its correct position relative to other elements in range
public class InsertionSort implements Sort {
public long sortMe(double[] array) {
// 1. for i = 1 to n-1
for (int i = 0; i < array.length; i++) {
double current = array[i];
int j = i;
// 1.1. compare the current value with elements i-1 down to 0
while (j > 0 && array[j - 1] > current) {
// 1.2. shift each element that is greater than the current
// value one position to the right
array[j] = array[j - 1];
j--;
}
// 1.3. insert current value into its correct position relative to
// other elements in range
array[j] = current;
}
// return array;
return st.getElapsedTime();
}
} |
package com.base.crm.sign.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.base.crm.sign.dao.UserSignMapper;
import com.base.crm.sign.entity.UserSign;
import com.base.crm.sign.service.UserSignService;
@Component
public class UserSignServiceImpl implements UserSignService {
@Autowired
private UserSignMapper userSignMapper;
@Override
public int deleteByPrimaryKey(Long id) {
return userSignMapper.deleteByPrimaryKey(id);
}
@Override
public int insertSelective(UserSign record) {
return userSignMapper.insertSelective(record);
}
@Override
public UserSign selectByPrimaryKey(Long id) {
return userSignMapper.selectSimpleObjectBy( new UserSign(id));
}
@Override
public int updateByPrimaryKeySelective(UserSign record) {
return userSignMapper.updateByPrimaryKeySelective(record);
}
@Override
public Long selectPageTotalCount(UserSign userSign) {
return userSignMapper.selectPageTotalCount(userSign);
}
@Override
public List<UserSign> selectPageByObjectForList(UserSign userSign) {
return userSignMapper.selectPageByObjectForList(userSign);
}
@Override
public UserSign selectSimpleObjectBy(UserSign us) {
return userSignMapper.selectSimpleObjectBy(us);
}
} |
package com.qianfeng.springboothello.controller;
import com.qianfeng.springboothello.entity.Resources;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
/**
* @author FuZhiFan
* @Date 2019/7/29
*/
@RestController
@RequestMapping("user")
public class UserController {
/* @Value("${fileServer.path}")
private String fileServer;
@Value("${emailServer.path}")
private String emailServer;
*/
@Autowired
private Resources resources;
/* @GetMapping("properties")
public String properties(){
return fileServer+":"+emailServer;
}
*/
@GetMapping("resource")
public String resources(){
return resources.getFileServer()+":::"+resources.getEmailServer();
}
@RequestMapping("hello")
public String hello(){
return "hello SpringBoot!!!!!!!!!";
}
@GetMapping("page")
public String page(@RequestParam(name="pageIndex",required = false,defaultValue = "1") Integer pageIndex){
return "pageIndex:"+pageIndex;
}
@GetMapping("page/{pageIndex}")
public String page2(@PathVariable(name="pageIndex") Integer pageIndex){
return "pageIndex:"+pageIndex;
}
}
|
public class HeapifySorting{
public static void main(String[] args) {
int[] arr = {1, 2, 3, 4, 7, 8, 9, 10, 14, 16};
int n = arr.length;
int[] sortedArr = new int[arr.length];
for(int i = arr.length/2 -1; i>=0; i--)
heapify(arr, n , i);
for(int heapifiedValues : arr)
System.out.println(heapifiedValues);
for (int j =arr.length - 1; j>=0;j--) {
int temp = arr[j];
arr[j] = arr[0];
arr[0] = temp;
heapify(arr,j,0);
}
System.out.println("Sorted Array");
for(int sortedArrValues : arr){
System.out.println(sortedArrValues);
}
}
private static void heapify(int[] arr, int n, int i) {
int largest = i;
int l = 2*i + 1;
int r = 2*i + 2;
if(l<n && arr[l] > arr[largest])
largest = l;
if(r<n && arr[r] > arr[largest])
largest = r;
if(largest != i){
int temp = arr[i];
arr[i] = arr[largest];
arr[largest] = temp;
heapify(arr, n, largest);
}
}
} |
package round.first.templete;
public class IOpractice {
}
|
public class nsuma
{
public static void main(String[] args)
{
int n = 2;
n = n+(++n);
System.out.println("N = " + n);
}
} |
package com.ssm.wechatpro.service.impl;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.github.miemiedev.mybatis.paginator.domain.PageList;
import com.ssm.wechatpro.dao.UploadMapper;
import com.ssm.wechatpro.dao.WechatScollorPicMapper;
import com.ssm.wechatpro.dao.WechatUserMapper;
import com.ssm.wechatpro.object.InputObject;
import com.ssm.wechatpro.object.OutputObject;
import com.ssm.wechatpro.service.WechatScollorPicService;
import com.ssm.wechatpro.util.Constants;
import com.ssm.wechatpro.util.DateUtil;
import com.ssm.wechatpro.util.JudgeUtil;
import com.ssm.wechatpro.util.ToolUtil;
@Service
public class WechatScollorPicServiceImpl implements WechatScollorPicService{
@Resource
private WechatScollorPicMapper wechatScollorPicMapper;
@Resource
private UploadMapper uploadMapper;
@Resource
private WechatUserMapper wechatUserMapper;
/**
* 添加广告
* @param inputObject
* @param outputObject
* @throws Exception
*/
@Override
public void insertScoller(InputObject inputObject, OutputObject outputObject) throws Exception {
Map<String,Object> map = inputObject.getParams();
if(!ToolUtil.contains(map, Constants.SCOLLOR_PIC_TEST, Constants.SCOLLOR_PIC_TEST_RETURNMESSAGE, inputObject, outputObject)){
return;
}
map.put("scollor_pic_data", DateUtil.getTime());//添加日期
wechatScollorPicMapper.insertScoller(map);
}
/**
* 查询所有通知
* @param inputObject
* @param outputObject
* @throws Exception
*/
@Override
public void selectAllScollor(InputObject inputObject,OutputObject outputObject) throws Exception {
Map<String,Object> map = inputObject.getParams();
int page = Integer.parseInt(map.get("offset").toString())/Integer.parseInt(map.get("limit").toString());
page++;
int limit = Integer.parseInt(map.get("limit").toString());
List<Map<String,Object>> beans = wechatScollorPicMapper.selectAllScollor(map,new PageBounds(page,limit));
PageList<Map<String, Object>> abilityInfoPageList = (PageList<Map<String, Object>>)beans;
for (Map<String, Object> bean : beans) {//遍历每一条通知,获取每一条图片的路径
if(bean.containsKey("scollor_pic_path")){
if(!JudgeUtil.isNull(bean.get("scollor_pic_path").toString())){
Map<String,Object> upload = new HashMap<>();
upload.put("id", bean.get("scollor_pic_path").toString());
Map<String,Object> tupian = uploadMapper.selectById(upload);
if(tupian!=null){
bean.put("optionPath", tupian.get("optionPath").toString());
}
}
}
//Map<String,Object> param = new HashMap<>();
//param.put("id", bean.get("scollor_pic_userid").toString());
//Map<String,Object> map2 = wechatAdminLoginMapper.selectById(param);
//bean.put("adminNo", map2.get("adminNo").toString());//创建人手机号
//拼接url
//bean.put("url", "http://"+Constants.YUMING+"/wechatpro/html/phoneModelOne/slideShow.html?id="+bean.get("id").toString());
}
int total = abilityInfoPageList.getPaginator().getTotalCount();
outputObject.setBeans(beans);
outputObject.settotal(total);
}
/**
* 删除一条通知
* @param inputObject
* @param outputObject
* @throws Exception
*/
@Override
public void deleteScollor(InputObject inputObject, OutputObject outputObject) throws Exception {
Map<String,Object> map = inputObject.getParams();
if(!ToolUtil.contains(map, Constants.SCOLLOR_PIC, Constants.SCOLLOR_PIC_RETURNMESSAGE, inputObject, outputObject)){
return;
}
wechatScollorPicMapper.deleteScollor(map);
}
/**
* 回显
* @param inputObject
* @param outputObject
* @throws Exception
*/
@Override
public void selectById(InputObject inputObject,OutputObject outputObject) throws Exception {
Map<String,Object> map = inputObject.getParams();
if(!ToolUtil.contains(map, Constants.SCOLLOR_PIC, Constants.SCOLLOR_PIC_RETURNMESSAGE, inputObject, outputObject)){
return;
}
Map<String,Object> bean = wechatScollorPicMapper.selectById(map);
//回显图片
if(bean.containsKey("scollor_pic_path")){
if(!JudgeUtil.isNull(bean.get("scollor_pic_path").toString())){
Map<String,Object> upload = new HashMap<>();
upload.put("id", bean.get("scollor_pic_path").toString());
Map<String,Object> tupian = uploadMapper.selectById(upload);
if(tupian!=null){
bean.put("optionPath", tupian.get("optionPath").toString());
}
}
}
outputObject.setBean(bean);
}
/**
* 手机端显示广告图片
* @param inputObject
* @param outputObject
* @throws Exception
*/
@Override
public void selectAllScollorList(InputObject inputObject,OutputObject outputObject) throws Exception {
List<Map<String,Object>> selectAllScollorList = wechatScollorPicMapper.selectAllScollorList();
Map<String, Object> map = inputObject.getWechatLogParams();
outputObject.setBean(map);
outputObject.setBeans(selectAllScollorList);
outputObject.settotal(selectAllScollorList.size());
}
}
|
package banking.menus.super_user;
import java.util.NoSuchElementException;
import banking.Application;
import banking.exceptions.ExitingException;
import banking.menus.Menu;
import banking.menus.NewUserMenu;
import banking.menus.standard_user.HomeMenu;
import banking.model.*;
public class UsersMenu extends Menu {
protected String commands ="(create|delete|access)-user|display-user-list";
private Integer maxArguments = 2;
private static String name = "Users";
private static Menu menu = null;
//HELP SCREEN
private String help= Menu.help + "\n\n" + name.toUpperCase() +" MENU HELPER\n"
+ "This is the Users list page. Here you will be able to modify your banking application's users\n"
+ "\nCOMMANDS\n"
+ "create-user : navigate through the user creation process.\n"
+ "delete-user [user_id] : deletes the specified user.\n"
+ "access-user [user_id] : accesses the specified user.\n"
+ "display-user-list : displays the list of users.\n"
+ "----------------";
public static Menu getMenu() {
if(menu == null) {
menu = new UsersMenu();
}
return menu;
}
private UsersMenu() {
}
public boolean parseCommand(String command) throws ExitingException {
if(!super.parseCommand(command)) {
if(tooManyArguments(command,maxArguments)) {
System.out.println("Too many argument");
return false;
}
//PARSE UNDER CURRENT MENU
if(command.split(" ")[0].matches(commands)) {
switch(command.split(" ")[0]) {
//ALL DAO STUFF
case "display-user-list":
Application.currentSuperUser.displayAllUser();
break;
case "create-user":
Menu.navigationHistory.add(NewUserMenu.getMenu());
break;
case "delete-user":
try {
if(!deleteUser(Integer.valueOf(command.split(" ")[1]))) {
System.out.println("\nDeletion cancelled");
} else {
System.out.println("\nDeletion successful");
}
} catch(NumberFormatException e) {
System.out.println("\nInvalid value provided.");
return false;
} catch(IndexOutOfBoundsException e) {
System.out.println("\nNot enough arguments provided");
return false;
}
break;
case "access-user":
if(accessUser(Integer.valueOf(command.split(" ")[1]))) {
System.out.println("\nNavigating to user home..");
Menu.navigationHistory.add(HomeMenu.getMenu());
} else {
System.out.println("\nCouldn't access user");
}
break;
default :
System.out.println("\nSyntax error.");
return false;
}
return true;
}else {
System.out.println("\nUnknown command");
}
return false;
}
return true;
}
@Override
public String getName() {
return name;
}
public boolean accessUser(Integer userID) {
try {
Application.currentUser = Application.bankingService.getUser(userID).get();
return true;
} catch (NoSuchElementException e) {
return false;
}
}
public boolean deleteUser(Integer userID) {
SuperUser su = Application.currentSuperUser;
for(User u : su.getUsers()) {
if(u.getUserID().equals(userID)) {
if(Application.bankingService.deleteUser(userID)) {
su.getUsers().remove(u);
return true;
}else {
System.out.println("\nFailed while trying to delete user.");
return false;
}
}
}
return false;
}
@Override
public void getHelp() {
// TODO Auto-generated method stub
System.out.println(help);
}
}
|
package miniprojet2;
public abstract class OperationBinaire implements CalculMath {
public void Calcul(){} ;
}
|
package com.project.model;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
@Document(collection = "assignment")
public class Assignment {
@Id
String id;
String evaluatorName;
String evaluatorID;
String[] papersAssigned;
public Assignment(String id, String evaluatorName, String evaluatorID, String[] papersAssigned) {
super();
this.id = id;
this.evaluatorName = evaluatorName;
this.evaluatorID = evaluatorID;
this.papersAssigned = papersAssigned;
}
public Assignment() {
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getEvaluatorName() {
return evaluatorName;
}
public void setEvaluatorName(String evaluatorName) {
this.evaluatorName = evaluatorName;
}
public String getEvaluatorID() {
return evaluatorID;
}
public void setEvaluatorID(String evaluatorID) {
this.evaluatorID = evaluatorID;
}
public String[] getPapersAssigned() {
return papersAssigned;
}
public void setPapersAssigned(String[] papersAssigned) {
this.papersAssigned = papersAssigned;
}
}
|
package com.semantyca.nb.core.dataengine.jpa.model.convertor.jaxrs;
/*
import com.semantyca.nb.util.TimeUtil;
import org.apache.johnzon.mapper.Converter;
import java.time.LocalDateTime;
public class LocalDateJSONConverter implements Converter<LocalDateTime> {
@Override
public String toString(final LocalDateTime instance) {
return TimeUtil.dateTimeToStringSilently(instance);
}
@Override
public LocalDateTime fromString(final String text) {
return TimeUtil.stringToDateTime(text);
}
}*/
|
/*
* 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 tictactoe_game;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;
/**
*
* @author vongenae
*/
public class ServerThread implements Runnable {
private final BlockingQueue<Player> players;
PlayerListener endGame;
Listener listener;
public ServerThread() {
players = new LinkedBlockingQueue<>();;
endGame = new PlayerListener(players);
listener = new Listener(players);
}
public void end() {
endGame.end();
listener.end();
}
@Override
public void run() {
new Thread(endGame).start();
new Thread(listener).start();
}
}
|
#include<iostream>
using namespace std;
int main()
{
int n,sumf=0,sumb=0;
cin>>n;
int a[n][n],t[n][n];
for(int i=0;i<n;i++)
{
for(int j=0;j<n;j++)
{
cin>>a[i][j];
}
}
for(int i=0;i<n;i++)
{
for(int j=0;j<n;j++)
{
if(i==j)
{
sumf=sumf+a[i][j];
}
}
}
for(int i=0; i< n; i++)
{
sumb=sumb+a[i][n - i - 1];
}
// cout<<sumf<<" "<<sumb<<endl;
if(sumf==sumb)
cout<<"Yes";
else
cout<<"No";
//ype your code here.
} |
package exec.exceptions;
public class Exec5 {
public static void main(String a[]) {
}
}
|
package com.nsp.test;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
import org.apache.commons.lang3.StringUtils;
public class ListToArrayTest {
public static void main(String[] args) {
List<String> test = new ArrayList<String>();
test.add("1");
test.add("2");
test.add("3");
test.add("4");
test.add("3");
String[] strArray = new String[test.size()];
test.toArray(strArray);
for (String str : strArray) {
System.out.println(str);
}
System.out.println("*****************************************");
Set<String> set = new LinkedHashSet<String>(test);
for (String str : set) {
System.out.println(str);
}
System.out.println(StringUtils.join(set, ","));
System.out.println(System.currentTimeMillis());
}
}
|
package Model;
import java.util.ArrayList;
import java.util.Random;
public class Question {
//Data Members
private String m_Question;
private String m_Difficult;
private String m_CorrectAns;
private ArrayList<String> m_Answers;
//Parameterized Constructor
public Question(String i_Question,String i_Difficult,String i_CorrectAns,String i_Opt1,String i_Opt2,String i_Opt3)
{
m_Question=i_Question;
m_Difficult=i_Difficult;
m_CorrectAns=i_CorrectAns;
m_Answers = new ArrayList<String>();
addAnswersRandomaly(i_CorrectAns, i_Opt1, i_Opt2, i_Opt3);
}
private void addAnswersRandomaly(String i_CorrectAns,String i_Opt1,String i_Opt2,String i_Opt3)
{
ArrayList<String> answers = new ArrayList<String>();
Random rand = new Random();
// Obtain a number between [0 - 49].
int index;
answers.add(i_CorrectAns);
answers.add(i_Opt1);
answers.add(i_Opt2);
answers.add(i_Opt3);
while (!answers.isEmpty())
{
index = rand.nextInt(answers.size());
m_Answers.add(answers.get(index));
answers.remove(index);
}
}
public String GetQuestion()
{
return m_Question;
}
public String GetDifficult()
{
return m_Difficult;
}
public String GetCorrectAns()
{
return m_CorrectAns;
}
public ArrayList<String> GetAnswers()
{
return m_Answers;
}
}
|
package com.test.leverton.service.impl;
import com.test.leverton.model.URL;
import com.test.leverton.repository.URLShortnerRepository;
import com.test.leverton.service.URLShortnerService;
import com.test.leverton.task.URLShortnerTasks;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* Created by adarshbhattarai on 4/25/18.
*/
@Service
public class URLShortnerServiceImpl implements URLShortnerService {
@Autowired
URLShortnerRepository urlShortnerRepository;
@Override
public URL findByURL(String longUrl) {
URL url = urlShortnerRepository.findByURL(longUrl);
return url;
}
@Override
public String createShortURL(String longUrl) {
boolean isUrlValid = URLShortnerTasks.validate(longUrl);
String shortUrl = isUrlValid ? URLShortnerTasks.getShortURL(longUrl) : "Cannot Create Short Url" ;
if(isUrlValid) {
//If the given URL is valid, also add it to DB
urlShortnerRepository.add(new URL(longUrl,shortUrl));
}
return shortUrl;
}
@Override
public List<URL> getAllURL() {
return urlShortnerRepository.getAllURL();
}
@Override
public URL add(URL url) {
return urlShortnerRepository.add(url);
}
@Override
public void remove(URL url) {
urlShortnerRepository.remove(url);
}
}
|
package aima.core.logic.fol.kb;
import java.util.ArrayList;
import java.util.List;
import aima.core.logic.fol.domain.DomainFactory;
import aima.core.logic.fol.domain.FOLDomain;
import aima.core.logic.fol.inference.FOLFCAsk;
import aima.core.logic.fol.inference.FOLBCAsk;
import aima.core.logic.fol.parsing.ast.Predicate;
import aima.core.logic.fol.parsing.ast.Variable;
import aima.core.logic.fol.inference.FOLTFMResolution;
public class Test<Term> {
@org.junit.Test
public void Test() {
FOLKnowledgeBase fkb = new FOLKnowledgeBase(DomainFactory.studentDomain(), new FOLFCAsk());
List<Term> terms = new ArrayList<Term>();
terms.add((Term) new Variable("x"));
terms.add((Term) new Variable ("y"));
Predicate pFC = new Predicate("give course",(List<aima.core.logic.fol.parsing.ast.Term>) terms);
fkb.ask(pFC);
FOLKnowledgeBase fkb2 = new FOLKnowledgeBase(DomainFactory.studentDomain(), new FOLBCAsk());
List<Term> terms2 = new ArrayList<Term>();
terms2.add((Term) new Variable("x"));
terms2.add((Term) new Variable ("y"));
Predicate pBC = new Predicate("give course",(List<aima.core.logic.fol.parsing.ast.Term>) terms2);
fkb.ask(pBC);
}
}
|
package shared;
import java.io.*;
/** The Error class handles runtime error reporting. This class is not meant to be
* instantiated and the functions in this class are all static.
* @author James Louis 5/24/2001 Java Implementation.
* 1/04/2002 Created err/out stream option.
*/
public class Error {
/* private static PrintStream output_stream;
Waiting on GetEnv.getenv(String) to be finished. -JL
static{
GetEnv getenv = new GetEnv();
String stream_option = getenv.getenv("MLJ_ERRORSTREAM");
if(stream_option.equalsIgnoreCase("ERR")) output_stream = System.err;
else output_stream = System.out;
}
*/
/** Constructor. This removes the possibility of instatiating this class with
* a base constructor.
*/
private Error(){}
/** Displays an error message.
* @param errMessage The message to be displayed.
*/
public static void err(String errMessage) {
System.out.println("Error-->"+errMessage);
}
/** Displays a fatal error message.
* @param errMessage The message to be displayed.
*/
public static void fatalErr(String errMessage) {
System.out.println("Error-->"+errMessage+"-->fatal_error");
}
// Description : Report a parse error in an input file, including the line
// number and character position of the error.
// Comments :
/** Displays a parse error message.
* @param input Information about where in the files the error occured.
* @param errorMsg The message to be displayed.
*/
public static void parse_error(BufferedReader input, String errorMsg) {
System.out.println("Parse Error-->"+errorMsg+"-->fatal_error");
//System.out.prinln("Parse error in " << input.getClass() << " at line "
//<< input.line_count()
//<< " and character " << input.pos_in_line() << ":" << endl <<
//errorMsg << fatal_error;
}
/** Displays a parse error message.
* @param input Information about where in the files the error occured.
* @param errorMsg The message to be displayed.
*/
public static void parse_error(StreamTokenizer input, String errorMsg) {
System.out.println("Parse Error-->"+errorMsg+"-->fatal_error");
//System.out.prinln("Parse error in " << input.getClass() << " at line "
//<< input.line_count()
//<< " and character " << input.pos_in_line() << ":" << endl <<
//errorMsg << fatal_error;
}
}
|
package L2.task1;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
public class Main {
public static void main(String[] args) {
//пример работы:
ArrayList<Integer> list = new ArrayList<Integer>();
Integer[] testArray = new Integer[]{22,33,44,55};
list.addAll(Arrays.asList(testArray));
ArrayList<Integer> arrList = initListRepository(new ArrayList());
ArrayList<Integer> compareList = UniqueUtils.getUniqElements(arrList, list);
System.out.println(compareList);
HashSet<Integer> hashSet = initSetRepository(new HashSet());
HashSet<Integer> compareSet = UniqueUtils.getUniqElements(hashSet, list);
System.out.println(compareSet);
}
//пример наполнения.
private static ArrayList<Integer> initListRepository(ArrayList arrayListRepository) {
if (arrayListRepository == null) {
arrayListRepository = new ArrayList();
}
Integer[] testArray = new Integer[]{1, 5, 3, 4, 5, 6, 25, 2, 8};
arrayListRepository.addAll(Arrays.asList(testArray));
return arrayListRepository;
}
private static HashSet<Integer> initSetRepository(HashSet hashSetRepository) {
if (hashSetRepository == null) {
hashSetRepository = new HashSet();
}
Integer[] testArray = new Integer[]{61, 71, 81, 91, 51, 162, 311, 101, 181};
hashSetRepository.addAll(Arrays.asList(testArray));
return hashSetRepository;
}
} |
package net.sourceforge.vrapper.utils;
/**
* Information about a line in a text.
*
* @author Matthias Radig
*/
public class LineInformation {
private final int number;
private final int beginOffset;
private final int length;
public LineInformation(int number, int beginOffset, int length) {
super();
this.number = number;
this.beginOffset = beginOffset;
this.length = length;
}
/**
* Returns the line absolute number.
*
* Starting at 0
*
* @return the line number
*/
public int getNumber() {
return number;
}
public int getBeginOffset() {
return beginOffset;
}
public int getLength() {
return length;
}
public int getEndOffset() {
return beginOffset+length;
}
}
|
package com.ibeiliao.pay.impl.thirdpay.jhj;
/**
* 功能:描述金惠家的单条交易记录
* 详细:
*
* @author linyi 2016/8/24
*/
public class TradeInfo {
/**
* 金额,单位:分
*/
private long amount;
/**
* 订单ID,实际上是支付平台传给金惠家的 orderNo
*/
private String orderId;
/**
* 商户号
*/
private String merchantId;
/**
* 支付状态
*/
private int status;
public long getAmount() {
return amount;
}
public void setAmount(long amount) {
this.amount = amount;
}
public String getOrderId() {
return orderId;
}
public void setOrderId(String orderId) {
this.orderId = orderId;
}
public String getMerchantId() {
return merchantId;
}
public void setMerchantId(String merchantId) {
this.merchantId = merchantId;
}
public int getStatus() {
return status;
}
public void setStatus(int status) {
this.status = status;
}
}
|
package com.ssm.lab.dao;
import com.ssm.lab.bean.WorkRecord;
import com.ssm.lab.bean.WorkRecordExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface WorkRecordMapper {
long countByExample(WorkRecordExample example);
int deleteByExample(WorkRecordExample example);
int deleteByPrimaryKey(Integer id);
int insert(WorkRecord record);
int insertSelective(WorkRecord record);
List<WorkRecord> selectByExample(WorkRecordExample example);
WorkRecord selectByPrimaryKey(Integer id);
int updateByExampleSelective(@Param("record") WorkRecord record, @Param("example") WorkRecordExample example);
int updateByExample(@Param("record") WorkRecord record, @Param("example") WorkRecordExample example);
int updateByPrimaryKeySelective(WorkRecord record);
int updateByPrimaryKey(WorkRecord record);
List<WorkRecord> selectByType(@Param("startTime")String startTime, @Param("endTime")String endTime, @Param("type")String type, @Param("keywords")String keywords);
} |
/**
* Service layer beans.
*/
package com.staj.proje.service;
|
package iarfmoose;
public enum ProductionType {
UNKNOWN, TRAIN, TRAIN_FROM_LARVA, BUILD, RESEARCH, MORPH
}
|
package com.github.stathvaille.marketimports.items.staticdataexport;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class Item {
private long typeId;
private int graphicID;
private long groupID;
private LocalisedString description;
private LocalisedString name;
private double volume;
@Override
public String toString(){
return name.getEn();
}
}
|
package edu.pdx.cs410J.hueb;
import android.content.Intent;
import android.os.Bundle;
import com.google.android.material.snackbar.Snackbar;
import androidx.appcompat.app.AppCompatActivity;
import android.view.View;
import androidx.navigation.NavController;
import androidx.navigation.Navigation;
import androidx.navigation.ui.AppBarConfiguration;
import androidx.navigation.ui.NavigationUI;
import edu.pdx.cs410J.hueb.databinding.ActivityMainBinding;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.Button;
import android.widget.Toast;
public class MainActivity extends AppCompatActivity {
private ActivityMainBinding binding;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
binding = ActivityMainBinding.inflate(getLayoutInflater());
setContentView(binding.getRoot());
setSupportActionBar(binding.toolbar);
// binding.fab.setOnClickListener(new View.OnClickListener() {
// @Override
// public void onClick(View view) {
// Appointment appointment = new Appointment("this is a desc", "12/11/1985 5:30 pm", "12/11/1985 6:30 pm");
// Snackbar.make(view, appointment.toString(), Snackbar.LENGTH_LONG)
// .setAction("Action", null).show();
// }
// });
Button addAppt = findViewById(R.id.addApptButtonMain);
addAppt.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
// Toast.makeText(MainActivity.this, "Adding Appt!", Toast.LENGTH_LONG).show();
Intent intent = new Intent(MainActivity.this, AddApptActivity.class);
startActivity(intent);
}
});
Button searchAppts = findViewById(R.id.searchApptsButtonMain);
searchAppts.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
// Toast.makeText(MainActivity.this, "Searching Appt!", Toast.LENGTH_LONG).show();
Intent intent = new Intent(MainActivity.this, SearchApptsActivity.class);
startActivity(intent);
}
});
Button viewAllAppts = findViewById(R.id.viewAllApptsButtonMain);
viewAllAppts.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
// Toast.makeText(MainActivity.this, "View Appt!", Toast.LENGTH_LONG).show();
Intent intent = new Intent(MainActivity.this, ListAllApptsActivity.class);
startActivity(intent);
}
});
Button help = findViewById(R.id.helpButton);
help.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
// Toast.makeText(MainActivity.this, "View Appt!", Toast.LENGTH_LONG).show();
Intent intent = new Intent(MainActivity.this, HelpActivity.class);
startActivity(intent);
}
});
}
// @Override
// public boolean onCreateOptionsMenu(Menu menu) {
// // Inflate the menu; this adds items to the action bar if it is present.
// getMenuInflater().inflate(R.menu.menu_main, menu);
// return true;
// }
//
// @Override
// public boolean onOptionsItemSelected(MenuItem item) {
// // Handle action bar item clicks here. The action bar will
// // automatically handle clicks on the Home/Up button, so long
// // as you specify a parent activity in AndroidManifest.xml.
// int id = item.getItemId();
//
// //noinspection SimplifiableIfStatement
// if (id == R.id.action_settings) {
// return true;
// }
//
// return super.onOptionsItemSelected(item);
// }
} |
package application;
import java.awt.event.KeyEvent;
import java.util.Calendar;
public class ChatingBot {
String init;
String[] wordArray;
Calendar cal = Calendar.getInstance();
int year = cal.get(Calendar.YEAR);
int mon = cal.get(Calendar.MONTH);
int day = cal.get(Calendar.DAY_OF_MONTH);
int hour = cal.get(Calendar.HOUR_OF_DAY);
int min = cal.get(Calendar.MINUTE);
int sec = cal.get(Calendar.SECOND);
String to_date = year + "년 "+ mon+"월 "+day+"일";
String to_time = hour + "시 "+ min+"분 "+sec+"초";
String[][] chatBot = {
//standard greetings
{"@안녕", "@안녕하세요", "@ㅎㅇ", "@하이"},
{"@안녕하세요","@반갑습니다"},
//question greetings
{"@이름", "@이름이 뭐야?","@너 이름이 뭐야?","@누구니?"},
{"@저는 안녕Bot입니다"},
//
{"@도움말"},
{"@챗봇을 사용하기 위해서는 @를 붙여주세요 \n ---> ex) @카테고리"},
//yes
{"@카테고리"},
{"@인사, @이름, @날짜, @시간, @도움말"},
//날짜
{"@날짜"},
{'@' + to_date},
//시간
{"@시간"},
{'@'+ to_time},
//default
{"문장앞에 @를 붙여주세요", "챗봇중지", "@카테고리 라고 쳐보세요"}
};
public boolean inArray(String in, String[] str) {
boolean match = false;
for(int i=0; i < str.length; i++) {
if(str[i].equals(in)) {
match=true;
}
}
return match;
}
public String setting(String str) {
boolean settingSwitch = false;
String name = "안녕Bot";
String bot_msg = null;
init = str;
init = init.trim();
wordArray = init.split(": ", 2);
String sp1_msg, sp2_msg;
sp1_msg = wordArray[0];
sp2_msg = wordArray[1];
System.out.println(sp1_msg);
System.out.println(sp2_msg);
if(sp2_msg.charAt(0) == '@') {
while( sp2_msg.charAt(sp2_msg.length() -1 ) == '!' ||
sp2_msg.charAt(sp2_msg.length() -1 ) == '.' ||
sp2_msg.charAt(sp2_msg.length() -1 ) == '?')
{
sp2_msg = sp2_msg.substring(0, sp2_msg.length()-1);
}
byte response = 0;
//string배열이랑 매칭
int j=0;
while(response == 0) {
if(inArray(sp2_msg.toLowerCase(), chatBot[j*2])) {
response = 2;
int a = (int) Math.floor(Math.random() * chatBot[(j*2)+1].length);
System.out.println("--> " + name + "\t" + chatBot[(j*2)+1][a]);
bot_msg = "----> " + name + ": " + chatBot[(j*2)+1][a] +'\n';
}
j++;
if(j*2 == chatBot.length-1 && response == 0) {
response = 1;
}
}
if(response == 1) {
int r = (int) Math.floor(Math.random() * chatBot[chatBot.length - 1].length);
System.out.println("--> " + name + "\t" + chatBot[chatBot.length-1][r]);
bot_msg = "----> " + name + ": " + chatBot[chatBot.length-1][r] +'\n';
}
settingSwitch = true;
}
if(settingSwitch == true) {
init = bot_msg;
System.out.println(init);
}
System.out.println(init);
return init;
}
} |
package eiti.sag.facebookcrawler.repository.json;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import eiti.sag.facebookcrawler.model.FacebookUser;
import eiti.sag.facebookcrawler.repository.FacebookUserRepository;
import java.io.*;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import static java.util.Collections.emptyList;
public class JsonFacebookUserRepository implements FacebookUserRepository {
private final File directory;
private final Charset charset;
private final Gson gson = new GsonBuilder()
.setPrettyPrinting()
.serializeNulls()
.create();
public JsonFacebookUserRepository(File directory) {
this(directory, StandardCharsets.UTF_8);
}
public JsonFacebookUserRepository(File directory, Charset charset) {
this.directory = directory;
directory.mkdirs();
this.charset = charset;
}
@Override
public void save(FacebookUser user) {
File file = fileFor(user.getUsername());
try (Writer pw = newWriter(file, charset)) {
pw.write(gson.toJson(user));
pw.flush();
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}
private Writer newWriter(File file, Charset charset) throws IOException {
return new PrintWriter(new OutputStreamWriter(new FileOutputStream(file), charset));
}
@Override
public boolean contains(String username) {
return fileFor(username).exists();
}
@Override
public FacebookUser find(String username) {
return readUser(fileFor(username));
}
@Override
public Collection<FacebookUser> findAll() {
File[] files = directory.listFiles();
if(files == null)
return emptyList();
return readUsers(files);
}
private Collection<FacebookUser> readUsers(File[] files) {
List<FacebookUser> users = new ArrayList<>();
for (File file : files)
users.add(readUser(file));
return users;
}
private FacebookUser readUser(File file) {
try {
Reader reader = newReader(file, charset);
return gson.fromJson(reader, FacebookUser.class);
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}
private File fileFor(String username) {
return new File(directory, username + ".json");
}
private Reader newReader(File file, Charset charset) throws IOException {
return new BufferedReader(new InputStreamReader(new FileInputStream(file), charset));
}
}
|
package com.hendisantika.springboothibernate.controller;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.hendisantika.springboothibernate.entity.Student;
import com.hendisantika.springboothibernate.entity.University;
import com.hendisantika.springboothibernate.repository.StudentRepository;
import com.hendisantika.springboothibernate.repository.UniversityRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
import reactor.core.scheduler.Schedulers;
import java.util.List;
/**
* Created by IntelliJ IDEA.
* Project : spring-boot-hibernate
* User: hendisantika
* Email: hendisantika@gmail.com
* Telegram : @hendisantika34
* Date: 2019-01-11
* Time: 05:44
* To change this template use File | Settings | File Templates.
*/
@RestController
public class IndexController {
@Autowired
private StudentRepository studentRepository;
@Autowired
private UniversityRepository universityRepository;
@Autowired
private ObjectMapper objectMapper;
@Transactional
@GetMapping(value = "/students")
public Flux<Student> getStudents() {
return Flux.defer(() -> {
List<Student> all = studentRepository.findAll();
return Flux.fromIterable(all);
}).subscribeOn(Schedulers.elastic());
}
@Transactional
@GetMapping(value = "/universities")
public Flux<University> getUniversities() {
List<University> all = universityRepository.findAll();
return Flux.defer(() -> Flux.fromIterable(all))
.subscribeOn(Schedulers.elastic());
}
@Transactional
@PostMapping(value = "/universities")
public Mono<ServerResponse> saveUniversity(Mono<University> universityMono) {
return universityMono
.publishOn(Schedulers.parallel())
.doOnNext(universityRepository::save)
.flatMap(a -> ServerResponse.ok().build());
}
@PostMapping(value = "/universities/{id}/student")
public Mono<ServerResponse> saveStudent(@PathVariable Long id, @RequestBody Mono<Student> studentMono) {
return studentMono
.publishOn(Schedulers.parallel())
.doOnNext(student -> {
University one = universityRepository.getOne(id);
student.setUniversity(one);
studentRepository.save(student);
})
.flatMap(a -> ServerResponse.ok().build());
}
}
|
package org.dmonix.io;
import java.io.File;
import org.dmonix.AbstractTestCase;
import org.junit.After;
/**
* Test the class <code>StackTraceLogger</code>
*
* @author Peter Nerg
*/
public class TestStackTraceLogger extends AbstractTestCase {
private File file = new File("TestStackTraceLogger.log");
@After
protected void tearDown() throws Exception {
IOUtil.deleteFile(file);
}
/**
* Test the method <code>getInstance</code>.
*
* @throws Exception
*/
public void testGetInstance() throws Exception {
StackTraceLogger stackTraceLogger = StackTraceLogger.newInstance(file);
assertNotNull(stackTraceLogger);
assertEquals(stackTraceLogger, StackTraceLogger.getInstance());
stackTraceLogger.destroy();
}
/**
* Test the method <code>getOutputStream</code>.
*
* @throws Exception
*/
public void testGetOutputStream() throws Exception {
StackTraceLogger stackTraceLogger = StackTraceLogger.newInstance(file);
assertNotNull(stackTraceLogger);
assertNotNull(stackTraceLogger.getOutputStream());
stackTraceLogger.destroy();
}
/**
* Test the method <code>destroy</code>.
*
* @throws Exception
*/
public void testDestroy() throws Exception {
StackTraceLogger stackTraceLogger = StackTraceLogger.newInstance(file);
assertNotNull(stackTraceLogger);
stackTraceLogger.destroy();
try {
StackTraceLogger.getInstance();
} catch (Exception e) {
super.setExceptionCaught();
}
assertExceptionCaught();
}
}
|
package com.hcp.objective.web.model.request;
import java.io.Serializable;
import org.hibernate.validator.constraints.NotBlank;
/**
* The BatchJobMergeRequest is a request object which used to store batch job
* data before the data merged into a {@link}BatchJob object
*
* @author Zero Yu
*/
public class BatchJobMergeRequest implements Serializable {
/**
* Generated serial version uid
*/
private static final long serialVersionUID = -8937869606246065718L;
@NotBlank
private Long id;
@NotBlank
private String name;
@NotBlank
private String type;
@NotBlank
private Double interval;
private String info;
@NotBlank
private Boolean status;
@NotBlank
private String owner;
public BatchJobMergeRequest() {
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public Double getInterval() {
return interval;
}
public void setInterval(Double interval) {
this.interval = interval;
}
public String getInfo() {
return info;
}
public void setInfo(String info) {
this.info = info;
}
public Boolean getStatus() {
return status;
}
public void setStatus(Boolean status) {
this.status = status;
}
public String getOwner() {
return owner;
}
public void setOwner(String owner) {
this.owner = owner;
}
}
|
package exer1;
import org.junit.Test;
public class IntegerTest2 {
@Test
public void test(){
Double num1 = 3.14;
Double num2 = 3.14;
System.out.println(num1 == num2);//false
double num3 = 3.14;
double num4 = 3.14;
System.out.println(num3 == num4);//true
}
}
|
package com.seemoreinteractive.seemoreinteractive.library;
import java.util.ArrayList;
import java.util.List;
import org.apache.http.NameValuePair;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.Color;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import com.androidquery.AQuery;
import com.androidquery.callback.AjaxCallback;
import com.androidquery.callback.AjaxStatus;
import com.androidquery.util.XmlDom;
import com.seemoreinteractive.seemoreinteractive.R;
import com.seemoreinteractive.seemoreinteractive.WishListPage;
import com.seemoreinteractive.seemoreinteractive.Model.JSONParser;
import com.seemoreinteractive.seemoreinteractive.Utils.Constants;
import com.seemoreinteractive.seemoreinteractive.helper.Common;
public class WishListAdapter extends BaseAdapter {
private Activity mContext;
private List<String> plotsText;
private LayoutInflater mInflater;
JSONParser getWishListArray;
List<NameValuePair> userParams = null;
String id,wishlistname;
AQuery aq;
// Constructor
public WishListAdapter(Activity c, ArrayList<String> dataList, String id, String wishlistname){
mContext = c;
plotsText =dataList;
this.wishlistname= wishlistname;
this.id=id;
mInflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
}
@Override
public int getCount() {
return plotsText.size();
}
@Override
public Object getItem(int position) {
return position;
}
@Override
public long getItemId(int position) {
return 0;
}
@Override
public View getView(final int position, View convertView, ViewGroup parent) {
ViewListHolder holder;
if (convertView == null) {
holder = new ViewListHolder();
convertView = mInflater.inflate(
R.layout.listview_wishlist_layout, null);
}
else {
holder = (ViewListHolder) convertView.getTag();
}
holder.imageview = (ImageView) convertView.findViewById(R.id.imgarrow);
holder.imgDeleteIcon = (ImageView) convertView.findViewById(R.id.imgDeleteIcon);
holder.txtView = (TextView)convertView.findViewById(R.id.txtWishListName);
holder.txtView.setText(plotsText.get(position));
convertView.setTag(holder);
if(this.wishlistname.equals(plotsText.get(position))){
holder.imageview.setVisibility(View.VISIBLE);
holder.txtView.setTextColor(Color.GREEN);
}else{
holder.imageview.setVisibility(View.INVISIBLE);
holder.txtView.setTextColor(Color.WHITE);
}
holder.imgDeleteIcon.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
//Toast.makeText(mContext, "delelte"+position, Toast.LENGTH_LONG).show();
if(Common.isNetworkAvailable(mContext)){
AlertDialog.Builder alertDialog = new AlertDialog.Builder(mContext);
// Setting Dialog Title
alertDialog.setTitle("Confirm Delete...");
// Setting Dialog Message
alertDialog.setMessage("Are you sure you want delete this?");
// Setting Icon to Dialog
// alertDialog.setIcon(R.drawable.delete);
// Setting Positive "Yes" Button
alertDialog.setPositiveButton("YES", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog,int which) {
// Write your code here to invoke YES event
aq = new AQuery(mContext);
aq.ajax(Constants.DeleteWishList_Url+id+"/"+plotsText.get(position)+"/", XmlDom.class, new AjaxCallback<XmlDom>(){
@Override
public void callback(String url, XmlDom xml, AjaxStatus status) {
try{
//Log.i("XmlDom", ""+xml);
if(xml!=null){
if(xml.text("msg").equals("success")){
//Toast.makeText(mContext, "Wish list deleted successfully.", Toast.LENGTH_LONG).show();
Intent intent = new Intent(mContext, WishListPage.class);
// intent.putExtra("wishListName","My Offers" );
// mContext.setResult(1,intent);
mContext.startActivity(intent);
mContext.finish();
} else {
Toast.makeText(mContext, "Delete failed. Please try again!", Toast.LENGTH_LONG).show();
mContext.finish();
}
}
} catch(Exception e){
e.printStackTrace();
}
}
});
}
});
// Setting Negative "NO" Button
alertDialog.setNegativeButton("NO", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
// Write your code here to invoke NO event
dialog.cancel();
}
});
// Showing Alert Message
alertDialog.show();
}
}
});
//holder.check.setId(position);
//holder.imageview.setId(position);
return convertView;
}
}
class ViewListHolder {
public ImageView imgDeleteIcon;
public TextView txtView;
ImageView imageview;
int id;
} |
package com.timmy.highUI.collapsingToolbarLayout;
import android.os.Bundle;
import android.support.design.widget.AppBarLayout;
import android.support.design.widget.CollapsingToolbarLayout;
import android.support.design.widget.CoordinatorLayout;
import android.support.design.widget.TabLayout;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;
import android.support.v4.view.ViewPager;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.LinearLayout;
import com.timmy.R;
import com.timmy.base.BaseActivity;
import com.timmy.home.MainPageFragment;
import butterknife.ButterKnife;
public class CollapsingToolbarLayoutActivity extends BaseActivity {
// @Bind(R.id.tl_tab)
// TabLayout tl_tab;
// @Bind(R.id.vp_viewPage)
// ViewPager vp_viewPager;
// @Bind(R.id.toolbar)
// Toolbar toolbar;
//// @Bind(R.id.collapsing_toolbar_layout)
//// CollapsingToolbarLayout collapsingToolbarLayout;
// @Bind(R.id.appbar_layout)
// AppBarLayout appBarLayout;
private LinearLayout head_layout;
private TabLayout toolbar_tab;
private ViewPager main_vp_container;
private CollapsingToolbarLayout mCollapsingToolbarLayout;
private CoordinatorLayout root_layout;
private TabPagerAdapter adapter;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_collapsing_toolbar_layout);
ButterKnife.bind(this);
// initView();
AppBarLayout app_bar_layout = (AppBarLayout) findViewById(R.id.app_bar_layout);
Toolbar mToolbar = (Toolbar) findViewById(R.id.toolbar);
mToolbar.setNavigationIcon(R.mipmap.ic_action_back);
setSupportActionBar(mToolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
mToolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
onBackPressed();
}
});
head_layout = (LinearLayout) findViewById(R.id.head_layout);
root_layout = (CoordinatorLayout) findViewById(R.id.root_layout);
//使用CollapsingToolbarLayout必须把title设置到CollapsingToolbarLayout上,设置到Toolbar上则不会显示
mCollapsingToolbarLayout = (CollapsingToolbarLayout) findViewById(R.id
.collapsing_toolbar_layout);
app_bar_layout.addOnOffsetChangedListener(new AppBarLayout.OnOffsetChangedListener() {
@Override
public void onOffsetChanged(AppBarLayout appBarLayout, int verticalOffset) {
if (verticalOffset <= -head_layout.getHeight() / 2) {
mCollapsingToolbarLayout.setTitle("涩郎");
} else {
mCollapsingToolbarLayout.setTitle(" ");
}
}
});
toolbar_tab = (TabLayout) findViewById(R.id.toolbar_tab);
main_vp_container = (ViewPager) findViewById(R.id.main_vp_container);
adapter = new TabPagerAdapter(getSupportFragmentManager());
main_vp_container.setAdapter(adapter);
main_vp_container.addOnPageChangeListener(new TabLayout.TabLayoutOnPageChangeListener
(toolbar_tab));
toolbar_tab.addOnTabSelectedListener(new TabLayout.ViewPagerOnTabSelectedListener
(main_vp_container));
//tablayout和viewpager建立联系为什么不用下面这个方法呢?自己去研究一下,可能收获更多
//toolbar_tab.setupWithViewPager(main_vp_container);
}
@Override
protected void onDestroy() {
super.onDestroy();
}
/**
* 初始化TabLayout数据
*/
// private void initView() {
// setSupportActionBar(toolbar);
// getSupportActionBar().setDisplayHomeAsUpEnabled(true);
//// collapsingToolbarLayout.setTitle("lsajdlakjf");
//
// adapter = new TabPagerAdapter(getSupportFragmentManager());
// vp_viewPager.setAdapter(adapter);
//// tl_tab.setupWithViewPager(vp_viewPager);
// vp_viewPager.addOnPageChangeListener(new TabLayout.TabLayoutOnPageChangeListener(tl_tab));
// tl_tab.addOnTabSelectedListener(new TabLayout.ViewPagerOnTabSelectedListener(vp_viewPager));
// }
class TabPagerAdapter extends FragmentStatePagerAdapter {
private String tabTitles[] = new String[]{"高级ui","源码", "框架"};
public TabPagerAdapter(FragmentManager fm) {
super(fm);
}
@Override
public Fragment getItem(int position) {
return MainPageFragment.newInstance(position + 1);
}
@Override
public int getCount() {
return tabTitles.length;
}
@Override
public CharSequence getPageTitle(int position) {
return tabTitles[position];
}
}
}
|
package com.comp486.knightsrush;
public class RewardConstants {
public static final int R_TYPE_HEALTH = 0;
public static final int R_TYPE_STRENGTH = 1;
public static final int R_TYPE_VITALITY = 2;
public static final int R_TYPE_DEXTERITY = 3;
public static final int R_TYPE_LIFE_LEECH = 4;
public static final int R_BASE = 0;
public static final int R_PERCENT = 1;
}
|
package com.tencent.mm.plugin.offline.ui;
import com.tencent.mm.ui.u;
class OfflineAlertView$6 extends u {
final /* synthetic */ Runnable lKW;
final /* synthetic */ OfflineAlertView lKX;
OfflineAlertView$6(OfflineAlertView offlineAlertView, Runnable runnable) {
this.lKX = offlineAlertView;
this.lKW = runnable;
}
public final void aBU() {
this.lKW.run();
}
}
|
package com.podarbetweenus.BetweenUsConstant;
import android.app.AlertDialog;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.SharedPreferences;
import android.net.ConnectivityManager;
import android.preference.PreferenceManager;
import android.util.Log;
/**
* Created by Administrator on 10/16/2015.
*/
public class Constant {
public static AlertDialog.Builder popupDialog = null;
public static SharedPreferences resultpreLoginData;
// Amazon WS
public static final String Common_URL = "http://www.betweenus.in/PODARAPP/PodarApp.svc/";
public static String emial_Id = "Enter Email Id";
public static String mobile_Number = "Enter Mobile Number";
public static String version_update = "true";
public static boolean checkInternetConnection(Context _activity)
{
ConnectivityManager conMgr = (ConnectivityManager) _activity.getSystemService(Context.CONNECTIVITY_SERVICE);
if (conMgr.getActiveNetworkInfo() != null
&& conMgr.getActiveNetworkInfo().isAvailable())
return true;
else
return false;
}
public static void showOkPopup(Context context, String error_msg,
DialogInterface.OnClickListener listener) {
popupDialog = new AlertDialog.Builder(context);
popupDialog.setCancelable(false);
popupDialog.setPositiveButton("Ok", listener);
popupDialog.setMessage(error_msg);
popupDialog.show();
}
public static void RemoveData(Context context)
{
resultpreLoginData =PreferenceManager.getDefaultSharedPreferences(context);
resultpreLoginData.edit().clear().commit();
}
public static ProgressDialog getProgressDialog(Context context) {
ProgressDialog progress_dialog1 = new ProgressDialog(context);
progress_dialog1.setMessage("Loading ... ");
progress_dialog1.setCancelable(true);
return progress_dialog1;
}
public static void SetLoginData(String Username,String password,Context context)
{
resultpreLoginData = PreferenceManager.getDefaultSharedPreferences(context);
SharedPreferences.Editor editor = resultpreLoginData.edit();
editor.putString("Username", Username);
editor.putString("Password", password);
editor.commit();
}
public static void setDrawerData(String academicYear,String childName,String standard,String rollNo,Context context)
{
resultpreLoginData = PreferenceManager.getDefaultSharedPreferences(context);
SharedPreferences.Editor editor = resultpreLoginData.edit();
editor.putString("AcademicYear", academicYear);
editor.putString("ChildName", childName);
editor.putString("Standard", standard);
editor.putString("RollNo", rollNo);
editor.commit();
}
public static void setTeacherDrawerData(String academicYear,String name,String teacher_div,String teacher_std,String teacher_shift,Context context){
resultpreLoginData = PreferenceManager.getDefaultSharedPreferences(context);
SharedPreferences.Editor editor = resultpreLoginData.edit();
editor.putString("AcademcYear",academicYear);
editor.putString("Name",name);
editor.putString("Teacher_div",teacher_div);
editor.putString("Teacher_std",teacher_std);
editor.putString("Teacher_shift",teacher_shift);
editor.commit();
}
public static void setAdminDrawerData(String academicYear,String name,Context context){
resultpreLoginData = PreferenceManager.getDefaultSharedPreferences(context);
SharedPreferences.Editor editor = resultpreLoginData.edit();
editor.putString("AcademcYear",academicYear);
editor.putString("Name",name);
editor.commit();
}
public static String GetLoginusername(Context context)
{
resultpreLoginData = PreferenceManager.getDefaultSharedPreferences(context);
Log.e("LoginActivity", resultpreLoginData.getString("Username", ""));
return resultpreLoginData.getString("Username", "");
}
public static String GetLoginPassword(Context context)
{
resultpreLoginData = PreferenceManager.getDefaultSharedPreferences(context);
Log.e("LoginActivity", resultpreLoginData.getString("Password", ""));
return resultpreLoginData.getString("Password", "");
}
public static String GetRollNo(Context context)
{
resultpreLoginData = PreferenceManager.getDefaultSharedPreferences(context);
Log.e("ProfileActivity", resultpreLoginData.getString("RollNo", ""));
return resultpreLoginData.getString("RollNo", "");
}
public static String GetStandard(Context context)
{
resultpreLoginData = PreferenceManager.getDefaultSharedPreferences(context);
Log.e("ProfileActivity", resultpreLoginData.getString("Standard", ""));
return resultpreLoginData.getString("Standard", "");
}
public static String GetChildName(Context context)
{
resultpreLoginData = PreferenceManager.getDefaultSharedPreferences(context);
Log.e("ProfileActivity", resultpreLoginData.getString("ChildName", ""));
return resultpreLoginData.getString("ChildName", "");
}
public static String GetAcademicYear(Context context)
{
resultpreLoginData = PreferenceManager.getDefaultSharedPreferences(context);
Log.e("ProfileActivity", resultpreLoginData.getString("AcademicYear", ""));
return resultpreLoginData.getString("AcademicYear", "");
}
public static void SetAuthToken(String AuthToken,Context mcontext) {
SharedPreferences resultpre_patient = PreferenceManager
.getDefaultSharedPreferences(mcontext);
SharedPreferences.Editor editor = resultpre_patient.edit();
editor.putString("AuthToken", AuthToken);
editor.commit();
}
public static String GetResult_AuthToken(Context mcontext) {
SharedPreferences resultpre_patient = PreferenceManager
.getDefaultSharedPreferences(mcontext);
return resultpre_patient.getString("AuthToken", "");
}
}
|
package it.unica.pr2.abitazioni;
import it.unica.pr2.abitazioni.*;
import java.util.Collections;
import java.util.List;
public class Bagno extends Ambiente {
public Bagno(Integer metri){
super(metri);
}
}
|
package com.enn.springboot.producer;
import com.enn.springboot.entity.Order;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.messaging.Message;
import org.springframework.messaging.MessageHeaders;
import org.springframework.messaging.support.MessageBuilder;
import org.springframework.stereotype.Component;
import java.util.Map;
@Component
public class RabbitSender {
@Autowired
private RabbitTemplate rabbitTemplate;
final RabbitTemplate.ConfirmCallback confirmCallback = (correlationData, ack, cause) -> {
System.err.println("correlationData: " + correlationData);
System.err.println("ack: " + ack);
if (!ack) {
System.err.println("异常处理...");
}
};
final RabbitTemplate.ReturnCallback returnCallback = (message, replyCode, replyText, exchange, routingKey) -> System.err.println("return exchange: " + exchange + ", routingKey: " + routingKey);
public void send(Object message, Map<String, Object> properties) {
MessageHeaders mhs = new MessageHeaders(properties);
Message msg = MessageBuilder.createMessage(message, mhs);
rabbitTemplate.setConfirmCallback(confirmCallback);
rabbitTemplate.setReturnCallback(returnCallback);
rabbitTemplate.convertAndSend("exchange_1", "springboot.world", msg);
}
public void sendOrder(Order order) {
rabbitTemplate.setConfirmCallback(confirmCallback);
rabbitTemplate.setReturnCallback(returnCallback);
rabbitTemplate.convertAndSend("exchange_2", "springboot.world", order);
}
}
|
package com.test.demo;
import org.springframework.data.repository.CrudRepository;
public interface StudentDao extends CrudRepository<Student, Long> {
}
|
/**
* 530. Minimum Absolute Difference in BST
* Easy
* This question is the same as 783
* 递归中序遍历二叉搜索树得有序序列
*/
public class Solution {
private int pre;
private int min;
private void inOrder(TreeNode node) {
if(node.left != null)
inOrder(node.left);
if (pre == -1) {
pre = node.val;
} else {
min = Math.min(Math.abs(node.val - pre), min);
pre = node.val;
}
if(node.right != null)
inOrder(node.right);
}
public int getMinimumDifference(TreeNode root) {
min = Integer.MAX_VALUE;
pre = -1;
inOrder(root);
return min;
}
}
|
/*
* (c) Copyright 2018 Yiwei Gao. All rights reserved.
*
* 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.dyson;
import com.dyson.resources.PersonService;
import io.dropwizard.Application;
import io.dropwizard.setup.Environment;
public final class Dyson extends Application<DysonConfig> {
public static void main(String[] args) throws Exception {
new Dyson().run(args);
}
@Override
public void run(DysonConfig config, Environment env) {
final PersonService personService = new PersonService();
env.jersey().register(personService);
final DysonCheck healthCheck = new DysonCheck(config.getVersion());
env.healthChecks().register("template", healthCheck);
env.jersey().register(healthCheck);
}
}
|
package com.sm.anapp;
import android.app.Activity;
import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.Spinner;
public class SpinnerTest extends Activity {
/*
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<Spinner android:id="@+id/spinner"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:drawSelectorOnTop="true"
android:prompt="@string/item_prompt"
/>
</LinearLayout>
public static final CharSequence[] DAYS_OPTIONS = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"};
ArrayAdapter<String> adapter = new ArrayAdapter<String> (this, android.R.layout.simple_spinner_item, DAYS_OPTIONS);
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
spinner.setAdapter(adapter);
*/
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
//super.onCreate(savedInstanceState);
//setContentView(R.layout.main);
//Spinner s = (Spinner) findViewById(R.id.spinner);
//Prepar adapter
//HERE YOU CAN ADD ITEMS WHICH COMES FROM SERVER.
//final MyData items[] = new MyData[3];
//items[0] = new MyData("key1", "value1");
//items[1] = new MyData("key2", "value2");
//items[2] = new MyData("key3", "value3");
//ArrayAdapter<MyData> adapter = new ArrayAdapter<MyData>(this,
// android.R.layout.simple_spinner_item, items);
//adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
//s.setAdapter(adapter);
/*
s.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
public void onItemSelected(AdapterView<?> parent, View view,
int position, long id) {
MyData d = items[position];
//Get selected value of key
String value = d.getValue();
String key = d.getSpinnerText();
}
*/
//public void onNothingSelected(AdapterView<?> parent) {
//}
//);
}
class MyData {
public MyData(String spinnerText, String value) {
this.spinnerText = spinnerText;
this.value = value;
}
public String getSpinnerText() {
return spinnerText;
}
public String getValue() {
return value;
}
public String toString() {
return spinnerText;
}
String spinnerText;
String value;
}
} |
package exception;
//201902104050 姜瑞临
public class UsernameDuplicateException extends Exception{
public UsernameDuplicateException(String message){
super(message);
}
}
|
//@@author A0126240W
package guitests;
import org.junit.Test;
import seedu.whatnow.testutil.TestTask;
import seedu.whatnow.testutil.TestUtil;
import seedu.whatnow.commons.core.Messages;
import seedu.whatnow.commons.exceptions.IllegalValueException;
import seedu.whatnow.logic.commands.UpdateCommand;
import seedu.whatnow.model.task.Name;
import static org.junit.Assert.assertTrue;
import static seedu.whatnow.commons.core.Messages.MESSAGE_INVALID_COMMAND_FORMAT;
import static seedu.whatnow.logic.commands.UpdateCommand.MESSAGE_UPDATE_TASK_SUCCESS;
import java.util.Arrays;
public class UpdateCommandTest extends WhatNowGuiTest {
@Test
public void update() throws IllegalValueException {
//invalid command
commandBox.runCommand("updates Johnny");
assertResultMessage(Messages.MESSAGE_UNKNOWN_COMMAND);
//invalid update format
commandBox.runCommand("update hello");
assertResultMessage(String.format(MESSAGE_INVALID_COMMAND_FORMAT, UpdateCommand.MESSAGE_USAGE));
commandBox.runCommand("update todo hello");
assertResultMessage(String.format(MESSAGE_INVALID_COMMAND_FORMAT, UpdateCommand.MESSAGE_USAGE));
commandBox.runCommand("update schedule 1 hello");
assertResultMessage(String.format(MESSAGE_INVALID_COMMAND_FORMAT, UpdateCommand.MESSAGE_USAGE));
TestTask[] currentList = td.getTypicalTasks();
//update description
int targetIndex = 1;
Arrays.sort(currentList);
for (int i = 0; i < currentList.length; i++) {
System.out.println(currentList[i]);
}
assertUpdateSuccess(targetIndex, currentList, "description", 0);
//update 1 date
targetIndex = 2;
Arrays.sort(currentList);
assertUpdateSuccess(targetIndex, currentList, "date", 1);
//update 2 date
targetIndex = 3;
Arrays.sort(currentList);
assertUpdateSuccess(targetIndex, currentList, "date", 2);
//update 1 time
targetIndex = 12;
Arrays.sort(currentList);
assertUpdateSuccess(targetIndex, currentList, "time", 1);
//update 2 time
targetIndex = 13;
Arrays.sort(currentList);
assertUpdateSuccess(targetIndex, currentList, "time", 2);
}
/**
* Runs the update command to update the task at specified index and confirms the result is correct.
* @param targetIndexOneIndexed e.g. to update the first task in the list, 1 should be given as the target index.
* @param task The updated task
* @param currentList A copy of the current list of tasks (before deletion).
* @throws IllegalValueException
*/
private void assertUpdateSuccess(int targetIndexOneIndexed, TestTask[] currentList, String field, int num) throws IllegalValueException {
TestTask taskToUpdate = currentList[targetIndexOneIndexed-1]; //-1 because array uses zero indexing
TestTask toBeUpdatedTo = new TestTask();
toBeUpdatedTo.setName(taskToUpdate.getName());
toBeUpdatedTo.setTaskDate(taskToUpdate.getTaskDate());
toBeUpdatedTo.setStartDate(taskToUpdate.getStartDate());
toBeUpdatedTo.setEndDate(taskToUpdate.getEndDate());
toBeUpdatedTo.setTaskTime(taskToUpdate.getTaskTime());
toBeUpdatedTo.setStartTime(taskToUpdate.getStartTime());
toBeUpdatedTo.setEndTime(taskToUpdate.getEndTime());
toBeUpdatedTo.setPeriod(taskToUpdate.getPeriod());
toBeUpdatedTo.setEndPeriod(taskToUpdate.getEndPeriod());
toBeUpdatedTo.setTags(taskToUpdate.getTags());
toBeUpdatedTo.setStatus(taskToUpdate.getStatus());
toBeUpdatedTo.setTaskType(taskToUpdate.getTaskType());
if (field.equals("description")) {
toBeUpdatedTo.setName(new Name("Buy milk"));
commandBox.runCommand("update schedule " + targetIndexOneIndexed + " " + field + " " + toBeUpdatedTo.getName());
} else if (field.equals("date")) {
if (num == 1) {
toBeUpdatedTo.setTaskDate("22/11/2016");
toBeUpdatedTo.setStartDate(null);
toBeUpdatedTo.setEndDate(null);
commandBox.runCommand("update schedule " + targetIndexOneIndexed + " " + field + " " + toBeUpdatedTo.getTaskDate());
} else if (num == 2) {
toBeUpdatedTo.setTaskDate(null);
toBeUpdatedTo.setStartDate("18/12/2016");
toBeUpdatedTo.setEndDate("25/12/2016");
commandBox.runCommand("update schedule " + targetIndexOneIndexed + " " + field + " " + toBeUpdatedTo.getStartDate() + " to " + toBeUpdatedTo.getEndDate());
}
} else if (field.equals("time")) {
if (num == 1) {
toBeUpdatedTo.setTaskTime("12:30pm");
toBeUpdatedTo.setStartTime(null);
toBeUpdatedTo.setEndTime(null);
commandBox.runCommand("update schedule " + targetIndexOneIndexed + " " + field + " " + toBeUpdatedTo.getTaskTime());
} else if (num == 2) {
toBeUpdatedTo.setTaskTime(null);
toBeUpdatedTo.setStartTime("09:30am");
toBeUpdatedTo.setEndTime("12:20pm");
commandBox.runCommand("update schedule " + targetIndexOneIndexed + " " + field + " " + toBeUpdatedTo.getStartTime() + " to " + toBeUpdatedTo.getEndTime());
}
}
//confirm the result message is correct
assertResultMessage(String.format(MESSAGE_UPDATE_TASK_SUCCESS, "\nFrom: " + taskToUpdate + " \nTo: " + toBeUpdatedTo));
}
}
|
package com.qy.zgz.kamiduo.widget;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.os.CountDownTimer;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.ImageView;
import com.qy.zgz.kamiduo.R;
import com.qy.zgz.kamiduo.utils.InputUtils;
import com.zhy.autolayout.AutoLinearLayout;
import com.zhy.autolayout.utils.AutoUtils;
/**
* Created by LCB on 2017/11/21 0021.
*/
public class TisGameExitDialog {
private Dialog dialog;
private View contentview;
private Context mcontext;
private Button btn_dialog_game_exit_no;
private Button btn_dialog_game_exit_yes;
private AutoLinearLayout all_dialog_game_exit_btn;
private CountDownTimer dialog_countDown;
private ImageView iv_dialog_game_exit_log;
public TisGameExitDialog(Context context)
{
if (null==context){
return;
}
mcontext=context;
dialog=new Dialog(mcontext);
}
public TisGameExitDialog create()
{
if (null==dialog){
return this;
}
contentview= LayoutInflater.from(mcontext).inflate(R.layout.dialog_game_exit,null);
AutoUtils.auto(contentview);
btn_dialog_game_exit_yes=contentview.findViewById(R.id.btn_dialog_game_exit_yes);
btn_dialog_game_exit_no=contentview.findViewById(R.id.btn_dialog_game_exit_no);
all_dialog_game_exit_btn=contentview.findViewById(R.id.all_dialog_game_exit_btn);
iv_dialog_game_exit_log=contentview.findViewById(R.id.iv_dialog_game_exit_log);
iv_dialog_game_exit_log.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
//事件回调
if (null!=cancelClickListener){
cancelClickListener.handEvent();
}
dismiss();
}
});
btn_dialog_game_exit_yes.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (null!=positiveButtonListener){
positiveButtonListener.onClick(v);
}
dismiss();
}
});
btn_dialog_game_exit_no.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (null!=negativeButtonListener){
negativeButtonListener.onClick(v);
}
dismiss();
}
});
return this;
}
public TisGameExitDialog setMessage(String message)
{
return this;
}
public TisGameExitDialog show()
{
if (dialog!=null && contentview!=null)
{
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(contentview);
WindowManager.LayoutParams params = dialog.getWindow().getAttributes();
params.gravity= Gravity.CENTER;
params.width= WindowManager.LayoutParams.WRAP_CONTENT;
dialog.setCancelable(true);
dialog.setCanceledOnTouchOutside(true);
dialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
@Override
public void onDismiss(DialogInterface dialog) {
if (dialog_countDown!=null){
dialog_countDown.cancel();
}
InputUtils.Companion.closeInput(mcontext);
//事件回调
if (null!=handEventAfterDismiss){
handEventAfterDismiss.handEvent();
}
}
});
dialog.getWindow().setAttributes(params);
dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
dialog.show();
dialog_countDown= new CountDownTimer(10000,1000){
@Override
public void onTick(long millisUntilFinished) {
}
@Override
public void onFinish() {
iv_dialog_game_exit_log.callOnClick();
}
}.start();
}
return this;
}
public void dismiss()
{
if (dialog!=null && dialog.isShowing())
{
dialog.dismiss();
}
}
private NegativeButtonListener negativeButtonListener;
public interface NegativeButtonListener
{
void onClick(View v);
}
public TisGameExitDialog setNegativeButtonListener(NegativeButtonListener listen){
negativeButtonListener=listen;
return this;
}
private PositiveButtonListener positiveButtonListener;
public interface PositiveButtonListener
{
void onClick(View v);
}
public TisGameExitDialog setPositiveButtonListener(PositiveButtonListener listen){
positiveButtonListener=listen;
return this;
}
private HandEventAfterDismiss handEventAfterDismiss;
private CountDownEvent countDownEvent;
private CancelClickListener cancelClickListener;
//弹窗消失后处理事件
public interface HandEventAfterDismiss
{
void handEvent();
}
//设置弹窗消失后处理事件对象
public TisGameExitDialog setHandEventAfterDismiss(HandEventAfterDismiss handEvent){
handEventAfterDismiss=handEvent;
return this;
}
//倒计时处理(有确定按钮)
public interface CountDownEvent
{
void handCountDownEvent();
}
public TisGameExitDialog setCountDownEvent(CountDownEvent c){
countDownEvent=c;
return this;
}
//弹窗消失后处理事件
public interface CancelClickListener
{
void handEvent();
}
//设置弹窗消失后处理事件对象
public TisGameExitDialog setCancelClickListener(CancelClickListener ccl){
cancelClickListener=ccl;
return this;
}
}
|
package com.tencent.mm.plugin.subapp.ui.autoadd;
import android.os.Bundle;
import android.util.SparseIntArray;
import android.widget.TextView;
import com.tencent.mm.R;
import com.tencent.mm.k.g;
import com.tencent.mm.model.au;
import com.tencent.mm.model.c;
import com.tencent.mm.model.q;
import com.tencent.mm.plugin.messenger.foundation.a.a.h.a;
import com.tencent.mm.protocal.c.xt;
import com.tencent.mm.sdk.platformtools.bi;
import com.tencent.mm.sdk.platformtools.x;
import com.tencent.mm.ui.MMActivity;
import com.tencent.mm.ui.widget.MMSwitchBtn;
public class AutoAddFriendUI extends MMActivity {
private MMSwitchBtn orG = null;
private TextView orH = null;
private MMSwitchBtn orI = null;
private SparseIntArray orJ = new SparseIntArray();
private int status;
static /* synthetic */ boolean a(AutoAddFriendUI autoAddFriendUI, boolean z, int i, int i2) {
x.d("MicroMsg.AutoAddFriendUI", "switch change : open = " + z + " item value = " + i + " functionId = " + i2);
if (z) {
autoAddFriendUI.status |= i;
} else {
autoAddFriendUI.status &= i ^ -1;
}
autoAddFriendUI.orJ.put(i2, z ? 1 : 2);
return true;
}
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
setMMTitle(R.l.auto_add_friend_title);
this.status = q.GJ();
initView();
}
private boolean uL(int i) {
return (this.status & i) != 0;
}
protected final int getLayoutId() {
return R.i.auto_add_friend;
}
protected final void initView() {
this.orG = (MMSwitchBtn) findViewById(R.h.need_to_verify);
this.orH = (TextView) findViewById(R.h.auto_add_contact_text);
this.orI = (MMSwitchBtn) findViewById(R.h.auto_add_contact);
this.orG.setCheck(uL(32));
if (bGv() == 1) {
this.orI.setCheck(uL(2097152));
this.orI.setSwitchListener(new 1(this));
} else {
this.orH.setVisibility(8);
this.orI.setVisibility(8);
}
this.orG.setSwitchListener(new 2(this));
setBackBtn(new 3(this));
}
private static int bGv() {
int i;
String value = g.AT().getValue("AutoAddFriendShow");
if (bi.oW(value)) {
value = "0";
}
try {
i = bi.getInt(value, 0);
} catch (Exception e) {
i = 0;
}
x.d("MicroMsg.AutoAddFriendUI", "getAutoAddDynamicConfig, autoAdd = %d", new Object[]{Integer.valueOf(i)});
return i;
}
protected void onResume() {
super.onResume();
}
protected void onPause() {
super.onPause();
au.HU();
c.DT().set(7, Integer.valueOf(this.status));
for (int i = 0; i < this.orJ.size(); i++) {
int keyAt = this.orJ.keyAt(i);
int valueAt = this.orJ.valueAt(i);
xt xtVar = new xt();
xtVar.rDz = keyAt;
xtVar.rDA = valueAt;
au.HU();
c.FQ().b(new a(23, xtVar));
x.d("MicroMsg.AutoAddFriendUI", "switch " + keyAt + " " + valueAt);
}
this.orJ.clear();
}
protected void onDestroy() {
super.onDestroy();
}
}
|
package com.wuyan.masteryi.admin.service;
import java.util.List;
import java.util.Map;
public interface SecKillService {
Map<String,Object> addSkGoods(int[] prodId, int[] stock, int[] price, String bDate, String eDate);
Map<String,Object> rmSkGoods(Integer propId);
}
|
package com.pfchoice.springboot.service.impl;
import java.util.List;
import com.pfchoice.springboot.model.RiskRecon;
import com.pfchoice.springboot.repositories.RiskReconRepository;
import com.pfchoice.springboot.service.RiskReconService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@Service("riskReconService")
@Transactional
public class RiskReconServiceImpl implements RiskReconService {
@Autowired
private RiskReconRepository riskReconRepository;
public RiskRecon findById(Integer id) {
return riskReconRepository.findOne(id);
}
public RiskRecon findByName(String name) {
return riskReconRepository.findByName(name);
}
public void saveRiskRecon(RiskRecon riskRecon) {
riskReconRepository.save(riskRecon);
}
public void updateRiskRecon(RiskRecon riskRecon) {
saveRiskRecon(riskRecon);
}
public void deleteRiskReconById(Integer id) {
riskReconRepository.delete(id);
}
public void deleteAllRiskRecons() {
riskReconRepository.deleteAll();
}
public List<RiskRecon> findAllRiskRecons() {
return riskReconRepository.findAll();
}
public boolean isRiskReconExist(RiskRecon riskRecon) {
return findById(riskRecon.getId()) != null;
}
}
|
package com.shangcai.action.manager.common.impl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import com.shangcai.action.manager.ManagerAction;
import com.shangcai.action.manager.common.ICategoryAction;
import com.shangcai.entity.common.Category;
import com.shangcai.service.common.ICategoryService;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
@Controller("com.shangcai.action.manager.common.impl.CategoryAction")
@Scope("prototype")
public class CategoryAction extends ManagerAction<Category, Integer> implements ICategoryAction {
@Autowired
private ICategoryService categoryService;
private String name;
private Integer up;
private Byte type;
private Integer sort;
/**
* 获取设计师分类列表
*
* @author GS
* @throws Exception
*/
@Override
public void list() throws Exception {
write(categoryService.allList(type));
}
/**
* 添加设计师分类
*
* @author GS
* @throws Exception
*/
@Override
public void add() throws Exception {
categoryService.ins(name, up, type, sort);
write();
}
/**
* 更新设计师分类
*
* @author GS
* @throws Exception
*/
@Override
public void upd() throws Exception {
System.out.println(getPkey());
categoryService.upd(getPkey(), name, up, type, sort);
write();
}
/**
* 删除设计师分类
*
* @author GS
* @throws Exception
*/
@Override
public void del() throws Exception {
categoryService.del(getPkey());
write();
}
}
|
package com.example.keokimassad.testparcheesi;
import game.GamePlayer;
import game.actionMsg.GameAction;
/**
* Created by KeokiMassad on 12/4/16.
*/
public class ParCheckLegalMoveAction extends GameAction {
public ParCheckLegalMoveAction(GamePlayer player) {
super(player);
}
}
|
package com.main.faq;
import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import android.support.annotation.RequiresApi;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.KeyEvent;
import android.webkit.JsResult;
import android.webkit.WebChromeClient;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
public class MainActivity extends AppCompatActivity {
private WebView mWebView;
@RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN_MR1)
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
setContentView(R.layout.activity_main);
ActionBar actionBar = getSupportActionBar();
if(actionBar != null) {
actionBar.hide();
}
mWebView = findViewById(R.id.webView);
//webView加载网页后出现ERR_UNKNOWN_URL_SCHEME
mWebView.setWebViewClient(new WebViewClient() {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
if(url == null) return false;
try {
if(url.startsWith("weixin://") //微信
|| url.startsWith("alipays://") //支付宝
|| url.startsWith("mailto://") //邮件
|| url.startsWith("tel://")//电话
|| url.startsWith("dianping://")//大众点评
|| url.startsWith("baiduboxapp://") //百度
//其他自定义的scheme
) {
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
startActivity(intent);
return true;
}
} catch (Exception e) { //防止crash (如果手机上没有安装处理某个scheme开头的url的APP, 会导致crash)
return true;//没有安装该app时,返回true,表示拦截自定义链接,但不跳转,避免弹出上面的错误页面
}
//处理http和https开头的url
mWebView.loadUrl(url);
return true;
}
});
WebSettings webSettings = mWebView.getSettings();
// 让WebView能够执行javaScript
webSettings.setJavaScriptEnabled(true);
// 让JavaScript可以自动打开windows
webSettings.setJavaScriptCanOpenWindowsAutomatically(true);
// 设置缓存
webSettings.setAppCacheEnabled(false);
// 设置缓存模式,一共有四种模式
//webSettings.setCacheMode(webSettings.LOAD_CACHE_ELSE_NETWORK);
// 支持缩放(适配到当前屏幕)
webSettings.setSupportZoom(true);
// 将图片调整到合适的大小
webSettings.setUseWideViewPort(true);
// 支持内容重新布局,一共有四种方式
// 默认的是NARROW_COLUMNS
webSettings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.SINGLE_COLUMN);
// 设置可以被显示的屏幕控制
webSettings.setDisplayZoomControls(true);
// 设置默认字体大小
webSettings.setDefaultFontSize(12);
//支持video
webSettings.setMediaPlaybackRequiresUserGesture(false);
// 加载需要显示的网页
mWebView.loadUrl("http://106.15.185.137:69/");
mWebView.setWebChromeClient(new WebChromeClient() {
@Override
public boolean onJsAlert(WebView view, String url, String message,
JsResult result) {
// TODO Auto-generated method stub
return super.onJsAlert(view, url, message, result);
}
});
}
/**
* 返回按钮监听
* @param keyCode
* @param event
* @return
*/
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if ((keyCode == KeyEvent.KEYCODE_BACK) ) {
if (mWebView.canGoBack())
{
mWebView.goBack(); //goBack()表示返回WebView的上一页面
return true;
}else
{
finish();
return true;
}
}
return false;
}
}
|
package pl.ark.chr.buginator.email.sender.service;
import pl.ark.chr.buginator.commons.dto.EmailDTO;
/**
* Service responsible for creating and sending emails
*/
public interface EmailSender {
/**
* Creates email message and sends it to SMTP server
*
* @param mail Mail configuration
*/
void createAndSendMessage(EmailDTO mail);
}
|
package com.hxsb.model.BUY_ERP_USER_SYNC;
public class Relation {
private String relateNos;
private String relateIDs;
private Long Biz_Area;
private Long Biz_Unit;
public String getRelateNos() {
return relateNos;
}
public void setRelateNos(String relateNos) {
this.relateNos = relateNos;
}
public String getRelateIDs() {
return relateIDs;
}
public void setRelateIDs(String relateIDs) {
this.relateIDs = relateIDs;
}
public Long getBiz_Area() {
return Biz_Area;
}
public void setBiz_Area(Long biz_Area) {
Biz_Area = biz_Area;
}
public Long getBiz_Unit() {
return Biz_Unit;
}
public void setBiz_Unit(Long biz_Unit) {
Biz_Unit = biz_Unit;
}
}
|
//---------------------------------------------------------------------
// For typedefs like: typedef int myInteger1, myInteger2;
// Also can hold the structdefs
//---------------------------------------------------------------------
public class TypedefSTO extends STO
{
//----------------------------------------------------------------
//
//----------------------------------------------------------------
public
TypedefSTO (String strName)
{
super (strName);
this.setIsModLValue(false);
}
public
TypedefSTO (String strName, Type typ)
{
super (strName, typ);
this.setIsModLValue(false);
}
//----------------------------------------------------------------
//
//----------------------------------------------------------------
public boolean
isTypedef ()
{
return true;
}
}
|
package zm.gov.moh.common.submodule.form.model;
import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
public class Form{
FormContext context;
ViewGroup rootView;
public void setFormContext(FormContext context) {
this.context = context;
}
public FormContext getFormContext() {
return context;
}
public void setRootView(ViewGroup rootView) {
this.rootView = rootView;
}
public ViewGroup getRootView() {
return rootView;
}
} |
package sample;
import javafx.animation.KeyFrame;
import javafx.animation.KeyValue;
import javafx.animation.Timeline;
import javafx.scene.paint.Color;
import javafx.scene.shape.Arc;
import javafx.scene.shape.ArcType;
import javafx.scene.shape.Shape;
import javafx.scene.shape.StrokeLineCap;
import javafx.util.Duration;
public class DoubleRingObs extends Obstacle{
private transient Arc arc[];
public DoubleRingObs(double pos,Ball ball,Game g){
super(ball,g,pos);
this.arc=new Arc[8];
}
@Override
public void create() {
arc[0]=new Arc(80,pos,70,70,0,78);
arc[0].setStrokeWidth(15);
arc[0].setType(ArcType.OPEN);
arc[0].setStroke(Color.DARKVIOLET);
arc[0].setStrokeLineCap(StrokeLineCap.ROUND);
arc[1]=new Arc(80,pos,70,70,90,78);
arc[1].setStrokeWidth(15);
arc[1].setType(ArcType.OPEN);
arc[1].setStroke(Color.YELLOW);
arc[1].setStrokeLineCap(StrokeLineCap.ROUND);
arc[2]=new Arc(80,pos,70,70,180,78);
arc[2].setStrokeWidth(15);
arc[2].setType(ArcType.OPEN);
arc[2].setStroke(Color.CYAN);
arc[2].setStrokeLineCap(StrokeLineCap.ROUND);
arc[3]=new Arc(80,pos,70,70,270,78);
arc[3].setStrokeWidth(15);
arc[3].setType(ArcType.OPEN);
arc[3].setStroke(Color.DARKMAGENTA);
arc[3].setStrokeLineCap(StrokeLineCap.ROUND);
arc[4]=new Arc(220,pos,70,70,12,78);
arc[4].setStrokeWidth(15);
arc[4].setType(ArcType.OPEN);
arc[4].setStroke(Color.YELLOW);
arc[4].setStrokeLineCap(StrokeLineCap.ROUND);
arc[5]=new Arc(220,pos,70,70,102,78);
arc[5].setStrokeWidth(15);
arc[5].setType(ArcType.OPEN);
arc[5].setStroke(Color.DARKVIOLET);
arc[5].setStrokeLineCap(StrokeLineCap.ROUND);
arc[6]=new Arc(220,pos,70,70,192,78);
arc[6].setStrokeWidth(15);
arc[6].setType(ArcType.OPEN);
arc[6].setStroke(Color.DARKMAGENTA);
arc[6].setStrokeLineCap(StrokeLineCap.ROUND);
arc[7]=new Arc(220,pos,70,70,282,78);
arc[7].setStrokeWidth(15);
arc[7].setType(ArcType.OPEN);
arc[7].setStroke(Color.CYAN);
arc[7].setStrokeLineCap(StrokeLineCap.ROUND);
timeline=new Timeline(new KeyFrame(Duration.millis(5000-250*g.getDifficulty()),new KeyValue(arc[0].startAngleProperty(),360),new KeyValue(arc[1].startAngleProperty(),450),new KeyValue(arc[2].startAngleProperty(),540),new KeyValue(arc[3].startAngleProperty(),630),new KeyValue(arc[4].startAngleProperty(),-348),new KeyValue(arc[5].startAngleProperty(),-258),new KeyValue(arc[6].startAngleProperty(),-168),new KeyValue(arc[7].startAngleProperty(),-78)));
timeline.setCycleCount(Timeline.INDEFINITE);
timeline.play();
hit=new Timeline(new KeyFrame(Duration.millis(10),e-> detect_hit()));
hit.setCycleCount(Timeline.INDEFINITE);
hit.play();
grp.getChildren().addAll(arc);
}
@Override
public void detect_hit(){
for(int i=0;i<4;i++) {
Shape shape = Shape.intersect(ball.getBall(), arc[i]);
if(shape.getBoundsInLocal().getWidth()!=-1 && arc[i].getStroke()!=ball.getBall().getFill()){
System.out.println("Collision detected");
timeline.pause();
hit.pause();
ball.getUp().pause();
ball.getDown().pause();
g.hit_detected();
g.setPause_stat(1);
break;
}
}
}
}
|
package com.mythosapps.time15;
import android.app.Activity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.mythosapps.time15.types.KindOfDay;
import java.util.Collection;
import java.util.Comparator;
import java.util.List;
/**
* Created by andreas on 07.08.17.
*/
public class ListArrayAdapter<T> extends ArrayAdapter {
private final Activity activity;
private Comparator comparator;
public ListArrayAdapter(Activity activity, int item, int taskName, List<T> list, Comparator<T> comparator) {
super(activity, item, taskName, list);
this.activity = activity;
this.comparator = comparator;
sort(comparator);
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
TextView textView = null;
View view = super.getView(position, convertView, parent);
if (view instanceof LinearLayout) {
LinearLayout layout = (LinearLayout) super.getView(position, convertView, parent);
textView = (TextView) layout.getChildAt(0);
} else {
textView = (TextView) view;
}
int textColor = ((KindOfDay) getItem(position)).getColor();
textView.setTextColor(textColor);
return textView;
}
public void addAllListItems(Collection<? extends T> collection) {
super.addAll(collection);
sort(comparator);
}
@Override
public void notifyDataSetChanged() {
super.notifyDataSetChanged();
//list.reload(configStorage.loadConfigXml(activity));
//clear();
//addAll(KindOfDay.listNames); // hier muss nur noch das namen array mit der reihenfoge der objekte in einklang gebracht werden
//sort(comp);
}
}
|
package org.sodeja.functional;
public abstract class Maybe<T> {
private static class Just<T> extends Maybe<T> {
public final T value;
public Just(T value) {
this.value = value;
}
public T value() {
return value;
}
@Override
public boolean hasValue() {
return true;
}
}
private static class Nothing<T> extends Maybe<T> {
@Override
public T value() {
throw new IllegalArgumentException("Cannot extract value from Nothing");
}
@Override
public boolean hasValue() {
return false;
}
}
private Maybe() {
}
public abstract T value();
public abstract boolean hasValue();
public boolean isEmpty() {
return ! hasValue();
}
public static <T> Maybe<T> just(T value) {
return new Just<T>(value);
}
public static <T> Maybe<T> nothing() {
return new Nothing<T>();
}
}
|
package com.eazy.firda.eazy.Tasks;
/**
* Created by firda on 2/17/2018.
*/
public class SyncDetailCar {
}
|
package org.rebioma.client.bean;
import java.util.Set;
// Generated Aug 21, 2008 10:07:06 AM by Hibernate Tools 3.2.2.GA
/**
* User generated by hbm2java
*/
public class User implements java.io.Serializable {
private Integer id;
private String firstName;
private String lastName;
private String openId;
private String email;
private Boolean approved;
private Integer vetter;
private Integer dataProvider;
private String institution;
private String passwordHash;
private String sessionId;
private Set<User> friends;
private Set<Role> roles;
public User() {
}
public User(String firstName, String lastName, String openId, String email,
Boolean approved, Integer vetter, Integer dataProvider, String institution) {
this.firstName = firstName;
this.lastName = lastName;
this.openId = openId;
this.email = email;
this.approved = approved;
this.vetter = vetter;
this.dataProvider = dataProvider;
this.institution = institution;
}
public boolean equals(Object obj) {
if (obj == null || !(obj instanceof User)) {
return false;
}
User compare = (User) obj;
return id.equals(compare.id);
}
public Boolean getApproved() {
return this.approved;
}
public Integer getDataProvider() {
return this.dataProvider;
}
public String getEmail() {
return this.email;
}
public String getFirstName() {
return this.firstName;
}
public Set<User> getFriends() {
return friends;
}
public Integer getId() {
return this.id;
}
public String getInstitution() {
return this.institution;
}
public String getLastName() {
return this.lastName;
}
public String getOpenId() {
return this.openId;
}
public String getPasswordHash() {
return passwordHash;
}
/**
* @return the roles
*/
public Set<Role> getRoles() {
return roles;
}
public String getSessionId() {
return sessionId;
}
public Integer getVetter() {
return this.vetter;
}
public int hashCode() {
if (id == null) {
return 0;
}
return id;
}
public void setApproved(Boolean approved) {
this.approved = approved;
}
public void setDataProvider(Integer dataProvider) {
this.dataProvider = dataProvider;
}
public void setEmail(String email) {
this.email = email;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public void setFriends(Set<User> friends) {
this.friends = friends;
}
public void setId(Integer id) {
this.id = id;
}
public void setInstitution(String institution) {
this.institution = institution;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public void setOpenId(String openId) {
this.openId = openId;
}
public void setPasswordHash(String passwordHash) {
this.passwordHash = passwordHash;
}
/**
* @param roles the roles to set
*/
public void setRoles(Set<Role> roles) {
this.roles = roles;
}
public void setSessionId(String sessionId) {
this.sessionId = sessionId;
}
public void setVetter(Integer vetter) {
this.vetter = vetter;
}
@Override
public String toString() {
return "User [id=" + id + ", firstName=" + firstName + ", lastName="
+ lastName + ", email=" + email + ", sessionId=" + sessionId + "]";
}
}
|
package coreClasses.threadLocal;
import java.util.List;
import java.util.Map;
public interface Database {
void addOrOverwriteTable(final String table);
void addRowIfTableExists(String table, String row);
Map<String, List<String>> getDb();
}
|
package com.cnk.travelogix.sapintegrations.zif.erp.ws.opportunity.data;
import java.math.BigDecimal;
public class ZifTerpOppItemDataData
{
protected String itemNumber;
protected String prodHierarchy;
protected BigDecimal quantity;
protected String adult;
protected String child;
protected String infant;
protected String category;
protected String material;
protected String matGrp1;
protected String matGrp2;
protected String matGrp3;
protected String matGrp4;
protected String matGrp5;
protected String crmtMode;
/**
* Gets the value of the itemNumber property.
*
* @return possible object is {@link String }
*
*/
public String getItemNumber()
{
return itemNumber;
}
/**
* Sets the value of the itemNumber property.
*
* @param value
* allowed object is {@link String }
*
*/
public void setItemNumber(final String value)
{
this.itemNumber = value;
}
/**
* Gets the value of the prodHierarchy property.
*
* @return possible object is {@link String }
*
*/
public String getProdHierarchy()
{
return prodHierarchy;
}
/**
* Sets the value of the prodHierarchy property.
*
* @param value
* allowed object is {@link String }
*
*/
public void setProdHierarchy(final String value)
{
this.prodHierarchy = value;
}
/**
* Gets the value of the quantity property.
*
* @return possible object is {@link BigDecimal }
*
*/
public BigDecimal getQuantity()
{
return quantity;
}
/**
* Sets the value of the quantity property.
*
* @param value
* allowed object is {@link BigDecimal }
*
*/
public void setQuantity(final BigDecimal value)
{
this.quantity = value;
}
/**
* Gets the value of the adult property.
*
* @return possible object is {@link String }
*
*/
public String getAdult()
{
return adult;
}
/**
* Sets the value of the adult property.
*
* @param value
* allowed object is {@link String }
*
*/
public void setAdult(final String value)
{
this.adult = value;
}
/**
* Gets the value of the child property.
*
* @return possible object is {@link String }
*
*/
public String getChild()
{
return child;
}
/**
* Sets the value of the child property.
*
* @param value
* allowed object is {@link String }
*
*/
public void setChild(final String value)
{
this.child = value;
}
/**
* Gets the value of the infant property.
*
* @return possible object is {@link String }
*
*/
public String getInfant()
{
return infant;
}
/**
* Sets the value of the infant property.
*
* @param value
* allowed object is {@link String }
*
*/
public void setInfant(final String value)
{
this.infant = value;
}
/**
* Gets the value of the category property.
*
* @return possible object is {@link String }
*
*/
public String getCategory()
{
return category;
}
/**
* Sets the value of the category property.
*
* @param value
* allowed object is {@link String }
*
*/
public void setCategory(final String value)
{
this.category = value;
}
/**
* Gets the value of the material property.
*
* @return possible object is {@link String }
*
*/
public String getMaterial()
{
return material;
}
/**
* Sets the value of the material property.
*
* @param value
* allowed object is {@link String }
*
*/
public void setMaterial(final String value)
{
this.material = value;
}
/**
* Gets the value of the matGrp1 property.
*
* @return possible object is {@link String }
*
*/
public String getMatGrp1()
{
return matGrp1;
}
/**
* Sets the value of the matGrp1 property.
*
* @param value
* allowed object is {@link String }
*
*/
public void setMatGrp1(final String value)
{
this.matGrp1 = value;
}
/**
* Gets the value of the matGrp2 property.
*
* @return possible object is {@link String }
*
*/
public String getMatGrp2()
{
return matGrp2;
}
/**
* Sets the value of the matGrp2 property.
*
* @param value
* allowed object is {@link String }
*
*/
public void setMatGrp2(final String value)
{
this.matGrp2 = value;
}
/**
* Gets the value of the matGrp3 property.
*
* @return possible object is {@link String }
*
*/
public String getMatGrp3()
{
return matGrp3;
}
/**
* Sets the value of the matGrp3 property.
*
* @param value
* allowed object is {@link String }
*
*/
public void setMatGrp3(final String value)
{
this.matGrp3 = value;
}
/**
* Gets the value of the matGrp4 property.
*
* @return possible object is {@link String }
*
*/
public String getMatGrp4()
{
return matGrp4;
}
/**
* Sets the value of the matGrp4 property.
*
* @param value
* allowed object is {@link String }
*
*/
public void setMatGrp4(final String value)
{
this.matGrp4 = value;
}
/**
* Gets the value of the matGrp5 property.
*
* @return possible object is {@link String }
*
*/
public String getMatGrp5()
{
return matGrp5;
}
/**
* Sets the value of the matGrp5 property.
*
* @param value
* allowed object is {@link String }
*
*/
public void setMatGrp5(final String value)
{
this.matGrp5 = value;
}
/**
* Gets the value of the crmtMode property.
*
* @return possible object is {@link String }
*
*/
public String getCrmtMode()
{
return crmtMode;
}
/**
* Sets the value of the crmtMode property.
*
* @param value
* allowed object is {@link String }
*
*/
public void setCrmtMode(final String value)
{
this.crmtMode = value;
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.