text
stringlengths
10
2.72M
package com.bridgelabz; import java.util.ArrayList; import java.util.Scanner; interface empWageMethod { public void calculateEmpWage(CompanyEmpWage obj); } public class EmpWageBuilder implements empWageMethod { //CONSTANTS private static final int IS_FULL_TIME = 1; private static final int IS_PART_TIME = 2; //EMPLOYEE WAGE COMPUTATION public void calculateEmpWage(CompanyEmpWage companyEmpWage) { //VARIABLES int empHours; int workingHours = 0; int workingDays = 0; while ( workingHours < companyEmpWage.maxHr && workingDays < companyEmpWage.maxDay ) { workingDays++; int empCheck = (int) (Math.random() * 10 ) % 3; switch (empCheck) { case IS_FULL_TIME: empHours = 8; break; case IS_PART_TIME: empHours = 4; break; default: empHours = 0; } workingHours += empHours; companyEmpWage.dailyEmpWage = empHours * companyEmpWage.wagePrHr; System.out.println("Day#: " + workingDays + " Emp Hr: " + empHours); System.out.println("Daily Wage of " + companyEmpWage.companyName + " Employee is: " + companyEmpWage.dailyEmpWage + "\n"); } companyEmpWage.empMonthlyWages = workingHours * companyEmpWage.wagePrHr; System.out.println( "Total Wage Of " + companyEmpWage.companyName + " Employee is: " + companyEmpWage.empMonthlyWages + "\n" ); } //COMPANY QUERY METHOD public static void companyQuery(){ Scanner scanner = new Scanner(System.in); EmpWageBuilder empWageBuilder = new EmpWageBuilder(); // DECLARATION OF ARRAY ArrayList<CompanyEmpWage> company = new ArrayList<>(); System.out.println("Enter Option To Query About Company Employee Wage: " + "\n 1.Dmart \n 2.Bridgelabz \n 3.Reliance"); int option = Integer.valueOf(scanner.next()); switch(option) { case 1: company.add(new CompanyEmpWage("DMart", 20, 40, 20)); empWageBuilder.calculateEmpWage(company.get(0)); break; case 2: company.add(new CompanyEmpWage("Bridgelabz", 25, 60, 20)); empWageBuilder.calculateEmpWage(company.get(0)); break; case 3: company.add(new CompanyEmpWage("Reliance", 15, 45, 25)); empWageBuilder.calculateEmpWage(company.get(0)); break; default: System.out.println("Invalid Option"); break; } } // MAIN METHOD public static void main(String[] args) { System.out.println( " Welcome to Employee Wage Computation Program " ); companyQuery(); } } // CLASS COMPANY EMP WAGE class CompanyEmpWage { int wagePrHr, maxHr, maxDay, dailyEmpWage, empMonthlyWages; String companyName; //CONSTRUCTOR public CompanyEmpWage(String companyName, int wagePrHr, int maxHr, int maxDay) { this.companyName = companyName; this.wagePrHr = wagePrHr; this.maxHr = maxHr; this.maxDay = maxDay; } }
package com.other.updown.mapper; import com.other.updown.domain.dto.ImagesUpload; import java.util.List; import org.apache.ibatis.annotations.Mapper; @Mapper public interface ImagesUploadMapper { int deleteByPrimaryKey(Integer imageId); int insert(ImagesUpload record); ImagesUpload selectByPrimaryKey(Integer imageId); List<ImagesUpload> selectAll(); int updateByPrimaryKey(ImagesUpload record); }
package switch2019.project.DTO.serializationDTO; import org.springframework.hateoas.RepresentationModel; import java.util.Objects; public class CategoryDenominationDTO extends RepresentationModel<CategoryDenominationDTO> { private final String categoryDenomination; public CategoryDenominationDTO(String categoryDenomination) { this.categoryDenomination = categoryDenomination; } public String getCategoryDenomination() { return categoryDenomination; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; CategoryDenominationDTO that = (CategoryDenominationDTO) o; return Objects.equals(categoryDenomination, that.categoryDenomination); } @Override public int hashCode() { return Objects.hash(categoryDenomination); } }
package br.eti.ns.nssuite.requisicoes.nfce; import br.eti.ns.nssuite.requisicoes._genericos.ConsSitReq; public class ConsSitReqNFCe extends ConsSitReq { public String chNFe; }
import static org.junit.Assert.*; import org.junit.Test; import java.util.ArrayList; public class LCAtest1 { // Tests for binary search tree @Test public void testFindLCAInt() { // Make binary tree LCA tree = new LCA(); tree.root = new Node(1); tree.root.left = new Node(2); tree.root.right = new Node(3); tree.root.left.left = new Node(4); tree.root.left.right = new Node(5); tree.root.right.left = new Node(6); tree.root.right.right = new Node(7); // Test for correct inputs assertEquals("Checking for lowest common ancestor of nodes 4 and 5 ", 2, tree.findLCA(4, 5)); assertEquals("Checking for lowest common ancestor of nodes 2 and 4 ", 2, tree.findLCA(2, 4)); // Test for incorrect input LCA tree2 = new LCA(); tree2.root = null; assertEquals("Checking for return of -1 for root 0 value", -1, tree2.findLCA(1, 2)); // Test for root of n1 null LCA tree4 = new LCA(); tree4.root = new Node(1); tree4.root.left = null; tree4.root.right = new Node(2); tree4.root.right.right = new Node(4); assertEquals("Checking for return of -1 for null value", -1, tree4.findLCA(3, 4)); // Test for root of n2 null LCA tree3 = new LCA(); tree3.root = new Node(1); tree3.root.left = new Node(2); tree3.root.right = null; tree3.root.left.left = new Node(4); assertEquals("Checking for return of -1 for null value", -1, tree3.findLCA(4, 5)); } @Test public void testFindPath() { ArrayList<Integer> path1 = new ArrayList(); LCA tree = new LCA(); tree.root = null; assertEquals("Checking for return of false for null root", false, tree.findPath(tree.root, 2, path1)); ArrayList<Integer> path2 = new ArrayList(); LCA tree2 = new LCA(); tree2.root = new Node(1); tree2.root.left = new Node(2); tree2.root.right = new Node(3); assertEquals("Checking for return of true for non null root", true, tree.findPath(tree2.root, 3, path2)); } // Tests for directed acyclic graphs @Test public void testVertex() { // Test of vertex DAG test = new DAG(1); assertEquals("testing V() function to return vertex", 1, test.V()); } // Test addEdge @Test public void testEdge() { // Test for edge where there are no edges DAG test1 = new DAG(3); assertEquals(0, test1.E()); // Test for edge where there are edges test1.addEdge(1, 2); assertEquals(1, test1.E()); } // Test indegree: Returns number of directed edges to vertex v @Test public void testIndegree() { // Test for correct input DAG test1 = new DAG(6); test1.addEdge(1, 2); test1.addEdge(2, 4); test1.addEdge(3, 3); assertEquals(1, test1.indegree(3)); // Test for incorrect input DAG test2 = new DAG(2); test2.addEdge(1, 2); test2.addEdge(2, 4); test2.addEdge(3, 3); assertEquals(0, test1.indegree(5)); } // Test outdegree Returns number of directed edges from vertex v @Test public void testOutdegree() { // Test for correct input DAG test1 = new DAG(5); test1.addEdge(1, 2); test1.addEdge(2, 4); test1.addEdge(3, 3); assertEquals(1, test1.outdegree(3)); // Test for incorrect input DAG test2 = new DAG(2); test2.addEdge(1, 2); test2.addEdge(2, 4); test2.addEdge(3, 3); assertEquals(0, test1.outdegree(5)); } // Test to check for if the graph has a cycle @Test public void testhasCycle() { // test for graph with cycle DAG test1 = new DAG(10); test1.addEdge(0, 1); test1.addEdge(1, 2); test1.addEdge(2, 0); test1.addEdge(2, 3); test1.addEdge(3, 4); test1.findCycle(0); assertTrue(test1.hasCycle()); // test for graph with no cycle DAG test2 = new DAG(10); test2.addEdge(1, 2); test2.addEdge(2, 4); test2.addEdge(3, 3); test2.findCycle(1); assertFalse(test2.hasCycle()); } //Test for reverse function @Test public void testReverse() { DAG test1 = new DAG(10); test1.addEdge(1, 2); test1.addEdge(0, 1); DAG testReverse = test1.reverse(); assertEquals("Output should be the same", testReverse.E(),test1.E()); } //Test for LCA function @Test public void testDAGLCA() { DAG test1 = new DAG(10); test1.addEdge(1, 2); test1.addEdge(2, 3); test1.addEdge(3, 4); test1.addEdge(3, 5); //Test for valid input assertEquals("LCA of these inputs should be 3",3,test1.findLCA(4,5)); //Test for invalid input assertEquals("Output should be -1, there is no LCA",-1,test1.findLCA(4,6)); //Test for LCA where graph is empty DAG test2 = new DAG(10); assertEquals("Output should be -1, graph is empty",-1,test2.findLCA(2,3)); //Test for LCA graph where graph is not a DAG test1.addEdge(1, 2); test1.addEdge(3, 4); assertEquals("Output should be -1, graph is not a DAG",-1,test2.findLCA(2,3)); } }
package com.example.sas_maxnot19.luckyapp.activities; import android.content.SharedPreferences; import android.graphics.Color; import android.graphics.drawable.ColorDrawable; import android.support.v7.app.ActionBar; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.util.Log; import android.widget.GridView; import com.example.sas_maxnot19.luckyapp.R; import com.example.sas_maxnot19.luckyapp.models.Profile; import com.example.sas_maxnot19.luckyapp.models.Zodiac; import com.example.sas_maxnot19.luckyapp.views.ColorGridView; import com.google.gson.Gson; import java.util.ArrayList; public class AccessoryActivity extends AppCompatActivity { private GridView gridView; private ArrayList<Integer> gridArray = new ArrayList<Integer>(); private ColorGridView customGridAdapter; private Zodiac zodiac; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_accessory); initComponents(); } public void initComponents(){ setTitle("Accessories"); ActionBar actionBar = getSupportActionBar(); actionBar.setBackgroundDrawable(new ColorDrawable(Color.parseColor("#FF4081"))); // //set grid view item Constant.profile = getProfile(); zodiac = new Zodiac(Constant.profile.getDate().getDate(),Constant.profile.getDate().getMonth()+1); //Log.e("date",Constant.profile.getDate().getDate()+"/"+(Constant.profile.getDate().getMonth()+1)+"/"+(Constant.profile.getDate().getYear()+1900)); Log.e("Zodiac: ",zodiac.getZodiac()); if(zodiac.getZodiac()=="munggorn"){ gridArray.add(Color.rgb(139,69,19)); gridArray.add(Color.WHITE); gridArray.add(Color.BLACK); } else if(zodiac.getZodiac()=="gum"){ gridArray.add(Color.BLUE); gridArray.add(Color.MAGENTA); gridArray.add(Color.YELLOW); } else if(zodiac.getZodiac()=="mean"){ gridArray.add(Color.YELLOW); gridArray.add(Color.MAGENTA); } else if(zodiac.getZodiac()=="mezz"){ gridArray.add(Color.RED); gridArray.add(Color.rgb(255,20,147)); gridArray.add(Color.WHITE); gridArray.add(Color.YELLOW); } else if(zodiac.getZodiac()=="purzog"){ gridArray.add(Color.rgb(255,20,147)); gridArray.add(Color.rgb(255,222,173)); gridArray.add(Color.WHITE); gridArray.add(Color.BLACK); } else if(zodiac.getZodiac()=="maetun"){ gridArray.add(Color.GREEN); gridArray.add(Color.BLACK); gridArray.add(Color.WHITE); gridArray.add(Color.rgb(255,20,147)); gridArray.add(Color.RED); } else if(zodiac.getZodiac()=="goragod"){ gridArray.add(Color.BLUE); gridArray.add(Color.WHITE); gridArray.add(Color.GREEN); gridArray.add(Color.YELLOW); gridArray.add(Color.RED); } else if(zodiac.getZodiac()=="sing"){ gridArray.add(Color.rgb(255,140,0)); gridArray.add(Color.MAGENTA); gridArray.add(Color.RED); gridArray.add(Color.rgb(255,215,0)); } else if(zodiac.getZodiac()=="gun"){ gridArray.add(Color.rgb(255,20,147)); gridArray.add(Color.BLUE); gridArray.add(Color.GREEN); } else if(zodiac.getZodiac()=="tlun"){ gridArray.add(Color.BLUE); gridArray.add(Color.WHITE); gridArray.add(Color.rgb(255,20,147)); gridArray.add(Color.BLACK); } else if(zodiac.getZodiac()=="pijig"){ gridArray.add(Color.RED); gridArray.add(Color.MAGENTA); gridArray.add(Color.rgb(139,69,19)); gridArray.add(Color.GREEN); } else if(zodiac.getZodiac()=="tanu"){ gridArray.add(Color.YELLOW); gridArray.add(Color.BLUE); gridArray.add(Color.RED); gridArray.add(Color.WHITE); gridArray.add(Color.rgb(255,140,0)); } gridView = (GridView) findViewById(R.id.gridView); customGridAdapter = new ColorGridView(this, R.layout.color_grid, gridArray); gridView.setAdapter(customGridAdapter); gridView.setClickable(false); } public Profile getProfile() { SharedPreferences sp = getSharedPreferences(Constant.PROFILE_KEY,MODE_PRIVATE); Gson gson = new Gson(); String profileStr = sp.getString("profile",null); return gson.fromJson(profileStr,Profile.class); } @Override public void onBackPressed() { super.onBackPressed(); finish(); } }
package mono.com.facebook.drawee.controller; public class ControllerViewportVisibilityListenerImplementor extends java.lang.Object implements mono.android.IGCUserPeer, com.facebook.drawee.controller.ControllerViewportVisibilityListener { /** @hide */ public static final String __md_methods; static { __md_methods = "n_onDraweeViewportEntry:(Ljava/lang/String;)V:GetOnDraweeViewportEntry_Ljava_lang_String_Handler:Com.Facebook.Drawee.Controller.IControllerViewportVisibilityListenerInvoker, Naxam.FrescoDrawee.Droid\n" + "n_onDraweeViewportExit:(Ljava/lang/String;)V:GetOnDraweeViewportExit_Ljava_lang_String_Handler:Com.Facebook.Drawee.Controller.IControllerViewportVisibilityListenerInvoker, Naxam.FrescoDrawee.Droid\n" + ""; mono.android.Runtime.register ("Com.Facebook.Drawee.Controller.IControllerViewportVisibilityListenerImplementor, Naxam.FrescoDrawee.Droid, Version=1.5.0.0, Culture=neutral, PublicKeyToken=null", ControllerViewportVisibilityListenerImplementor.class, __md_methods); } public ControllerViewportVisibilityListenerImplementor () { super (); if (getClass () == ControllerViewportVisibilityListenerImplementor.class) mono.android.TypeManager.Activate ("Com.Facebook.Drawee.Controller.IControllerViewportVisibilityListenerImplementor, Naxam.FrescoDrawee.Droid, Version=1.5.0.0, Culture=neutral, PublicKeyToken=null", "", this, new java.lang.Object[] { }); } public void onDraweeViewportEntry (java.lang.String p0) { n_onDraweeViewportEntry (p0); } private native void n_onDraweeViewportEntry (java.lang.String p0); public void onDraweeViewportExit (java.lang.String p0) { n_onDraweeViewportExit (p0); } private native void n_onDraweeViewportExit (java.lang.String p0); private java.util.ArrayList refList; public void monodroidAddReference (java.lang.Object obj) { if (refList == null) refList = new java.util.ArrayList (); refList.add (obj); } public void monodroidClearReferences () { if (refList != null) refList.clear (); } }
package com.yunhe.customermanagement.entity; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; import java.io.Serializable; /** * <p> * 供应商管理 * </p> * * @author 蔡慧鹏 * @since 2019-01-02 */ @Data @EqualsAndHashCode(callSuper = false) @Accessors(chain = true) @TableName("supplier") public class Supplier implements Serializable { private static final long serialVersionUID = 1L; @TableId(value = "id",type = IdType.AUTO) private Integer id; /** * 公司名 */ @TableField(value = "sup_compname") private String supCompname; /** * 供应商编号 */ @TableField(value = "sup_number") private String supNumber; /** * 应付欠款(元) */ @TableField(value = "sup_money") private Double supMoney; /** * 电话 */ @TableField(value = "sup_tele") private String supTele; /** * 状态 */ @TableField(value = "sup_flag") private Integer supFlag; /** * 联系人 */ @TableField(value = "sup_linkman") private String supLinkman; /** * 关联客户 */ @TableField(value = "sup_conn") private String supConn; /** * 邮箱 */ @TableField(value = "sup_email") private String supEmail; /** * 备注 */ @TableField(value = "sup_remarks") private String supRemarks; }
/* * #%L * Janus * %% * Copyright (C) 2014 KIXEYE, Inc * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * #L% */ package com.kixeye.janus.client.websocket; import com.google.common.base.Preconditions; import com.kixeye.chassis.transport.dto.Envelope; import com.kixeye.chassis.transport.serde.MessageSerDe; import com.kixeye.chassis.transport.websocket.WebSocketEnvelope; import com.kixeye.chassis.transport.websocket.WebSocketMessageRegistry; import com.kixeye.janus.Janus; import com.kixeye.janus.client.exception.NoServerAvailableException; import com.kixeye.janus.client.exception.RetriesExceededException; import org.apache.commons.lang.StringUtils; import org.eclipse.jetty.websocket.api.Session; import org.eclipse.jetty.websocket.api.WebSocketListener; import org.eclipse.jetty.websocket.api.WriteCallback; import org.eclipse.jetty.websocket.client.WebSocketClient; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.IOException; import java.nio.ByteBuffer; /** * A {@link StatelessWebSocketClient} which serializes message objects before transmission and * de-serializes message objects upon receipt. * * This class uses a defined enveloping message protocol (@see {@link Envelope}) to wrap the given * message objects. Within the {@link Envelope} is a typeId, which is used by both client and server * to determine the appropriate Java type to serialize to and de-serialize from. * * When creating an object of this class, you must provide a {@link MessageSerDe}, which is responsible for * performing the serialization and de-serialization of your objects. * * Additionally, you must provide a {@link WebSocketMessageRegistry} object, which maps your typeIds to message {@link Class}. * * @author cbarry@kixeye.com */ public class StatelessMessageClient extends StatelessWebSocketClient { private final static Logger logger = LoggerFactory.getLogger(StatelessMessageClient.class); protected final MessageSerDe serDe; protected final WebSocketMessageRegistry messageRegistry; protected final MessageListener listener; /** * * @param janus the {@link Janus} instance that will select the appropriate remote server instance. * @param numRetries maximum number of send retries * @param webSocketClient the web socket client to use * @param listener listener to be informed when new messages arrive * @param serDe the {@link MessageSerDe} to serialize/de-serialize your message objects with * @param messageRegistry the {@link WebSocketMessageRegistry} used to register your message types with a typeId */ public StatelessMessageClient(Janus janus, int numRetries, WebSocketClient webSocketClient, MessageListener listener, MessageSerDe serDe, WebSocketMessageRegistry messageRegistry) { super(janus, numRetries, "/" + serDe.getMessageFormatName(), webSocketClient, new WebSocketToMessageListenerBridge(listener, serDe, messageRegistry)); this.serDe = Preconditions.checkNotNull(serDe, "'serDe' cannot be null."); this.messageRegistry = Preconditions.checkNotNull(messageRegistry,"'messageRegistry' cannot be null."); this.listener = Preconditions.checkNotNull(listener,"'listener' cannot be null"); } /** * Blocking send that waits until the write completes before returning. * * @param message the message that will be serialize and sent as the {@link Envelope payload} * @param action the action that should be performed upon receipt of the message * @param transId opaque transaction ID * @throws NoServerAvailableException * @throws RetriesExceededException * @throws IOException */ public void sendMessage(Object message, String action, String transId) throws NoServerAvailableException, RetriesExceededException, IOException { Envelope envelope = new Envelope(); envelope.action = action; envelope.transactionId = transId; envelope.typeId = messageRegistry.getTypeIdByClass(message.getClass()); envelope.payload = ByteBuffer.wrap(serDe.serialize(message)); sendBytes(ByteBuffer.wrap(serDe.serialize(envelope))); } /** * Asynchronous send that returns immediately and calls the write callback when complete. If * you do not care about complete notification, you can pass in "null" for the callback. * * @param message the message that will be serialize and sent as the {@link Envelope payload} * @param action the action that should be performed upon receipt of the message * @param transId opaque transaction ID * @param callback that callback that will be notified about message events * @throws NoServerAvailableException * @throws RetriesExceededException * @throws IOException */ public void sendMessage(Object message, String action, String transId, final WriteCallback callback) throws NoServerAvailableException, RetriesExceededException, IOException { Envelope envelope = new Envelope(); envelope.action = action; envelope.transactionId = transId; envelope.typeId = messageRegistry.getTypeIdByClass(message.getClass()); envelope.payload = ByteBuffer.wrap(serDe.serialize(message)); sendBytes(ByteBuffer.wrap(serDe.serialize(envelope)), callback); } protected static class WebSocketToMessageListenerBridge implements WebSocketListener { protected final MessageListener listener; protected final MessageSerDe serDe; protected final WebSocketMessageRegistry messageRegistry; public WebSocketToMessageListenerBridge(MessageListener listener, MessageSerDe serDe, WebSocketMessageRegistry messageRegistry) { this.listener = listener; this.serDe = serDe; this.messageRegistry = messageRegistry; } @Override public void onWebSocketBinary(byte[] payload, int offset, int len) { try { final Envelope envelope = serDe.deserialize(payload, offset, len, Envelope.class); // check if we have a payload if (StringUtils.isBlank(envelope.typeId)) { if (envelope.payload != null) { logger.error("Missing typeId in WebSocket envelope, ignoring message!"); } else { // empty payload so just send the envelop to listener listener.onMessage(new WebSocketEnvelope(envelope), null); } return; } // de-serialize message Class<?> clazz = messageRegistry.getClassByTypeId(envelope.typeId); final byte[] rawPayload = envelope.payload.array(); final Object message = serDe.deserialize(rawPayload, 0, rawPayload.length, clazz); // notify the listener listener.onMessage(new WebSocketEnvelope(envelope), message); } catch (Exception e) { logger.error("Exception handling web socket message", e); } } @Override public void onWebSocketClose(int statusCode, String reason) { } @Override public void onWebSocketConnect(Session session) { } @Override public void onWebSocketError(Throwable cause) { } @Override public void onWebSocketText(String message) { } } }
package com.zhowin.miyou.mine.activity; import android.view.View; import com.zhowin.base_library.utils.ActivityManager; import com.zhowin.base_library.utils.SpanUtils; import com.zhowin.miyou.R; import com.zhowin.miyou.base.BaseBindActivity; import com.zhowin.miyou.databinding.ActivityVerifiedBinding; /** * 实名认证 */ public class VerifiedActivity extends BaseBindActivity<ActivityVerifiedBinding> { @Override public int getLayoutId() { return R.layout.activity_verified; } @Override public void initView() { setOnClick(R.id.tvStartVerified); SpanUtils.with(mBinding.tvHitMessage) .appendLine("温馨提示:").setFontSize(16, true) .appendLine() .append("1.根据相关法律法规,在使用直播、提现服务之前,您需要填写身份信息进行实名认证;") .appendLine() .append("2.请您填写准确,真实的身份信息。请您明确,实名信息将被作为身份识别,判定您的账号使用归属的依据;") .appendLine() .append("3.您所提交的身份信息将被严格保密,不会被用于其他用途。") .create(); } @Override public void initData() { } @Override public void onClick(View v) { switch (v.getId()) { case R.id.tvStartVerified: startActivity(EditVerifiedActivity.class); ActivityManager.getAppInstance().finishActivity(); break; } } }
package com.tencent.mm.plugin.game.model; import android.content.Context; import android.content.Intent; import android.net.Uri; import com.tencent.mm.kernel.g; import com.tencent.mm.plugin.game.a.b; import com.tencent.mm.plugin.game.a.c; import com.tencent.mm.plugin.report.service.h; import com.tencent.mm.sdk.platformtools.ad; import com.tencent.mm.sdk.platformtools.bi; import com.tencent.mm.sdk.platformtools.x; import java.net.URI; public final class o { public static void a(s sVar, int i, int i2) { if (sVar == null) { ((b) g.l(b.class)).aSi(); sVar = v.aTZ(); if (sVar == null) { return; } } sVar.aTW(); x.i("MicroMsg.GameFloatUtil", "float layer report"); if (!bi.oW(sVar.jMI.url)) { int i3 = sVar.field_msgType; if (sVar.field_msgType == 100) { i3 = sVar.jNa; } an.a(ad.getContext(), 10, 1006, 1, 1, 0, sVar.field_appId, i, i3, sVar.field_gameMsgId, sVar.jNb, null); if (i2 == 1) { h.mEJ.a(858, 16, 1, false); } else if (i2 == 2) { h.mEJ.a(858, 17, 1, false); } sVar.field_isRead = true; ((c) g.l(c.class)).aSj().c(sVar, new String[0]); } ((b) g.l(b.class)).aSi(); v.aUa(); } public static String a(String str, s sVar) { boolean z; if (sVar != null) { sVar.aTW(); if (!bi.oW(sVar.jMI.url)) { z = true; x.i("MicroMsg.GameFloatUtil", "hasFloatLayer = " + z); if (z) { String str2; Uri parse = Uri.parse(str); String query = parse.getQuery(); if (query != null) { str2 = query + "&h5FloatLayer=1"; } else { str2 = "h5FloatLayer=1"; } try { str = new URI(parse.getScheme(), parse.getAuthority(), parse.getPath(), str2, parse.getFragment()).toString(); } catch (Throwable e) { x.printErrStackTrace("MicroMsg.GameFloatUtil", e, "", new Object[0]); } } x.i("MicroMsg.GameFloatUtil", "abtest, url = %s", new Object[]{str}); return str; } } z = false; x.i("MicroMsg.GameFloatUtil", "hasFloatLayer = " + z); if (z) { String str22; Uri parse2 = Uri.parse(str); String query2 = parse2.getQuery(); if (query2 != null) { str22 = query2 + "&h5FloatLayer=1"; } else { str22 = "h5FloatLayer=1"; } try { str = new URI(parse2.getScheme(), parse2.getAuthority(), parse2.getPath(), str22, parse2.getFragment()).toString(); } catch (Throwable e2) { x.printErrStackTrace("MicroMsg.GameFloatUtil", e2, "", new Object[0]); } } x.i("MicroMsg.GameFloatUtil", "abtest, url = %s", new Object[]{str}); return str; } public static void a(Context context, String str, String str2, boolean z, s sVar, int i) { if (!bi.oW(str)) { Intent intent = new Intent(); intent.putExtra("rawUrl", str); intent.putExtra("geta8key_scene", 32); intent.putExtra("KPublisherId", str2); intent.putExtra("game_check_float", z); if (z && sVar != null) { sVar.aTW(); if (sVar.jMI.jNf) { intent.putExtra("game_transparent_float_url", sVar.jMI.url); } intent.putExtra("game_sourceScene", i); } com.tencent.mm.plugin.game.e.c.x(intent, context); } } }
/* * Copyright (c) 2016. Universidad Politecnica de Madrid * * @author Badenes Olmedo, Carlos <cbadenes@fi.upm.es> * */ package org.librairy.modeler.lda.exceptions; /** * Created on 07/09/16: * * @author cbadenes */ public class EmptyResultException extends RuntimeException { public EmptyResultException(String msg){ super(msg); } }
import java.util.Scanner; class Main { static void inputNum() { System.out.println("Input number: "); } static void isPrime() { System.out.println("The number entered is prime!"); } static void notPrime() { System.out.println("The number entered is not a prime!"); } private static Scanner input; static int num; public static void main(String[] args) { boolean notPrime = false; inputNum(); try { input = new Scanner(System.in); } finally { num = input.nextInt(); } for (int i = 2; i <= num / 2; i++) { if(num % i == 0) { notPrime = true; break; } } if(!notPrime) { isPrime(); } else { notPrime(); } } }
package com.test; public class Car { private String model; private String company; private String driver; private int price; public Car() { super(); } public Car(String model, String company, String driver, int price) { super(); this.model = model; this.company = company; this.driver = driver; this.price = price; } public String getModel() { return model; } public void setModel(String model) { this.model = model; } public String getCompany() { return company; } public void setCompany(String company) { this.company = company; } public String getDriver() { return driver; } public void setDriver(String driver) { this.driver = driver; } public int getPrice() { return price; } public void setPrice(int price) { this.price = price; } }
package testMvn; import static org.junit.jupiter.api.Assertions.*; import org.junit.jupiter.api.Test; import entity.InsuredPerson; class InitialTest { @Test public void testInitial() { InsuredPerson one = new InsuredPerson(); String result = one.getInitial("Макаренко Светлана Ивановна"); assertEquals("Макаренко С.И.",result); } }
package com.nlpeng.entity; import java.io.Serializable; import java.util.Date; public class BrokerMessageLog implements Serializable { private String messageId; private String message; private Integer tryCount; private String status; private Date nextRetry; private Date createTime; private Date updateTime; private static final long serialVersionUID = 1L; public String getMessageId() { return messageId; } public void setMessageId(String messageId) { this.messageId = messageId; } public String getMessage() { return message; } public void setMessage(String message) { this.message = message; } public Integer getTryCount() { return tryCount; } public void setTryCount(Integer tryCount) { this.tryCount = tryCount; } public String getStatus() { return status; } public void setStatus(String status) { this.status = status; } public Date getNextRetry() { return nextRetry; } public void setNextRetry(Date nextRetry) { this.nextRetry = nextRetry; } public Date getCreateTime() { return createTime; } public void setCreateTime(Date createTime) { this.createTime = createTime; } public Date getUpdateTime() { return updateTime; } public void setUpdateTime(Date updateTime) { this.updateTime = updateTime; } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(getClass().getSimpleName()); sb.append(" ["); sb.append("Hash = ").append(hashCode()); sb.append(", messageId=").append(messageId); sb.append(", message=").append(message); sb.append(", tryCount=").append(tryCount); sb.append(", status=").append(status); sb.append(", nextRetry=").append(nextRetry); sb.append(", createTime=").append(createTime); sb.append(", updateTime=").append(updateTime); sb.append(", serialVersionUID=").append(serialVersionUID); sb.append("]"); return sb.toString(); } }
package com.gmail.merikbest2015.ecommerce.repos; import com.gmail.merikbest2015.ecommerce.domain.User; import org.springframework.data.jpa.repository.JpaRepository; /** * A repository for {@link User} objects providing a set of JPA methods for working with the database. * Inherits interface {@link JpaRepository}. * * @author Miroslav Khotinskiy (merikbest2015@gmail.com) * @version 1.0 * @see User * @see JpaRepository */ public interface UserRepository extends JpaRepository<User, Long> { /** * Returns the user from the database that has the same name as the value of the input parameter. * * @param username user name to return. * @return The {@link User} class object. */ User findByUsername(String username); /** * Returns the user from the database that has the same activation code as the value of the input parameter. * * @param code activation code to return. * @return The {@link User} class object. */ User findByActivationCode(String code); }
/** *Author Fys * *Time 2016-7-11-下午2:42:48 **/ package com.goldgov.dygl.module.partymemberrated.ratedexamlink.web; import java.util.List; import javax.servlet.http.HttpServletRequest; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import com.goldgov.dygl.module.partymemberrated.evaluation.service.EvaluationIndexQuery; import com.goldgov.dygl.module.partymemberrated.exam.domain.Exam; import com.goldgov.dygl.module.partymemberrated.exam.service.ExamQuery; import com.goldgov.dygl.module.partymemberrated.exam.service.IExamService; import com.goldgov.dygl.module.partymemberrated.ratedexamlink.domain.RatedExamBean; import com.goldgov.dygl.module.partymemberrated.ratedexamlink.service.IRatedExamService; import com.goldgov.gtiles.core.web.GoTo; import com.goldgov.gtiles.core.web.OperatingType; import com.goldgov.gtiles.core.web.annotation.ModelQuery; import com.goldgov.gtiles.core.web.annotation.ModuleOperating; import com.goldgov.gtiles.core.web.annotation.ModuleResource; import com.goldgov.gtiles.core.web.json.JsonObject; @RequestMapping("/module/partymemberrated/ratedexamlink") @Controller("ratedExamController") @ModuleResource(name="党员评价考试关联管理") public class RatedExamController { public static final String PAGE_BASE_PATH = "partymemberrated/ratedexamlink/web/pages/"; @Autowired @Qualifier("ratedExamServiceImpl") private IRatedExamService ratedExamService;//评价开始关联接口 @Autowired @Qualifier("examServiceImpl") private IExamService examService;//考试管理接口 @SuppressWarnings("unchecked") @RequestMapping("/findRatedExam") @ModuleOperating(name="信息查询",type=OperatingType.FindList) public String findRatedExam(@ModelQuery("query") EvaluationIndexQuery query,HttpServletRequest request,Model model) throws Exception{ ExamQuery examQuery = new ExamQuery(); examQuery.setCount(-1); examQuery.setSearchPublishStatus(Exam.PUBLIC); List<Exam> examList = examService.findInfoList(examQuery); query.setResultList(examList); String linkedExamId = ratedExamService.getExamIdByRatedId(query.getRATED_ID()); model.addAttribute("linkedExamId", linkedExamId); return new GoTo(this).sendPage("rateExamList.ftl"); } @RequestMapping("/saveRatedExamLink") public JsonObject saveRatedExamLink(HttpServletRequest request) throws Exception{ JsonObject result = new JsonObject(); String ratedId = request.getParameter("ratedId"); String examId = request.getParameter("examId"); String linkedExamId = request.getParameter("linkedExamId"); if(linkedExamId!=null && linkedExamId.equals(examId)){//未更换考试关联 result.setSuccess(true); }else{ RatedExamBean bean = ratedExamService.getBeanByRatedId(ratedId); if(bean==null){ bean = new RatedExamBean(); bean.setRatedId(ratedId); bean.setExamId(examId); ratedExamService.saveRateExam(bean); }else{ bean.setExamId(examId); ratedExamService.updateRatedExam(bean); } result.setSuccess(true); } return result; } }
package babylanguage.babyapp.learntotalk.memoryGame; import android.view.View; public interface OnMemoryCardClickListener { public void onClick(int cardId); }
package com.twoyears44.myclass; import android.app.Application; import android.content.ContentValues; import android.content.Context; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; /** * Created by twoyears44 on 16/4/26. */ public class BCDatabase { static SQLiteDatabase database; static public void initSetting() { Context context = BCApplication.getContext(); database = context.openOrCreateDatabase("db",context.MODE_PRIVATE,null); String userSQL = "CREATE TABLE IF NOT EXISTS user (" + "_id INTEGER PRIMARY KEY AUTOINCREMENT, " + "udid VARCHAR(128) NOT NULL, " + "nickname VARCHAR(64)," + "isSync BOOLEAN" + ")"; database.execSQL(userSQL); } }
package org.search.flight.dao; import java.util.ArrayList; import java.util.List; import java.util.Optional; import org.search.flight.model.Airport; public class AirportDAO { private List<Airport> airportList; public static final AirportDAO instance = new AirportDAO(); private AirportDAO(){ airportList = new ArrayList<Airport>(0); } public void addAirport(Airport airport) { airportList.add(airport); } public Optional<Airport> findAirportByIATA(String iATACode) { return airportList.stream().filter(a -> a.getIATACode().equals(iATACode)).findFirst(); } public boolean deleteAirport(String iATACode) { Optional<Airport> toDelete = findAirportByIATA(iATACode); if (toDelete.isPresent()) { airportList.remove(toDelete.get()); return true; } else { return false; } } public void deleteAll() { airportList.clear(); } public List<Airport> getAllAirports() { return airportList; } }
package com.blackvelvet.cybos.bridge.cpindexes ; import com4j.*; /** * IRawCpSeries 인터페이스 */ @IID("{2C6A064A-DE70-4AFD-AE57-2FD3A443CBA4}") public interface IRawCpSeries extends Com4jObject { // Methods: /** * <p> * method GetRawData * </p> * @param startIndex Optional parameter. Default value is 0 * @return Returns a value of type int */ @VTID(3) int getRawData( @Optional @DefaultValue("0") int startIndex); // Properties: }
package com.nosuchteam.controller; import com.nosuchteam.bean.RequestList; import com.nosuchteam.bean.Work; import com.nosuchteam.service.WorkService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import java.util.HashMap; import java.util.List; import java.util.Map; /** * yuexia * 2018/12/9 * 21:54 */ @Controller @RequestMapping("work") public class WorkController { @Autowired WorkService workService; @RequestMapping("list") @ResponseBody public Map<String,Object> findWorkList(RequestList requestList){ List<Work> rows = workService.findWrokList(requestList); int total = workService.findTotalWorkNum(); HashMap<String, Object> map = new HashMap(); map.put("total",total); map.put("rows",rows); return map; } @RequestMapping("get_data") @ResponseBody public List findWorkList(){ List<Work> allWork = workService.findAllWork(); return allWork; } @RequestMapping("find") public String workLocationController(){ return "plan_scheduling/work_list"; } @RequestMapping("add_judge") @ResponseBody public String addWork(){ return null; } @RequestMapping("add") public String showAddList(){ return "plan_scheduling/work_add"; } @RequestMapping("get/{workId}") @ResponseBody public Work findwork(@PathVariable("workId")String workId){ System.out.println(workId); return workService.selectByPrimaryKey(workId); } @RequestMapping("insert") @ResponseBody public Map insertWork(Work work){ HashMap<String, Object> map = new HashMap(); int i = workService.insertNewWork(work); if (i==1){ map.put("staus",200); map.put("msg","ok"); map.put("data",null); } return map; } @RequestMapping("edit_judge") @ResponseBody public Map editJudge(){ HashMap<Object, Object> map = new HashMap(); return map; } @RequestMapping("edit") public String editpage(){ return "plan_scheduling/work_edit"; } @RequestMapping("update_all") @ResponseBody public Map updateWork(Work work){ HashMap<Object, Object> map = new HashMap(); int i = workService.updateByPrimaryKeySelective(work); if (i==1){ map.put("status",200); map.put("msg","OK"); map.put("data",null); return map; } return null; } @RequestMapping("delete_judge") @ResponseBody public Map deleteJudge(){ HashMap<Object, Object> map = new HashMap(); return map; } @RequestMapping("delete_batch") @ResponseBody public Map deleteWork(String ids){ HashMap<Object, Object> map = new HashMap(); int i = workService.deleteByPrimaryKey(ids); if (i==1){ map.put("status",200); map.put("msg","OK"); map.put("data",null); return map; } return null; } }
package com.mapping.util; import java.sql.Connection; import java.sql.DriverManager; public class TestJdbc { public static void main(String[] args) { //String jdbcUrl="jdbc:postgresql://localhost:5432/personal"; String jdbcUrl="jdbc:postgresql://localhost:5432/personal"; //String jdbcUrl="jdbc:postgresql://localhost:5432/personal?useSSL=false"; // to bypass SSL warings String userName="postgres"; String passWord="sachin"; //String passWord="postgress"; try { System.err.println("Connecting Data base: "+ jdbcUrl); Connection con=DriverManager.getConnection(jdbcUrl, userName, passWord); System.err.println("Connection Successful"); } catch (Exception e) { System.err.println(e.getMessage()); } } }
// Write a Java program to sort a numeric array and a string array package excercie13; import java.text.DecimalFormat; import java.util.ArrayList; import java.util.List; import java.util.Scanner; public class example { public static void main(String[] args) { double somme =0 ; Scanner kb = new Scanner(System.in); ArrayList<Double> mylist = new ArrayList<Double>(); double i = 1.0; while (i !=0){ System.out.println("Write the price "); i = kb.nextDouble(); if (i !=0){ mylist.add(i); } } for(Double n :mylist){ System.out.println("Produit"+(mylist.indexOf(n)+1)+"............"+n); somme+=n; } DecimalFormat formatter = new DecimalFormat("#.###"); double tps = somme*0.05; double tvq = somme * 0.09975; double total = somme+tps+tvq; System.out.println(); System.out.println(); System.out.println(); System.out.println("Sous-total : "+formatter.format(somme)+"$"); System.out.println("TPS : "+formatter.format(tps)+"$"); System.out.println("TVQ : "+formatter.format(tvq)+"$"); System.out.println("total : "+formatter.format(total)+"$"); } }
package com.ocoolcraft.plugins.commands; import com.ocoolcraft.plugins.GMCRequest; public enum Command { GMCCommand(GMC.GMC_COMMAND,new GMC()), GMCAcceptCommand(GMCAccept.GMC_ACCEPT_COMMAND,new GMCAccept()), GMCDisplayCommand(GMCDisplay.GMC_DISPLAY_COMMAND,new GMCDisplay()), GMCRejectCommand(GMCReject.GMC_REJECT_COMMAND,new GMCReject()), RGMCCommand(RGMC.RGMC_COMMAND,new RGMC()); private String commandString; private AbstractCommand command; Command(String cmd, AbstractCommand abstractCommand) { this.commandString = cmd; this.command = abstractCommand; } public AbstractCommand getCommand() { return command; } public static void registerCommands(GMCRequest plugin) { for(Command command: Command.values()) { command.getCommand().setPlugin(plugin); plugin.getCommand(command.getCommandString()) .setExecutor(command.getCommand()); } } public String getCommandString() { return commandString; } }
/* * 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 Entidades; import java.util.List; /** * * @author rosemary */ public class entCabeceraPrePoda { private int id_cabecera_pre_poda; private int id_pre_poda; private int posicion; private int num_hilera; private int num_planta; private int num_salida_planta; private List<entDetallePrePoda> list; private Boolean seleccion; public entCabeceraPrePoda() { this.list = null; this.seleccion=false; } public int getId_cabecera_pre_poda() { return id_cabecera_pre_poda; } public void setId_cabecera_pre_poda(int id_cabecera_pre_poda) { this.id_cabecera_pre_poda = id_cabecera_pre_poda; } public int getId_pre_poda() { return id_pre_poda; } public void setId_pre_poda(int id_pre_poda) { this.id_pre_poda = id_pre_poda; } public List<entDetallePrePoda> getList() { return list; } public void setList(List<entDetallePrePoda> list) { this.list = list; } public int getNum_hilera() { return num_hilera; } public void setNum_hilera(int num_hilera) { this.num_hilera = num_hilera; } public int getNum_planta() { return num_planta; } public void setNum_planta(int num_planta) { this.num_planta = num_planta; } public int getNum_salida_planta() { return num_salida_planta; } public void setNum_salida_planta(int num_salida_planta) { this.num_salida_planta = num_salida_planta; } public Boolean isSeleccion() { return seleccion; } public void setSeleccion(Boolean seleccion) { this.seleccion = seleccion; } public int getPosicion() { return posicion; } public void setPosicion(int posicion) { this.posicion = posicion; } }
package in.aerem.AlicePlugin; import com.google.zxing.WriterException; import org.bukkit.Color; import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.block.Action; import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.event.server.MapInitializeEvent; import org.bukkit.map.MapRenderer; import org.bukkit.map.MapView; import org.bukkit.material.Lever; import org.bukkit.material.MaterialData; import org.bukkit.material.Wool; import org.eclipse.paho.client.mqttv3.IMqttClient; import java.util.logging.Logger; public class InteractListener implements Listener { private final Logger logger; private final LightsController lightsController; public InteractListener(Logger logger, IMqttClient mqttClient) { this.logger = logger; this.lightsController = new LightsController(mqttClient); } @EventHandler public void onPlayerInteract(PlayerInteractEvent event) { logger.info("onPlayerInteract"); if (event.getAction() == Action.RIGHT_CLICK_BLOCK && !event.isBlockInHand()) { logger.info(event.getClickedBlock().toString()); MaterialData matData = event.getClickedBlock().getState().getData(); if (matData instanceof Wool) { Wool wool = (Wool) matData; Color c = wool.getColor().getColor(); lightsController.setColor(c.getRed(), c.getGreen(), c.getBlue()); } else { logger.warning("Not a wool!"); } } Player player = event.getPlayer(); Block block = event.getClickedBlock(); if (block.getType().equals(Material.LEVER)) { Lever lever = (Lever) block.getState().getData(); if (lever.isPowered()) { lightsController.setColor(255, 0, 0); } else { lightsController.setColor(0, 255, 0); } } } @EventHandler public void onMapInitialize(MapInitializeEvent e) { logger.info("onMapInitialize"); MapView mapView = e.getMap(); for (MapRenderer r : mapView.getRenderers()) { mapView.removeRenderer(r); } try { mapView.addRenderer(new Renderer(logger)); } catch (WriterException e1) { logger.warning(e.toString()); } } }
/* * Copyright 2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.springframework.sync.operations; import org.junit.jupiter.api.Test; import org.springframework.sync.PatchException; import org.springframework.sync.Todo; import java.util.ArrayList; import java.util.List; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.fail; class MoveOperationTest { @Test void moveBooleanPropertyValue() { // initial Todo list List<Todo> todos = new ArrayList<>(); todos.add(new Todo(1L, "A", true)); todos.add(new Todo(2L, "B", false)); todos.add(new Todo(3L, "C", false)); try { MoveOperation move = new MoveOperation("/1/complete", "/0/complete"); move.perform(todos, Todo.class); fail(); } catch (PatchException e) { assertEquals("Path '/0/complete' is not nullable.", e.getMessage()); } assertFalse(todos.get(1).isComplete()); } @Test void moveStringPropertyValue() { // initial Todo list List<Todo> todos = new ArrayList<>(); todos.add(new Todo(1L, "A", true)); todos.add(new Todo(2L, "B", false)); todos.add(new Todo(3L, "C", false)); MoveOperation move = new MoveOperation("/1/description", "/0/description"); move.perform(todos, Todo.class); assertEquals("A", todos.get(1).getDescription()); } @Test void moveBooleanPropertyValueIntoStringProperty() { // initial Todo list List<Todo> todos = new ArrayList<>(); todos.add(new Todo(1L, "A", true)); todos.add(new Todo(2L, "B", false)); todos.add(new Todo(3L, "C", false)); try { MoveOperation move = new MoveOperation("/1/description", "/0/complete"); move.perform(todos, Todo.class); fail(); } catch (PatchException e) { assertEquals("Path '/0/complete' is not nullable.", e.getMessage()); } assertEquals("B", todos.get(1).getDescription()); } // // NOTE: Moving an item about in a list probably has zero effect, as the order of the list is // usually determined by the DB query that produced the list. Moving things around in a // java.util.List and then saving those items really means nothing to the DB, as the // properties that determined the original order are still the same and will result in // the same order when the objects are queries again. // @Test void moveListElementToBeginningOfList() { // initial Todo list List<Todo> todos = new ArrayList<>(); todos.add(new Todo(1L, "A", false)); todos.add(new Todo(2L, "B", true)); todos.add(new Todo(3L, "C", false)); MoveOperation move = new MoveOperation("/0", "/1"); move.perform(todos, Todo.class); assertEquals(3, todos.size()); assertEquals(2L, todos.get(0).getId().longValue()); assertEquals("B", todos.get(0).getDescription()); assertTrue(todos.get(0).isComplete()); } @Test void moveListElementToMiddleOfList() { // initial Todo list List<Todo> todos = new ArrayList<>(); todos.add(new Todo(1L, "A", true)); todos.add(new Todo(2L, "B", false)); todos.add(new Todo(3L, "C", false)); MoveOperation move = new MoveOperation("/2", "/0"); move.perform(todos, Todo.class); assertEquals(3, todos.size()); assertEquals(1L, todos.get(2).getId().longValue()); assertEquals("A", todos.get(2).getDescription()); assertTrue(todos.get(2).isComplete()); } @Test void moveListElementToEndOfList_usingIndex() { // initial Todo list List<Todo> todos = new ArrayList<>(); todos.add(new Todo(1L, "A", true)); todos.add(new Todo(2L, "B", false)); todos.add(new Todo(3L, "C", false)); MoveOperation move = new MoveOperation("/2", "/0"); move.perform(todos, Todo.class); assertEquals(3, todos.size()); assertEquals(1L, todos.get(2).getId().longValue()); assertEquals("A", todos.get(2).getDescription()); assertTrue(todos.get(2).isComplete()); } @Test void moveListElementToBeginningOfList_usingTilde() { // initial Todo list List<Todo> todos = new ArrayList<>(); todos.add(new Todo(1L, "A", true)); todos.add(new Todo(3L, "C", false)); todos.add(new Todo(4L, "E", false)); todos.add(new Todo(2L, "G", false)); List<Todo> expected = new ArrayList<>(); expected.add(new Todo(1L, "A", true)); expected.add(new Todo(2L, "G", false)); expected.add(new Todo(3L, "C", false)); expected.add(new Todo(4L, "E", false)); MoveOperation move = new MoveOperation("/1", "/~"); move.perform(todos, Todo.class); assertEquals(expected, todos); } @Test void moveListElementToEndOfList_usingTilde() { // initial Todo list List<Todo> todos = new ArrayList<>(); todos.add(new Todo(1L, "A", true)); todos.add(new Todo(2L, "G", false)); todos.add(new Todo(3L, "C", false)); todos.add(new Todo(4L, "E", false)); List<Todo> expected = new ArrayList<>(); expected.add(new Todo(1L, "A", true)); expected.add(new Todo(3L, "C", false)); expected.add(new Todo(4L, "E", false)); expected.add(new Todo(2L, "G", false)); MoveOperation move = new MoveOperation("/~", "/1"); move.perform(todos, Todo.class); assertEquals(expected, todos); } }
package com.company; public class Main { public static int calculatemultiple (int numberOne, int numberTwo) { return numberOne * numberTwo; } public static void main(String[] args) { // write your code here int myFirstNumber = 3; int mySecondNumber = 5; System.out.println(calculatemultiple(3,5)); public static int calculateSum (int numberOne, int numberTwo); return numberOne + numberTwo; } public static void main(String[] args) { int myFirstNumber =5; int mySecondNumber = 5; System.out.println (calculatemultiple( int numberOne:5, int numberTwo:5); return numberOne * numberTwo; } }
public MultimediaElement { public String status; public int volume; public int brightness; }
package com.example.mvvmlivedatabindingexample; import android.view.View; import androidx.lifecycle.LiveData; import androidx.lifecycle.MutableLiveData; import androidx.lifecycle.ViewModel; public class LoginViewModel extends ViewModel { public MutableLiveData<String> email = new MutableLiveData<>(); public MutableLiveData<String> password = new MutableLiveData<>(); public MutableLiveData<Integer> busy; public final MutableLiveData<String> errorEmail = new MutableLiveData<>(); public final MutableLiveData<String> errorPassword = new MutableLiveData<>(); private MutableLiveData<User> userMutableLiveData; public LoginViewModel() { } public MutableLiveData<User> getUser() { if(userMutableLiveData == null) { userMutableLiveData = new MutableLiveData<>(); } return userMutableLiveData; } public LiveData<Integer> getBusy() { if(busy == null) { busy = new MutableLiveData<>(); busy.setValue(8); } return busy; } public void OnLoginClicked(View view) { busy.setValue(0); User user = new User(email.getValue(), password.getValue()); if (!user.isEmailValid()) { errorEmail.setValue("Enter a valid email address"); } else { errorEmail.setValue(null); } if (!user.isPasswordLengthGreaterThan5()) errorPassword.setValue("Password Length should be greater than 5"); else { errorPassword.setValue(null); } userMutableLiveData.setValue(user); busy.setValue(8); } }
package com.kps.videoplayer; public interface SliderListener { void valueChanged(boolean isAdjusting); }
package com.udian; import org.springframework.boot.SpringApplication; import org.springframework.boot.WebApplicationType; import org.springframework.boot.autoconfigure.SpringBootApplication; /** * Hello world! * */ @SpringBootApplication //@MapperScan("com.udian.**.mapper") public class App { public static void main( String[] args ) { SpringApplication app = new SpringApplication(App.class); app.setWebApplicationType(WebApplicationType.REACTIVE); app.run(); } }
package co.nos.noswallet.ui.home.v2.historyData; import android.support.annotation.Nullable; import java.util.ArrayList; import javax.inject.Inject; import co.nos.noswallet.network.nosModel.AccountHistory; import co.nos.noswallet.network.nosModel.SocketResponse; import co.nos.noswallet.network.websockets.SafeCast; import co.nos.noswallet.network.websockets.WebsocketMachine; import co.nos.noswallet.persistance.IndexedWallet; import co.nos.noswallet.persistance.currency.CryptoCurrency; import co.nos.noswallet.util.Extensions; import co.nos.noswallet.util.SharedPreferencesUtil; import io.reactivex.Observable; public class GetAccountHistoryUseCase { public static final String TAG = GetAccountHistoryUseCase.class.getSimpleName(); public static final String ACCOUNT_HISTORY = "ACCOUNT_HISTORY"; private final SharedPreferencesUtil sharedPreferencesUtil; private final AccountHistoryMapper accountHistoryMapper; @Inject public GetAccountHistoryUseCase(SharedPreferencesUtil sharedPreferencesUtil, AccountHistoryMapper accountHistoryMapper) { this.sharedPreferencesUtil = sharedPreferencesUtil; this.accountHistoryMapper = accountHistoryMapper; } @Nullable private SocketResponse resolveCachedHistory(CryptoCurrency cryptoCurrency, int index) { String historyJson = sharedPreferencesUtil.get(ACCOUNT_HISTORY + cryptoCurrency.name() + "_" + index, null); SocketResponse response = SafeCast.safeCast(historyJson, SocketResponse.class); return response; } public Observable<ArrayList<AccountHistory>> execute(WebsocketMachine machine, CryptoCurrency cryptoCurrency, IndexedWallet indexedWallet) { int index = indexedWallet.getIndex(); SocketResponse cachedHistory = resolveCachedHistory(cryptoCurrency, index); if (cachedHistory == null) { return fresh(machine, cryptoCurrency, indexedWallet) .map(accountHistoryMapper::transform); } else { return cached(cachedHistory) .concatWith(fresh(machine, cryptoCurrency, indexedWallet)) .map(accountHistoryMapper::transform) .distinctUntilChanged(); } } private Observable<SocketResponse> cached(SocketResponse socketResponse) { return Observable.fromCallable(() -> socketResponse); } private Observable<SocketResponse> fresh(WebsocketMachine machine, CryptoCurrency cryptoCurrency, IndexedWallet indexedWallet) { String accountNumber = indexedWallet.provideAccountNumber(cryptoCurrency); int index = indexedWallet.getIndex(); return machine.observeAccountData(cryptoCurrency, accountNumber) .filter(SocketResponse::isHistoryResponse) .onErrorResumeNext(Observable.empty()) .map(socketResponse -> { persistAccountHistoryResponse(cryptoCurrency, index, socketResponse); return socketResponse; }); } private void persistAccountHistoryResponse(CryptoCurrency currency, int index, SocketResponse historyResponse) { sharedPreferencesUtil.set(ACCOUNT_HISTORY + currency.name() + "_" + index, Extensions.GSON.toJson(historyResponse)); } }
package a.b.c; import android.app.Activity; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.ArrayAdapter; import android.widget.ListView; import android.widget.Spinner; //import farmFriends.States; //import farmFriends.main; public class First extends Activity { // @Override String[] st = new String[] {"offline" , "online"}; protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.first); ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, st); ListView listview = (ListView) findViewById(R.id.OnOff); // listview.setAdapter(adapter); listview.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) { // TODO Auto-generated method stub if(arg2==1) { Intent intent =new Intent(First.this,States.class); startActivity(intent); } if(arg2==0) { String url="tel:08039511963"; Intent intent=new Intent (Intent.ACTION_CALL,Uri.parse(url)); startActivity(intent); } } }); } }
package com.tencent.mm.plugin.location.ui.impl; import android.content.DialogInterface; import android.content.DialogInterface.OnCancelListener; class i$7 implements OnCancelListener { final /* synthetic */ i kKy; i$7(i iVar) { this.kKy = iVar; } public final void onCancel(DialogInterface dialogInterface) { this.kKy.kHV = false; } }
package com.sdl.webapp.tridion.query; /** * <p>BrokerQueryException class.</p> */ public class BrokerQueryException extends Exception { /** * <p>Constructor for BrokerQueryException.</p> */ public BrokerQueryException() { } /** * <p>Constructor for BrokerQueryException.</p> * * @param message a {@link java.lang.String} object. */ public BrokerQueryException(String message) { super(message); } /** * <p>Constructor for BrokerQueryException.</p> * * @param message a {@link java.lang.String} object. * @param cause a {@link java.lang.Throwable} object. */ public BrokerQueryException(String message, Throwable cause) { super(message, cause); } /** * <p>Constructor for BrokerQueryException.</p> * * @param cause a {@link java.lang.Throwable} object. */ public BrokerQueryException(Throwable cause) { super(cause); } /** * <p>Constructor for BrokerQueryException.</p> * * @param message a {@link java.lang.String} object. * @param cause a {@link java.lang.Throwable} object. * @param enableSuppression a boolean. * @param writableStackTrace a boolean. */ public BrokerQueryException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) { super(message, cause, enableSuppression, writableStackTrace); } }
execute(des, src, registers, memory) { int DWORD = 32; // Destination is always r32 String desValue = registers.get(des); String srcValue = ""; // Check if the src is either r32 or m32 if ( src.isRegister() ) { srcValue = registers.get(src); } else if ( src.isMemory() ) { srcValue = memory.read(src, DWORD); } Calculator calculator = new Calculator(registers, memory); EFlags eFlags = registers.getEFlags(); // Addition of Unsigned plus Overflow Flag BigInteger biDesValue = new BigInteger(desValue, 16); BigInteger biSrcValue = new BigInteger(srcValue, 16); BigInteger biResult = biDesValue.add(biSrcValue); // Check if Overflow Flag == 1 if ( eFlags.getOverflowFlag().equals("1") ) { BigInteger biAddPlusOne = BigInteger.valueOf(new Integer(1).intValue()); biResult = biResult.add(biAddPlusOne); } // Checks the length of the result to fit the destination if ( biResult.toString(16).length() > DWORD/4 ) { registers.set( des, biResult.toString(16).substring(1) ); } else { registers.set( des, biResult.toString(16) ); } // Checks if Overflow Flag is affected String desBinaryValue = biDesValue.toString(2); String srcBinaryValue = biSrcValue.toString(2); String resultBinaryValue = biResult.toString(2); char desMSB = calculator.binaryZeroExtend(desBinaryValue, des).charAt(0); char srcMSB = calculator.binaryZeroExtend(srcBinaryValue, src).charAt(0); char resultMSB = calculator.binaryZeroExtend(resultBinaryValue, des).charAt(0); String overflowFlag = calculator.checkOverflowAddWithFlag( srcMSB, desMSB, resultMSB, eFlags.getOverflowFlag() ); eFlags.setOverflowFlag( overflowFlag ); }
/* * Copyright (C) 2010-2012, Wan Lee, wan5332@gmail.com * Source can be obtained from git://github.com/wanclee/datashaper.git * BSD-style license. Please read license.txt that comes with source files */ /** * Utility for handling Double-related processing */ package com.psrtoolkit.datashaper.util; import com.psrtoolkit.datashaper.exception.DataShaperException; /** * @author Wan * */ public class DoubleUtil { private DoubleUtil() { } /** * Utilize Float.parseFloat to return Float value * * @param doubleStr string containing the digits * @param minValue minimum valid value * @param maxValue maximum valid value * @param context context variable string arguments that provides the * context of the call * @return throws DataShaperException runtime exception */ public static double parseDouble(String doubleStr, double minValue, double maxValue, String... context) { double size = 0; try { size = Double.parseDouble(doubleStr); if (size < minValue || size > maxValue) { StringBuilder message = new StringBuilder(StringUtil.BUFFER_SIZE_100); message.append("Error: The value '").append(doubleStr).append("'"); if (size < minValue) { message.append(" is smaller than the minimum value of ").append(minValue); } else { message.append(" is greater than the maximum value of ").append(maxValue); } message.append(".").append(" Found in ").append(StringUtil.constructTrailingMsg(context)); throw new DataShaperException(message.toString()); } return size; } catch (NumberFormatException ex) { StringBuilder message = new StringBuilder(StringUtil.BUFFER_SIZE_100); message.append("Error: invalid value '").append(doubleStr).append("' found in '").append(StringUtil.constructTrailingMsg(context)); throw new DataShaperException(message.toString(), ex); } } }
package com.tencent.mm.e.c; import com.tencent.mm.e.b.g.a; import com.tencent.mm.sdk.platformtools.x; import java.util.concurrent.TimeUnit; final class d$a implements Runnable { final /* synthetic */ d bFQ; public final void run() { while (true) { boolean z; synchronized (this.bFQ) { z = this.bFQ.bFD; } x.d("MicroMsg.SpeexWriter", "ThreadSpeex in: " + z + " queueLen: " + this.bFQ.bFC.size()); if (!z || !this.bFQ.bFC.isEmpty()) { try { a aVar = (a) this.bFQ.bFC.poll(200, TimeUnit.MILLISECONDS); if (aVar == null) { x.e("MicroMsg.SpeexWriter", "poll byteBuf is null, " + this.bFQ.bFE); } else { this.bFQ.a(aVar, 0, false); } } catch (InterruptedException e) { x.i("MicroMsg.SpeexWriter", "ThreadSpeex poll null"); } } else { return; } } while (true) { } } }
package co.edu.banco.model; public enum TipoTransaccion { ABRIR_CUENTA, ABRIR_BOLSILLO, CANCELAR_BOLSILLO, CANCELAR_CUENTA, DEPOSITAR, RETIRAR, TRASLADAR, CONSULTAR; }
package sort_algorithm; public class HeapSortTest { public static void main(String[] args){ HeapSort heap = new HeapSort(10); heap.insert(80); heap.insert(75); heap.insert(60); heap.insert(68); heap.insert(55); heap.insert(40); heap.insert(52); heap.insert(67); heap.printHeap(); heap.sort(); heap.printHeap(); } }
/* * 文 件 名: ImageShowRequest.java * 描 述: ImageShowRequest.java * 时 间: 2013-6-21 */ package com.babyshow.rest.imageshow; import javax.validation.constraints.NotNull; import javax.validation.constraints.Size; import org.hibernate.validator.constraints.Range; import com.babyshow.rest.RestRequest; /** * <一句话功能简述> * * @author ztc * @version [BABYSHOW V1R1C1, 2013-6-21] */ public class ImageShowRequest extends RestRequest { /** * 设备ID */ @NotNull(message = "{user.deviceid.null}") @Size(min = 1, max = 64, message = "{user.deviceid.length}") private String device_id; /** * 照片返回个数 */ @Range(min = 1, max = 100, message = "{image.count.length}") private Integer count; /** * 照片样式 */ private int image_style; /** * 获取 device_id * * @return 返回 device_id */ public String getDevice_id() { return device_id; } /** * 设置 device_id * * @param 对device_id进行赋值 */ public void setDevice_id(String device_id) { this.device_id = device_id; } /** * 获取 image_style * * @return 返回 image_style */ public int getImage_style() { return image_style; } /** * 设置 image_style * * @param 对image_style进行赋值 */ public void setImage_style(int image_style) { this.image_style = image_style; } /** * 获取 count * * @return 返回 count */ public Integer getCount() { return count; } /** * 设置 count * * @param 对count进行赋值 */ public void setCount(Integer count) { this.count = count; } }
package com.agong.demo; import com.google.gson.Gson; import com.google.gson.reflect.TypeToken; import java.io.Reader; import java.lang.reflect.Type; public class JsonUtil { @SuppressWarnings("unchecked") public static <T> T json2object(String json, TypeToken<T> typeToken) { try { Gson gson=new Gson(); return (T)gson.fromJson(json, typeToken.getType()); } catch (Exception e) { } return null; } @SuppressWarnings("unchecked") public static <T> T json2object(String json, Type type) { try { Gson gson=new Gson(); return (T)gson.fromJson(json, type); } catch (Exception e) { } return null; } @SuppressWarnings("unchecked") public static <T> T json2object(Reader charStream, TypeToken<T> typeToken) { try { Gson gson=new Gson(); return (T)gson.fromJson(charStream, typeToken.getType()); } catch (Exception e) { } return null; } public static <T> Object json2object(String json, TypeReference<T> t) { try { Gson gson=new Gson(); return gson.fromJson(json, t.getType()); } catch (Exception e) { } return null; } /** * java对象转为json对象 */ public static String object2json(Object obj){ Gson gson=new Gson(); return gson.toJson(obj); } }
package pt.ipleiria.helprecycle.gps; import com.google.firebase.database.IgnoreExtraProperties; @IgnoreExtraProperties public class GPSPoint { public float latitude; public float longitude; public GPSPoint() {} public GPSPoint(float latitude, float longitude) { this.latitude = latitude; this.longitude = longitude; } public float getLongitude() { return longitude; } public void setLongitude(float longitude) { this.longitude = longitude; } public float getLatitude() { return latitude; } public void setLatitude(float latitude) { this.latitude = latitude; } }
package egovframework.example.sample.web; class Parent{ public void show(){ System.out.println("parent"); } } class Child extends Parent{ public void show(){ System.out.println("child"); } } public class helloJAva { public static void main(String[] args) { int []a = new int[8]; int i=0; int n=10; while(i<8){ a[i++] = n%2; n /= 2; } for(i=7; i>=0; i--){ System.out.print(a[i]); } } }
package b.d; public final class a$a { private a$a() { } public /* synthetic */ a$a(byte b) { this(); } }
package leecode.链表; import java.util.List; public class K个一组翻转链表_25 { //参考翻转单向链表和翻转部分单向链表递归写法 labuladong公众号 public ListNode reverseKGoup(ListNode head,int k){ if(head==null){ return null;//这个是返回空 } ListNode a=head;//使用a,b!!不直接使用head ListNode b=head; for (int i = 0; i <k ; i++) { //不够k个,不用翻转 if(b==null) return head; //return head!!! b=b.next; } //此时b是k+1个元素,反转[a,b) //翻转前k个元素 //传入的是a ListNode newHead=reverse(a,b);//reverse(a,b)这个应该是反转前k的节点的非递归形式。先找到第k+1个节点b //递归翻转b后面的链表和a连起来 a.next=reverseKGoup(b,k);//是a.next 不是 newhead.next,传入的是b,不是b.next return newHead; } public ListNode reverse(ListNode a,ListNode b){ //翻转a开头的单链表,就是翻转a到null之间的节点,现在翻转a到b之间([a,b))的节点,就是把null改为b ListNode pre=null;//pre为空 不是b ListNode next=null; ListNode cur=a;//这个使用cur,不要直接使用a,会改变a的指针 while (cur!=b){ next=cur.next; cur.next=pre; pre=cur; cur=next; } return pre; } //迭代解法 //https://leetcode-cn.com/problems/reverse-nodes-in-k-group/solution/tu-jie-kge-yi-zu-fan-zhuan-lian-biao-by-user7208t/ public ListNode reverseKGroup(ListNode head, int k) { if(head==null||head.next==null){ return head; } ListNode dummy=new ListNode(0); //假节点的next指向head。 // dummy->1->2->3->4->5 dummy.next=head; //一共四个指针 pre指每次要翻转的链表的头结点的上一个节点。 // end指每次要翻转的链表的尾节点 // next反转链表后继,便于连接 // start反转链表的头节点 ListNode pre=dummy; ListNode end=dummy; while (end.next!=null){ for (int i = 0; i <k ; i++) { if(end==null){//如果end==null,即需要翻转的链表的节点数小于k,不执行翻转。 break; } end=end.next; } if(end==null){//这儿也要判断!! break; } //先记录下end.next,(3)方便后面链接链表 ListNode next=end.next; //然后断开链表 end.next=null;//为空后,后面反转start才能变成只传一个参数 //记录下要翻转链表的头节点 ListNode start=pre.next; //翻转链表,pre.next指向翻转后的链表。1->2 变成2->1。 dummy->2->1 // start指向1,反转完后链表的结构变了,但是start还是指向1,而不是2!! //返回值是end节点 pre.next=reverse_list(start); //翻转后头节点变到最后。通过.next把断开的链表重新链接。dummy->2->1 3->4->.... //连接 1和3 start.next=next;//start反转时候移动到了尾部 //将pre换成下次要翻转的链表的头结点的上一个节点。即start pre=start; //翻转结束,将end置为下次要翻转的链表的头结点的上一个节点。即start end=start;//end又移动k步,end=start和初始化end为dummy保持一致 } return dummy.next; } public ListNode reverse_list(ListNode head){//直接改变start!!不要用cur,用cur也是正确的 ListNode pre=null; ListNode next=null; while (head!=null){ next=head.next; head.next=pre; pre=head; head=next; } return pre; } }
/** * */ package uk.gov.hmcts.befta.factory; import uk.gov.hmcts.befta.TestAutomationAdapter; import uk.gov.hmcts.befta.data.HttpTestData; import uk.gov.hmcts.befta.player.BackEndFunctionalTestScenarioContext; import uk.gov.hmcts.befta.util.DynamicValueInjector; /** * @author korneleehenry * */ public class DynamicValueInjectorFactory { private DynamicValueInjectorFactory() {} public static DynamicValueInjector create(TestAutomationAdapter taAdapter, HttpTestData testData, BackEndFunctionalTestScenarioContext scenarioContext) { return new DynamicValueInjector(taAdapter, testData, scenarioContext); } }
/** * Contiene le classi per la gestione della logia della cassa e degli eventi associati */ package business.cassa;
/* 1: */ package com.kaldin.common.util; /* 2: */ /* 3: */ import java.io.File; /* 4: */ import java.io.FileInputStream; /* 5: */ import java.util.Properties; /* 6: */ import javax.naming.InitialContext; /* 7: */ import javax.sql.DataSource; /* 8: */ import org.hibernate.Session; /* 9: */ import org.hibernate.SessionFactory; /* 10: */ import org.hibernate.Transaction; /* 11: */ import org.hibernate.cfg.Configuration; /* 12: */ /* 13: */ public class HibernateUtil /* 14: */ { /* 15: */ private static final SessionFactory sessionfactory; /* 16: */ /* 17: */ static /* 18: */ { /* 19: 26 */ Configuration cfg = new Configuration(); /* 20: 27 */ DataSource ds = null; /* 21: */ try /* 22: */ { /* 23: 29 */ InitialContext ic = new InitialContext(); /* 24: 30 */ String dataSourceName = (String)ic.lookup("java:comp/env/DataSourceName"); /* 25: 31 */ ds = (DataSource)ic.lookup("java:comp/env/jdbc/" + dataSourceName); /* 26: 33 */ if (ds.getConnection() != null) { /* 27: 34 */ cfg.setProperty("hibernate.dialect", "org.hibernate.dialect.MySQLDialect").setProperty("hibernate.connection.datasource", "java:comp/env/jdbc/kaldin"); /* 28: */ } /* 29: */ } /* 30: */ catch (Exception exception) {} /* 31: */ try /* 32: */ { /* 33: 44 */ if ((ds == null) || (ds.getConnection() == null)) /* 34: */ { /* 35: 46 */ File file = new File(System.getProperty("user.home") + File.separatorChar + "kaldin.properties"); /* 36: 47 */ FileInputStream input = new FileInputStream(file); /* 37: */ /* 38: 49 */ Properties properties = new Properties(); /* 39: 50 */ properties.load(input); /* 40: */ try /* 41: */ { /* 42: 53 */ input.close(); /* 43: */ } /* 44: */ catch (Exception ex) {} /* 45: 57 */ cfg.setProperty("hibernate.connection.driver_class", "com.mysql.jdbc.Driver").setProperty("hibernate.connection.url", properties.getProperty("mdburl") + properties.getProperty("mdbname") + "?useUnicode=true&amp;characterEncoding=utf-8").setProperty("hibernate.dialect", "org.hibernate.dialect.MySQLDialect").setProperty("hibernate.connection.pool_size", "50").setProperty("hibernate.connection.username", properties.getProperty("mdbuser")).setProperty("hibernate.connection.CharSet", "utf8").setProperty("hibernate.connection.characterEncoding", "utf8").setProperty("hibernate.connection.useUnicode", "true").setProperty("hibernate.connection.password", properties.getProperty("mdbpassword")).setProperty("connection.autoReconnect", "true").setProperty("connection.autoReconnectForPools", "true").setProperty("hibernate.c3p0.preferredTestQuery", "SELECT 1").setProperty("hibernate.c3p0.testConnectionOnCheckout", "true"); /* 46: */ } /* 47: */ } /* 48: */ catch (Exception ex) /* 49: */ { /* 50: 72 */ ex.printStackTrace(); /* 51: */ } /* 52: 75 */ sessionfactory = cfg.configure().buildSessionFactory(); /* 53: */ } /* 54: */ /* 55: */ public static SessionFactory getSessionFactory() /* 56: */ { /* 57: 84 */ return sessionfactory; /* 58: */ } /* 59: */ /* 60: */ public static Transaction getTrascation(Session sesObj) /* 61: */ { /* 62: 95 */ return sesObj.beginTransaction(); /* 63: */ } /* 64: */ /* 65: */ public static Session getSession() /* 66: */ { /* 67:104 */ return getSessionFactory().openSession(); /* 68: */ } /* 69: */ } /* Location: C:\Java Work\Workspace\Kaldin\WebContent\WEB-INF\classes\com\kaldin\kaldin_java.zip * Qualified Name: kaldin.common.util.HibernateUtil * JD-Core Version: 0.7.0.1 */
package com.keithsmyth.testdealdetailsharness.header; import com.keithsmyth.testdealdetailsharness.model.Deal; class HeaderModel { final String title; HeaderModel(Deal deal) { this.title = deal.title; } }
package com.drzewo97.ballotbox.panel.controller.committee; import com.drzewo97.ballotbox.core.model.committee.Committee; import com.drzewo97.ballotbox.core.model.committee.CommitteeRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.validation.BindingResult; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import javax.validation.Valid; @Controller @RequestMapping(path = "/panel/committee/create") public class CommitteeCreationController { @Autowired private CommitteeRepository committeeRepository; @ModelAttribute("committee") private Committee committee(){ return new Committee(); } @GetMapping private String showCommitteeCreate(Model model){ return "panel/committee_create"; } @PostMapping private String createCommittee(@ModelAttribute("committee") @Valid Committee committee, BindingResult result){ if(committeeRepository.existsByName(committee.getName())){ result.rejectValue("name", "name.exist", "Committee already exists."); } if(result.hasErrors()){ return "panel/committee_create"; } committee.setVotesPlaced(0); committee.setSeatsGranted(0); committeeRepository.save(committee); return "redirect:create?success"; } }
package sbe.builder; import org.junit.Assert; import org.junit.Test; import sbe.msg.*; import uk.co.real_logic.agrona.DirectBuffer; /** * Created by dharmeshsing on 18/02/17. */ public class NewOrderBuilderTest { private NewOrderBuilder newOrderBuilder = new NewOrderBuilder(); @Test public void testNewOrder(){ LogonBuilder logonBuilder = new LogonBuilder(); DirectBuffer buffer = createNewOrder(1200, 2500, SideEnum.Buy, OrdTypeEnum.Limit); Assert.assertNotNull(buffer); } public DirectBuffer createNewOrder(long volume, long price,SideEnum side,OrdTypeEnum orderType){ String clientOrderId = "1234"; DirectBuffer directBuffer = newOrderBuilder.compID(1) .clientOrderId(clientOrderId) .account("account123".getBytes()) .capacity(CapacityEnum.Agency) .cancelOnDisconnect(CancelOnDisconnectEnum.DoNotCancel) .orderBook(OrderBookEnum.Regular) .securityId(1) .traderMnemonic("John") .orderType(orderType) .timeInForce(TimeInForceEnum.Day) .expireTime("20150813-23:00:00".getBytes()) .side(side) .orderQuantity((int) volume) .displayQuantity((int) volume) .minQuantity(0) .limitPrice(price) .stopPrice(0) .build(); return directBuffer; } }
package com.iceteck.silicompressorr; import com.iceteck.silicompressorr.videocompression.MediaController; /** * @author Toure, Akah L * @version 1.1.1 * Created by Toure on 28/03/2016. */ public class VideoCompressor { /** * Perform background video compression. Make sure the videofileUri and destinationUri are valid * resources because this method does not account for missing directories hence your converted file * could be in an unknown location * This uses default values for the converted videos * * @param videoFilePath source path for the video file * @param outputPath output path that converted file should be saved * @return The Path of the compressed video file */ public static boolean compressVideo(String videoFilePath, String outputPath) { return compressVideo(videoFilePath, outputPath, 0, 0, 0); } /** * Perform background video compression. Make sure the videofileUri and destinationUri are valid * resources because this method does not account for missing directories hence your converted file * could be in an unknown location * * @param videoFilePath source path for the video file * @param outputPath output path that converted file should be saved * @param outWidth the target width of the compressed video or 0 to use default width * @param outHeight the target height of the compressed video or 0 to use default height * @param bitrate the target bitrate of the compressed video or 0 to user default bitrate * @return The Path of the compressed video file */ public static boolean compressVideo(String videoFilePath, String outputPath, int outWidth, int outHeight, int bitrate) { return new MediaController().compressVideo(videoFilePath, outputPath, outWidth, outHeight, bitrate); } }
package com.uinsk.mobileppkapps.connection; import android.content.Context; import com.loopj.android.http.AsyncHttpClient; import com.loopj.android.http.AsyncHttpResponseHandler; import com.loopj.android.http.RequestParams; import cz.msebera.android.httpclient.entity.StringEntity; public class PropClient { private static final String BASE_URL = "https://api-ppkapps.herokuapp.com/api/v1/"; private static AsyncHttpClient client = new AsyncHttpClient(); public static void get(String url, RequestParams params, AsyncHttpResponseHandler responseHandler) { client.addHeader("Accept", "application/json"); client.get(getAbsoluteUrl(url), params, responseHandler); } public static void post(String url, RequestParams params, AsyncHttpResponseHandler responseHandler) { client.addHeader("Accept", "application/json"); client.post(getAbsoluteUrl(url), params, responseHandler); } private static String getAbsoluteUrl(String relativeUrl) { String url = BASE_URL + relativeUrl; System.out.println("URL : "+url); return url; } }
package com.jasoftsolutions.mikhuna.activity.fragment; import android.os.Bundle; import android.support.v4.app.Fragment; import android.support.v7.widget.GridLayout; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import com.jasoftsolutions.mikhuna.R; import com.jasoftsolutions.mikhuna.domain.Weekday; import com.jasoftsolutions.mikhuna.util.ExceptionUtil; import java.util.List; /** * Created by pc07 on 28/03/14. */ public class RestaurantTimetableDayFragment extends Fragment { private static final String TAG = RestaurantTimetableDayFragment.class.getSimpleName(); private int weekday; private List<String[]> timetable; @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.fragment_restaurant_timetable_day, container, false); if (savedInstanceState == null) { render(rootView); } return rootView; } public void display(int w, List<String[]> tt) { weekday = w; timetable = tt; refresh(); } public void refresh() { View rootView = getView(); if (rootView != null) { render(rootView); } } private void render(View rootView) { try { if (rootView != null) { if (weekday == 0) { return; } TextView weekdayText = (TextView) rootView.findViewById(R.id.weekday_text); weekdayText.setText(getString(Weekday.getFromId(weekday).getResourceId())); GridLayout gl = (GridLayout) rootView.findViewById(R.id.weekday_timetable); for (String[] hour : timetable) { String hourStr = hour[0] + " - " + hour[1]; TextView hourView = new TextView(this.getActivity()); hourView.setText(hourStr); gl.addView(hourView); } // Map<Integer, List<String[]>> rtt = rm.getParsedTimetableFor(r); // // LinearLayout timetableLayout = (LinearLayout)rootView.findViewById(R.id.restaurant_detail_timetable_layout); // if (r.getLastUpdate() != null && r.getLastUpdate() > 0) { // String timeTableWeekdayStr="-", timeTableTimeStr=""; // int weekdayTextViewBoldStart=0, weekdayTextViewBoldEnd=0; // if (r.getRestaurantTimetables()!=null && r.getRestaurantTimetables().size()>0) { // timeTableWeekdayStr=""; timeTableTimeStr=""; // Weekday today = DateUtil.getCurrentWeekday(); // Context context = getActivity(); // // tomar el primer día (se sabe que tiene al menos 1 debido a la condición previa) // // int lastDay = restaurant.getRestaurantTimetables().get(0).getWeekday(); // int lastDay = 0; // for (RestaurantTimetable timetable : r.getRestaurantTimetables()) { // String timeStrToAdd = timetable.getStartTime() + " - " + timetable.getFinishTime(); // if (lastDay != timetable.getWeekday()) { // String dayToAdd = context.getString(Weekday.getFromId(timetable.getWeekday()).getResourceId()) + ":\n"; // if (timetable.getWeekday() == today.getId()) { // weekdayTextViewBoldStart = timeTableWeekdayStr.length(); // weekdayTextViewBoldEnd = weekdayTextViewBoldStart + dayToAdd.length(); // } // timeTableWeekdayStr += dayToAdd; // timeTableTimeStr += "\n" + timeStrToAdd; // } else { // timeTableTimeStr += " " + timeStrToAdd; // } // lastDay = timetable.getWeekday(); // } // // omitir el primer espacio // timeTableTimeStr = timeTableTimeStr.substring(1); // } // TextView timetableWeekdayTextView=(TextView)rootView.findViewById(R.id.restaurant_detail_timetable_weekday); // if (weekdayTextViewBoldStart != 0 || weekdayTextViewBoldEnd != 0) { // Editable editable = Editable.Factory.getInstance().newEditable(timeTableWeekdayStr); // editable.setSpan(new StyleSpan(Typeface.BOLD), // weekdayTextViewBoldStart, weekdayTextViewBoldEnd, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); // timetableWeekdayTextView.setText(editable); // } else { // timetableWeekdayTextView.setText(timeTableWeekdayStr); // } // TextView timetableTimeTextView=(TextView)rootView.findViewById(R.id.restaurant_detail_timetable_time); // timetableTimeTextView.setText(timeTableTimeStr); // } } } catch (Exception e) { ExceptionUtil.handleException(e); } } }
package com.aprendoz_test.data; /** * aprendoz_test.CalifEst * 01/19/2015 07:58:53 * */ public class CalifEst { private CalifEstId id; public CalifEstId getId() { return id; } public void setId(CalifEstId id) { this.id = id; } }
package com.techpakka.pmk.model; public class Troll { String id,image,caption,likes,troll_page; public Troll() { } public String getId() { return id; } public void setId(String id) { this.id = id; } public String getImage() { return image; } public void setImage(String image) { this.image = image; } public String getCaption() { return caption; } public void setCaption(String caption) { this.caption = caption; } public String getLikes() { return likes; } public void setLikes(String likes) { this.likes = likes; } public String getTroll_page() { return troll_page; } public void setTroll_page(String troll_page) { this.troll_page = troll_page; } }
package com.learning.usercenter.entity.form; import com.learning.usercenter.common.entity.form.BaseForm; import com.learning.usercenter.entity.po.Role; import lombok.Data; import javax.validation.constraints.NotBlank; import java.util.Set; /** * @author Zzz */ @Data public class RoleForm extends BaseForm<Role> { /** * 角色编码 */ @NotBlank(message = "角色编码不能为空") private String code; /** * 角色名称 */ @NotBlank(message = "角色名称不能为空") private String name; /** * 角色描述 */ private String description; /** *角色拥有的资 源id列表 */ private Set<Long> resourceIds; }
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package com.clienteapp.demo.service; import com.clienteapp.demo.entity.Cliente; import com.clienteapp.demo.repository.ClienteRepository; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; /** * * @author aldop */ @Service public class ClienteServiceImpl implements IClienteService{ @Autowired private ClienteRepository clienteRepository; @Override public List<Cliente> listarClientes() { return (List<Cliente>) clienteRepository.findAll(); } @Override public void guardarCliente(Cliente cliente) { clienteRepository.save(cliente); } @Override public Cliente buscarPorId(Long id) { return clienteRepository.findById(id).orElse(null); } @Override public void eliminarCliente(Long id) { clienteRepository.deleteById(id); } }
/* * Copyright (C) 2015 Miquel Sas * * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public * License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with this program. If not, see * <http://www.gnu.org/licenses/>. */ package com.qtplaf.library.trading.server; /** * Enumerates the three possible types of accounts. * * @author Miquel Sas */ public enum AccountType { /** * Normal live account, supported by all servers (brokers). */ Live, /** * Normal demo account, also supported by the majority of servers. */ Demo, }
package com.sw_engineering_candies.yaca; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class YacaApplication { public static void main(String[] args) { SpringApplication.run(YacaApplication.class, args); } }
/*********************************************************************** * Module: Dermatologist.java * Author: WIN 10 * Purpose: Defines the Class Dermatologist ***********************************************************************/ package com.hesoyam.pharmacy.user.model; import com.fasterxml.jackson.annotation.JsonBackReference; import com.hesoyam.pharmacy.appointment.model.CheckUp; import com.hesoyam.pharmacy.employee_management.model.Shift; import com.hesoyam.pharmacy.employee_management.model.ShiftType; import com.hesoyam.pharmacy.employee_management.model.VacationRequest; import com.hesoyam.pharmacy.pharmacy.model.Pharmacy; import com.hesoyam.pharmacy.util.DateTimeRange; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.ManyToMany; import javax.persistence.OneToMany; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.stream.Collectors; @Entity public class Dermatologist extends Employee { @ManyToMany(mappedBy = "dermatologists") @JsonBackReference private List<Pharmacy> pharmacies; @OneToMany(fetch = FetchType.LAZY, mappedBy = "dermatologist") private List<CheckUp> checkUps; public List<Pharmacy> getPharmacies() { if (pharmacies == null) pharmacies = new ArrayList<>(); return pharmacies; } public Iterator<Pharmacy> getIteratorPharmacy() { if (pharmacies == null) pharmacies = new ArrayList<>(); return pharmacies.iterator(); } public void setPharmacies(List<Pharmacy> newPharmacy) { removeAllPharmacy(); for (Iterator<Pharmacy> iter = newPharmacy.iterator(); iter.hasNext();) addPharmacy(iter.next()); } public boolean addPharmacy(Pharmacy newPharmacy) { if (newPharmacy == null) return false; if (this.pharmacies == null) this.pharmacies = new ArrayList<>(); if (this.pharmacies.contains(newPharmacy)) { return false; } else{ this.pharmacies.add(newPharmacy); newPharmacy.addDermatologist(this); return true; } } public boolean removePharmacy(Pharmacy oldPharmacy) { if (oldPharmacy == null) return false; if (this.pharmacies != null && this.pharmacies.contains(oldPharmacy)) { this.pharmacies.remove(oldPharmacy); oldPharmacy.removeDermatologist(this); return true; } else return false; } public void removeAllPharmacy() { if (pharmacies != null) { Pharmacy oldPharmacy; for (Iterator<Pharmacy> iter = getIteratorPharmacy(); iter.hasNext();) { oldPharmacy = iter.next(); iter.remove(); oldPharmacy.removeDermatologist(this); } } } public List<CheckUp> getCheckUps() { if (checkUps == null) checkUps = new ArrayList<>(); return checkUps; } public Iterator<CheckUp> getIteratorCheckUps() { if (checkUps == null) checkUps = new ArrayList<>(); return checkUps.iterator(); } public void setCheckUps(List<CheckUp> newCheckUps) { removeAllCheckUps(); for (CheckUp newCheckUp : newCheckUps) addCheckUps(newCheckUp); } public void addCheckUps(CheckUp newCheckUp) { if (newCheckUp == null) return; if (this.checkUps == null) this.checkUps = new ArrayList<>(); if (!this.checkUps.contains(newCheckUp)) { this.checkUps.add(newCheckUp); newCheckUp.setDermatologist(this); } } public void removeCheckUps(CheckUp oldCheckUp) { if (oldCheckUp == null) return; if (this.checkUps != null && this.checkUps.contains(oldCheckUp)) { this.checkUps.remove(oldCheckUp); oldCheckUp.setDermatologist(null); } } public void removeAllCheckUps() { if (checkUps != null) { CheckUp oldCheckUp; for (Iterator<CheckUp> iter = getIteratorCheckUps(); iter.hasNext();) { oldCheckUp = iter.next(); iter.remove(); oldCheckUp.setDermatologist(null); } } } @Override public boolean isAdministratorMyBoss(User administrator) { return getPharmacies().stream().anyMatch(pharmacy -> pharmacy.getAdministrator().contains(administrator)); } @Override public boolean isWorkingAt(Pharmacy pharmacy) { return getPharmacies().contains(pharmacy); } @Override protected boolean hasClearSchedule(DateTimeRange dateTimeRange) { return getCheckUps().stream().noneMatch(checkUp -> checkUp.isConflictingWith(dateTimeRange)); } @Override public void addVacation(VacationRequest vacationRequest) { for (Pharmacy pharmacy: pharmacies) { Shift vacation = new Shift(); vacation.setType(ShiftType.VACATION); vacation.setDateTimeRange(vacationRequest.getDateTimeRange()); vacation.setPharmacy(pharmacy); addShift(vacation); } } @Override public boolean canRemovePharmacy(Pharmacy pharmacy) { return checkUps.stream().noneMatch(checkUp -> checkUp.isUpcoming() && checkUp.isTaken()); } @Override public void clearAppointmentsForPharmacy(Pharmacy pharmacy) { List<CheckUp> checkUpsToRemove = getCheckUps().stream().filter(checkUp -> checkUp.getPharmacy().equals(pharmacy)).collect(Collectors.toList()); getCheckUps().removeAll(checkUpsToRemove); } }
/* * LumaQQ - Java QQ Client * * Copyright (C) 2004 luma <stubma@163.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ package edu.tsinghua.lumaqq.widgets.record; import org.eclipse.swt.SWT; import org.eclipse.swt.graphics.TextLayout; import org.eclipse.swt.graphics.TextStyle; import org.eclipse.swt.widgets.Display; import edu.tsinghua.lumaqq.models.ModelRegistry; import edu.tsinghua.lumaqq.models.User; import edu.tsinghua.lumaqq.record.RecordEntry; import edu.tsinghua.lumaqq.ui.helper.DateTool; /** * 手机短信聊天记录标签提供者 * * @author luma */ public class SMSLableProvider implements IWaterfallLabelProvider { private static final TextStyle STYLE = new TextStyle(null, Display.getDefault().getSystemColor(SWT.COLOR_RED), null); private static final String CRLF = System.getProperty("line.separator"); public String getText(Object element) { RecordEntry entry = (RecordEntry)element; if(entry.sender == 0) { int index = entry.message.indexOf('|'); String mobile = entry.message.substring(0, index); String message = entry.message.substring(index + 1); String date = DateTool.format(entry.time); return date + " " + mobile + CRLF + message; } else { int index = entry.message.indexOf('|'); String message = entry.message.substring(index + 1); User f = ModelRegistry.getUser(entry.sender); String fName = (f == null) ? String.valueOf(entry.sender) : (f.displayName.equals("") ? f.nick : f.displayName); String date = DateTool.format(entry.time); return date + " " + fName + CRLF + message; } } public void installStyle(Object element, TextLayout layout) { RecordEntry entry = (RecordEntry)element; if(entry.sender == 0) { int index = entry.message.indexOf('|'); String date = DateTool.format(entry.time); layout.setStyle(STYLE, 0, date.length() + index + 1); } else { User f = ModelRegistry.getUser(entry.sender); String fName = (f == null) ? String.valueOf(entry.sender) : (f.displayName.equals("") ? f.nick : f.displayName); String date = DateTool.format(entry.time); layout.setStyle(STYLE, 0, date.length() + fName.length() + 1); } } }
package com.tencent.mm.pluginsdk.ui.tools; import java.io.File; class FileExplorerUI$b { File file; final /* synthetic */ FileExplorerUI qSc; String qSj; private FileExplorerUI$b(FileExplorerUI fileExplorerUI) { this.qSc = fileExplorerUI; } /* synthetic */ FileExplorerUI$b(FileExplorerUI fileExplorerUI, byte b) { this(fileExplorerUI); } }
import java.io.File; import java.util.ArrayList; import java.util.Arrays; import java.util.Scanner; public class F { public static String name = "F.txt"; public static void main(String[] args) throws Exception { Scanner in = new Scanner(new File(name)); while (in.hasNextInt()) { int numboxes = in.nextInt(); int[][] boxes = new int[numboxes][4]; // int[] products = new int[numboxes]; for (int i = 0; i < numboxes; i++) { // products[i] = 1; for (int j = 0; j < 4; j++) { boxes[i][j] = in.nextInt(); // products[i] *= boxes[i][j]; } Arrays.sort(boxes[i]); // System.out.println(products[i]); } // build a map of new position to original/old /* * int[] prev_products = new int[products.length]; * System.arraycopy(products, 0, prev_products, 0, products.length); * HashMap<Integer,Integer> new2orig = new * HashMap<>(products.length); Arrays.sort(products); for(int i = 0; * i < products.length; i++) { new2orig.put(i, * Arrays.binarySearch(prev_products, key) } */ // construct fitting matrix boolean[][] fits = new boolean[numboxes][numboxes]; ArrayList<int[]> combos = new ArrayList<int[]>(); for (int i = 0; i < numboxes; i++) { for (int j = 0; j < numboxes; j++) { fits[i][j] = fits(boxes[i], boxes[j]); // System.out.print((fits[i][j] ? 1 : 0) + " "); if (fits[i][j]) { combos.add(new int[] { i, j }); } } // System.out.println(); } ArrayList<String> ren = new ArrayList<>(); for (int[] first : combos) { ArrayList<int[]> len = new ArrayList<>(); for (int i = 0; i < combos.size(); i++) { int[] ref = combos.get(i); if (first != ref) len.add(ref); } ren.add(first[0] + (miku(first, len))); // System.out.println(ren.get(ren.size() - 1)); } String longest = ""; for (String bot : ren) { if (longest.length() < bot.length()) { longest = bot; } else if (longest.length() == bot.length()) { int a = Integer.parseInt(longest.replace(" ", "")); int b = Integer.parseInt(bot.replace(" ", "")); longest = a < b ? longest : bot; } } String[] list = longest.split(" "); int[] nums = new int[list.length]; for System.out.println(longest.split(" ").length); System.out.println(longest); // printArray(combos); } in.close(); } // checks if a[] fits into b[] public static boolean fits(int[] a, int[] b) { for (int i = 0; i < 4; i++) { if (a[i] >= b[i]) return false; } return true; } public static void printArray(ArrayList<int[]> list) { for (int[] i : list) { System.out.println("[" + i[0] + "," + i[1] + "]"); } } public static String miku(int[] hat, ArrayList<int[]> sune) { if (sune.size() == 1) { if (hat[1] == sune.get(0)[0]) { return " " + sune.get(1); } else return ""; } else { // Combo ArrayList<String> ren = new ArrayList<>(); for (int[] test : sune) { if (hat[1] == test[0]) { ArrayList<int[]> len = new ArrayList<>(); for (int[] test2 : sune) { if (test != test2) { len.add(test2); } } ren.add(" " + hat[1] + " " + test[1] + miku(test, len)); } } String longest = ""; for (String bot : ren) { if (longest.length() < bot.length()) { longest = bot; } else if (longest.length() == bot.length()) { int a = Integer.parseInt(longest.replace(" ", "")); int b = Integer.parseInt(bot.replace(" ", "")); longest = a < b ? longest : bot; } } return longest; } } }
package com.link.admin.controller; import com.jfinal.aop.Before; import com.jfinal.aop.Clear; import com.jfinal.core.Controller; import com.jfinal.kit.HashKit; import com.jfinal.kit.LogKit; import com.link.admin.controller.validator.LoginValidator; import com.link.admin.controller.vo.TreeMenu; import com.link.api.service.MenuServiceI; import com.link.api.service.UserServiceI; import com.link.common.plugin.shiro.ShiroKit; import com.link.common.util.Constant; import com.link.common.util.ResultJson; import com.link.core.MenuServiceImpl; import com.link.core.UserServiceImpl; import com.link.model.Menu; import com.link.model.User; import org.apache.shiro.SecurityUtils; import org.apache.shiro.authc.DisabledAccountException; import org.apache.shiro.authc.IncorrectCredentialsException; import org.apache.shiro.authc.UnknownAccountException; import org.apache.shiro.authc.UsernamePasswordToken; import org.apache.shiro.subject.Subject; import java.util.List; /** * Created by linkzz on 2017-05-26. */ public class IndexController extends Controller{ MenuServiceI menuService = enhance(MenuServiceImpl.class); UserServiceI userService = enhance(UserServiceImpl.class); public void index(){ if (getPara() != null){ renderError(404); }else if (ShiroKit.isAuthenticated()){ User user = getSessionAttr("user"); List<Menu> list = menuService.sidebar(user.getId(),null); TreeMenu treeMenu = new TreeMenu(list); List<TreeMenu> treeMenuList = treeMenu.buildTree(); setAttr("menus",treeMenuList); setAttr("user",getSessionAttr("user")); render("_view/common/_sidebar.html"); return; }else { render("login.html"); return; } } @Clear public void home(){ render("_view/common/_home.html"); } @Clear @Before(LoginValidator.class) public void doLogin(){ if (getSessionAttr("user") == null){ String userName = getPara("userName"); String password = getPara("password"); LogKit.info("用户名:"+userName +" 密码:"+ HashKit.md5(password)); Subject subject = SecurityUtils.getSubject(); UsernamePasswordToken token = new UsernamePasswordToken(userName,HashKit.md5(password)); ResultJson resultJson = new ResultJson(); try { subject.login(token); } catch (UnknownAccountException aue) { LogKit.info("账号不存在!"); resultJson.setMsg("账号不存在!"); resultJson.setStatus(Constant.RESULT_LOGIN_ACC_NOT_EXISTENT); renderJson(resultJson); return; } catch (DisabledAccountException dae){ LogKit.info("账号未启用!"); resultJson.setMsg("账号未启用!"); resultJson.setStatus(Constant.RESULT_LOGIN_DISABLE); renderJson(resultJson); return; } catch (IncorrectCredentialsException ice){ LogKit.info("密码错误!"); resultJson.setMsg("密码错误!"); resultJson.setStatus(Constant.RESULT_LOGIN_ERROR_PWD); renderJson(resultJson); return; } catch (RuntimeException e) { LogKit.info("未知错误!,请联系管理员!"); resultJson.setMsg("未知错误!,请联系管理员!"); resultJson.setStatus(Constant.RESULT_LOGIN_NUKOWN); renderJson(resultJson); return; } User user = userService.getUserByUserName(userName); setSessionAttr("user",user); resultJson.setMsg("登录成功!"); resultJson.setStatus(Constant.RESULT_SUCCESS); renderJson(resultJson); return; }else { LogKit.info("当前session信息:"+ ShiroKit.getSession().getHost()); LogKit.info("当前session用户信息:"+((User)ShiroKit.getSession().getAttribute("user")).getUsername()); render("/"); } } @Clear public void logout(){ LogKit.info("退出登录系统!"); Subject subject = ShiroKit.getSubject(); if (subject.isAuthenticated()){ subject.logout(); // session 会销毁,在SessionListener监听session销毁,清理权限缓存 render("login.html"); } } }
package br.com.exemplo.dataingestion.adapters.events.listener; import br.com.exemplo.dataingestion.adapters.events.entities.LoadEntity; import br.com.exemplo.dataingestion.domain.producer.ProducerService; import br.com.exemplo.dataingestion.util.CreateLancamento; import io.micrometer.core.instrument.MeterRegistry; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.apache.kafka.clients.consumer.ConsumerRecord; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.ApplicationContext; import org.springframework.kafka.annotation.KafkaHandler; import org.springframework.kafka.annotation.KafkaListener; import org.springframework.kafka.support.Acknowledgment; import org.springframework.messaging.handler.annotation.MessageExceptionHandler; import org.springframework.messaging.handler.annotation.Payload; import org.springframework.stereotype.Component; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; import javax.annotation.PostConstruct; import java.util.List; import java.util.Objects; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.atomic.AtomicInteger; @Component @RequiredArgsConstructor @Slf4j @KafkaListener(groupId = "${spring.kafka.consumer.group-id}", topics = "${data.ingestion.consumer.topic}", containerFactory = "kafkaListenerContainerFactory") public class LoadListener { private final CreateLancamento createLancamento; private final ApplicationContext applicationContext; private final MeterRegistry simpleMeterRegistry; private ProducerService producerService; @KafkaHandler public void geraEvento(LoadEntity loadEntity) { for (int i = 0; i < loadEntity.getQuantidadeDias(); i++) { producerService.produce(createLancamento.createByContaAndData(loadEntity.getIdConta(), i)); } } }
package magical.robot.ioio; import ioio.lib.api.DigitalOutput; import ioio.lib.api.IOIO; import ioio.lib.api.PwmOutput; import ioio.lib.api.exception.ConnectionLostException; /** * this class handles all the robotic arm API functionality * @author Doron */ public class RoboticArmEdge implements Stoppable{ protected SmallMotorDriver _wrist_and_grasp; protected SmallMotorDriver _sholder_and_elbow; protected SmallMotorDriver _turn_and_led; protected DigitalOutput _stby; protected PwmOutput _pwm; /** * this constructor takes the instances of the SmallMotorDriver controlling the arms wrist, grasp, sholder, elbow, arm turn and led. * @param ioio a IOIO instance provided by the IOIO activity class * @param wrist_and_grasp this is the instance controlling the wrist and the grasp * @param sholder_and_elbow this is the instance controlling the sholder and elbow * @param turn_and_led this is the instance controlling the turn and led * @param stby standby pin number * @param pwm pwm pin number for controlling arm joints speed */ public RoboticArmEdge(IOIO ioio,SmallMotorDriver wrist_and_grasp, SmallMotorDriver sholder_and_elbow, SmallMotorDriver turn_and_led, int stby, int pwm) { this._sholder_and_elbow = sholder_and_elbow; this._wrist_and_grasp = wrist_and_grasp; this._turn_and_led = turn_and_led; try { _stby = ioio.openDigitalOutput(stby,true); _pwm = ioio.openPwmOutput(pwm, 100); _pwm.setDutyCycle((float)100); } catch (ConnectionLostException e){ e.printStackTrace(); } } /** * turning the shoulder in a certain direction * @param a0 * @param a1 * @throws ConnectionLostException */ public void turnSholder(boolean a0,boolean a1) throws ConnectionLostException{ _sholder_and_elbow.turnMotorA(a0,a1); } /** * turning the Elbow in a certain direction * @param a0 * @param a1 * @throws ConnectionLostException */ public void turnElbow(boolean a0,boolean a1) throws ConnectionLostException{ _sholder_and_elbow.turnMotorB(a0,a1); } /** * turning the Wrist in a certain direction * @param a0 * @param a1 * @throws ConnectionLostException */ private void turnWrist(boolean a0,boolean a1) throws ConnectionLostException{ _wrist_and_grasp.turnMotorA(a0,a1); } /** * turning the Grasp in a certain direction * @param a0 * @param a1 * @throws ConnectionLostException */ private void turnGrasp(boolean a0,boolean a1) throws ConnectionLostException{ _wrist_and_grasp.turnMotorB(a0,a1); } /** * turning the Arm turning in a certain direction * @param a0 * @param a1 * @throws ConnectionLostException */ private void turnTurning(boolean a0,boolean a1) throws ConnectionLostException{ _turn_and_led.turnMotorA(a0,a1); } /** * turn the arm Left * @throws ConnectionLostException */ public void TurnLeft() throws ConnectionLostException{ this.turnTurning(true, false); } /** * turn the arm right * @throws ConnectionLostException */ public void TurnRight() throws ConnectionLostException{ this.turnTurning(false, true); } /** * move shoulder up * @throws ConnectionLostException */ public void sholderUp() throws ConnectionLostException{ this.turnSholder(true, false); } /** * move shoulder down * @throws ConnectionLostException */ public void sholderDown() throws ConnectionLostException{ this.turnSholder(false, true); } /** * move elbow up * @throws ConnectionLostException */ public void elbowUp() throws ConnectionLostException{ this.turnElbow(true, false); } /** * move elbow down * @throws ConnectionLostException */ public void elbowDown() throws ConnectionLostException{ this.turnElbow(false, true); } /** * move wrist up * @throws ConnectionLostException */ public void wristUp() throws ConnectionLostException{ this.turnWrist(true, false); } /** * move wrist down * @throws ConnectionLostException */ public void wristDown() throws ConnectionLostException{ this.turnWrist(false, true); } /** * closes the arm's hand * @throws ConnectionLostException */ public void openHand() throws ConnectionLostException{ this.turnGrasp(false, true); } /** * opens the arm's hand * @throws ConnectionLostException */ public void closeHand() throws ConnectionLostException{ this.turnGrasp(true, false); } /** * turning the arm's led on * @throws ConnectionLostException */ public void turnOnLed() throws ConnectionLostException{ _turn_and_led.turnMotorB(true, false); } /** * turning the arm's led off * @throws ConnectionLostException */ public void turnOffLed() throws ConnectionLostException{ _turn_and_led.turnMotorB(false, false); } @Override public void stop() throws ConnectionLostException{ _turn_and_led.stop(); _wrist_and_grasp.stop(); _sholder_and_elbow.stop(); } /** * closes all pins */ public void close(){ _sholder_and_elbow.close(); _turn_and_led.close(); _wrist_and_grasp.close(); _pwm.close(); _stby.close(); } }
package com.sixmac.entity; import javax.persistence.*; import java.util.ArrayList; import java.util.List; /** * Created by Administrator on 2016/5/19 0019. */ @Entity @Table(name = "t_team") public class Team extends BaseEntity{ @Column(name = "name") private String name; /*@ManyToOne @JoinColumn(name = "city_id",referencedColumnName = "city_id") private City city; @ManyToOne @JoinColumn(name = "province_id",referencedColumnName = "city_id") private Province province; @ManyToOne @JoinColumn(name = "area_id") private Area area;*/ @Column(name = "province_id") private Long provinceId; @Column(name = "city_id") private Long cityId; @Transient private String provinceName; @Column(name = "slogan") private String slogan; @Column(name = "avater") private String avater; @Column(name = "address") private String address; @OneToOne @JoinColumn(name = "leader_user_id") private User leaderUser; @ManyToMany(fetch = FetchType.EAGER) @JoinTable(name = "t_team_member",joinColumns = {@JoinColumn(name = "team_id",referencedColumnName = "id")}, inverseJoinColumns = {@JoinColumn(name = "user_id",referencedColumnName = "id")}) private List<User> list; @Column(name = "declare_num") private Integer declareNum = 0; @Column(name = "battle_num") private Integer battleNum = 0; @Transient private Integer count; @Transient private Integer sum; @Transient private Double aveAge; @Transient private Double aveHeight; @Transient private Double aveWeight; @Transient private Integer num; public String getAddress() { return address; } public void setAddress(String address) { this.address = address; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getSlogan() { return slogan; } public void setSlogan(String slogan) { this.slogan = slogan; } public String getAvater() { return avater; } public void setAvater(String avater) { this.avater = avater; } public User getLeaderUser() { return leaderUser; } public void setLeaderUser(User leaderUser) { this.leaderUser = leaderUser; } public List<User> getList() { return list; } public void setList(List<User> list) { this.list = list; } public Double getAveAge() { return aveAge; } public void setAveAge(Double aveAge) { this.aveAge = aveAge; } public Double getAveHeight() { return aveHeight; } public void setAveHeight(Double aveHeight) { this.aveHeight = aveHeight; } public Double getAveWeight() { return aveWeight; } public void setAveWeight(Double aveWeight) { this.aveWeight = aveWeight; } public Integer getDeclareNum() { return declareNum; } public void setDeclareNum(Integer declareNum) { this.declareNum = declareNum; } public Integer getBattleNum() { return battleNum; } public void setBattleNum(Integer battleNum) { this.battleNum = battleNum; } public Integer getCount() { return count; } public void setCount(Integer count) { this.count = count; } public Integer getSum() { return sum; } public void setSum(Integer sum) { this.sum = sum; } public Integer getNum() { return num; } public void setNum(Integer num) { this.num = num; } public Long getProvinceId() { return provinceId; } public void setProvinceId(Long provinceId) { this.provinceId = provinceId; } public String getProvinceName() { return provinceName; } public void setProvinceName(String provinceName) { this.provinceName = provinceName; } public Long getCityId() { return cityId; } public void setCityId(Long cityId) { this.cityId = cityId; } }
package com.mx.profuturo.bolsa.util.restclient; import com.mx.profuturo.bolsa.model.recruitment.service.dto.InterviewAppointmentDTO; import com.mx.profuturo.bolsa.model.restclient.RequestBean; import com.mx.profuturo.bolsa.model.service.areasinteres.dto.GenericTextResponseBean; import org.springframework.http.HttpMethod; import java.util.List; /** * Created by luism on 17/05/2016. */ public interface RestClient { <T> T exetuteOperation(RequestBean<?> requestBean, Class<T> responseType, HttpMethod httpMethod) throws Exception; <T> T exetuteGET(RequestBean<?> requestBean, Class<T> responseType) throws Exception; <T> T exetutePOST(RequestBean<?> requestBean, Class<T> responseType) throws Exception; <T> T exetutePUT(RequestBean<?> requestBean, Class<T> responseType) throws Exception; <T> T exetuteDELETE(RequestBean<?> requestBean, Class<T> responseType) throws Exception; <T> List<T> exetuteOperationList(RequestBean<?> requestBean, Class<T> responseType, HttpMethod httpMethod) throws Exception; <T> List<T> exetuteGETList(RequestBean<?> requestBean, Class<T> responseType) throws Exception; <T> List<T> exetutePOSTList(RequestBean<?> requestBean, Class<T> responseType) throws Exception; /* <T> T exetuteTRACE(RequestBean<?> requestBean, Class<T> responseType) throws ServiceException, Exception; <T> T exetuteHEAD(RequestBean<?> requestBean, Class<T> responseType) throws ServiceException, Exception;*/ String exetuteRawPOST(RequestBean<?> genericRequestBean) throws Exception; }
package com.rockwellcollins.atc.limp.translate.lustre.transformations; import java.util.HashMap; import java.util.Map; import org.eclipse.emf.ecore.EObject; import org.eclipse.xtext.EcoreUtil2; import com.rockwellcollins.atc.limp.ConstantDeclaration; import com.rockwellcollins.atc.limp.ExternalFunction; import com.rockwellcollins.atc.limp.FcnCallExpr; import com.rockwellcollins.atc.limp.IdExpr; import com.rockwellcollins.atc.limp.InputArgList; import com.rockwellcollins.atc.limp.LimpFactory; import com.rockwellcollins.atc.limp.OutputArg; import com.rockwellcollins.atc.limp.Specification; /** * RemoveUnspecifiedConstants removes any constant that is not defined and replaces it as * an ExternalFunction with zero arguments (which will be translated into an uninterpreted * function with 0 args) that has identical semantics after translation. */ public class RemoveUnspecifiedConstants { private static ExternalFunction createFrozenConstant(ConstantDeclaration cd) { LimpFactory factory = LimpFactory.eINSTANCE; InputArgList ial = factory.createInputArgList(); OutputArg out = factory.createOutputArg(); out.setName("out"); out.setType(cd.getType()); ExternalFunction ef = factory.createExternalFunction(); ef.setName(cd.getName()); ef.setInputs(ial); ef.setOutput(out); return ef; } private static EObject createFcnCallExpr(ExternalFunction ef) { LimpFactory factory = LimpFactory.eINSTANCE; FcnCallExpr fce = factory.createFcnCallExpr(); fce.setId(ef); fce.setExprs(factory.createExprList()); return fce; } public static Specification transform(Specification s) { Map<ConstantDeclaration,ExternalFunction> map = new HashMap<>(); for(ConstantDeclaration cd : EcoreUtil2.getAllContentsOfType(s, ConstantDeclaration.class)){ if(cd.getExpr() == null) { ExternalFunction ef = createFrozenConstant(cd); map.put(cd, ef); EcoreUtil2.replace(cd,ef); } } for(IdExpr ide : EcoreUtil2.getAllContentsOfType(s, IdExpr.class)) { if (ide.getId() instanceof ConstantDeclaration) { ConstantDeclaration referenced = (ConstantDeclaration) ide.getId(); if(map.containsKey(referenced)) { ExternalFunction ef = map.get(referenced); EcoreUtil2.replace(ide, createFcnCallExpr(ef)); } } } return s; } }
package com.ybh.front.model; import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; public class SqlProductlistExample { /** * This field was generated by MyBatis Generator. * This field corresponds to the database table FreeHost_SqlProductlist * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ protected String orderByClause; /** * This field was generated by MyBatis Generator. * This field corresponds to the database table FreeHost_SqlProductlist * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ protected boolean distinct; /** * This field was generated by MyBatis Generator. * This field corresponds to the database table FreeHost_SqlProductlist * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ protected List<Criteria> oredCriteria; /** * This method was generated by MyBatis Generator. * This method corresponds to the database table FreeHost_SqlProductlist * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public SqlProductlistExample() { oredCriteria = new ArrayList<Criteria>(); } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table FreeHost_SqlProductlist * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setOrderByClause(String orderByClause) { this.orderByClause = orderByClause; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table FreeHost_SqlProductlist * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getOrderByClause() { return orderByClause; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table FreeHost_SqlProductlist * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setDistinct(boolean distinct) { this.distinct = distinct; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table FreeHost_SqlProductlist * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public boolean isDistinct() { return distinct; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table FreeHost_SqlProductlist * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public List<Criteria> getOredCriteria() { return oredCriteria; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table FreeHost_SqlProductlist * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void or(Criteria criteria) { oredCriteria.add(criteria); } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table FreeHost_SqlProductlist * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public Criteria or() { Criteria criteria = createCriteriaInternal(); oredCriteria.add(criteria); return criteria; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table FreeHost_SqlProductlist * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public Criteria createCriteria() { Criteria criteria = createCriteriaInternal(); if (oredCriteria.size() == 0) { oredCriteria.add(criteria); } return criteria; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table FreeHost_SqlProductlist * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ protected Criteria createCriteriaInternal() { Criteria criteria = new Criteria(); return criteria; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table FreeHost_SqlProductlist * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void clear() { oredCriteria.clear(); orderByClause = null; distinct = false; } /** * This class was generated by MyBatis Generator. * This class corresponds to the database table FreeHost_SqlProductlist * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ protected abstract static class GeneratedCriteria { protected List<Criterion> criteria; protected GeneratedCriteria() { super(); criteria = new ArrayList<Criterion>(); } public boolean isValid() { return criteria.size() > 0; } public List<Criterion> getAllCriteria() { return criteria; } public List<Criterion> getCriteria() { return criteria; } protected void addCriterion(String condition) { if (condition == null) { throw new RuntimeException("Value for condition cannot be null"); } criteria.add(new Criterion(condition)); } protected void addCriterion(String condition, Object value, String property) { if (value == null) { throw new RuntimeException("Value for " + property + " cannot be null"); } criteria.add(new Criterion(condition, value)); } protected void addCriterion(String condition, Object value1, Object value2, String property) { if (value1 == null || value2 == null) { throw new RuntimeException("Between values for " + property + " cannot be null"); } criteria.add(new Criterion(condition, value1, value2)); } public Criteria andIdIsNull() { addCriterion("id is null"); return (Criteria) this; } public Criteria andIdIsNotNull() { addCriterion("id is not null"); return (Criteria) this; } public Criteria andIdEqualTo(Integer value) { addCriterion("id =", value, "id"); return (Criteria) this; } public Criteria andIdNotEqualTo(Integer value) { addCriterion("id <>", value, "id"); return (Criteria) this; } public Criteria andIdGreaterThan(Integer value) { addCriterion("id >", value, "id"); return (Criteria) this; } public Criteria andIdGreaterThanOrEqualTo(Integer value) { addCriterion("id >=", value, "id"); return (Criteria) this; } public Criteria andIdLessThan(Integer value) { addCriterion("id <", value, "id"); return (Criteria) this; } public Criteria andIdLessThanOrEqualTo(Integer value) { addCriterion("id <=", value, "id"); return (Criteria) this; } public Criteria andIdIn(List<Integer> values) { addCriterion("id in", values, "id"); return (Criteria) this; } public Criteria andIdNotIn(List<Integer> values) { addCriterion("id not in", values, "id"); return (Criteria) this; } public Criteria andIdBetween(Integer value1, Integer value2) { addCriterion("id between", value1, value2, "id"); return (Criteria) this; } public Criteria andIdNotBetween(Integer value1, Integer value2) { addCriterion("id not between", value1, value2, "id"); return (Criteria) this; } public Criteria andSqltypeIsNull() { addCriterion("Sqltype is null"); return (Criteria) this; } public Criteria andSqltypeIsNotNull() { addCriterion("Sqltype is not null"); return (Criteria) this; } public Criteria andSqltypeEqualTo(String value) { addCriterion("Sqltype =", value, "sqltype"); return (Criteria) this; } public Criteria andSqltypeNotEqualTo(String value) { addCriterion("Sqltype <>", value, "sqltype"); return (Criteria) this; } public Criteria andSqltypeGreaterThan(String value) { addCriterion("Sqltype >", value, "sqltype"); return (Criteria) this; } public Criteria andSqltypeGreaterThanOrEqualTo(String value) { addCriterion("Sqltype >=", value, "sqltype"); return (Criteria) this; } public Criteria andSqltypeLessThan(String value) { addCriterion("Sqltype <", value, "sqltype"); return (Criteria) this; } public Criteria andSqltypeLessThanOrEqualTo(String value) { addCriterion("Sqltype <=", value, "sqltype"); return (Criteria) this; } public Criteria andSqltypeLike(String value) { addCriterion("Sqltype like", value, "sqltype"); return (Criteria) this; } public Criteria andSqltypeNotLike(String value) { addCriterion("Sqltype not like", value, "sqltype"); return (Criteria) this; } public Criteria andSqltypeIn(List<String> values) { addCriterion("Sqltype in", values, "sqltype"); return (Criteria) this; } public Criteria andSqltypeNotIn(List<String> values) { addCriterion("Sqltype not in", values, "sqltype"); return (Criteria) this; } public Criteria andSqltypeBetween(String value1, String value2) { addCriterion("Sqltype between", value1, value2, "sqltype"); return (Criteria) this; } public Criteria andSqltypeNotBetween(String value1, String value2) { addCriterion("Sqltype not between", value1, value2, "sqltype"); return (Criteria) this; } public Criteria andSqlcountIsNull() { addCriterion("Sqlcount is null"); return (Criteria) this; } public Criteria andSqlcountIsNotNull() { addCriterion("Sqlcount is not null"); return (Criteria) this; } public Criteria andSqlcountEqualTo(Integer value) { addCriterion("Sqlcount =", value, "sqlcount"); return (Criteria) this; } public Criteria andSqlcountNotEqualTo(Integer value) { addCriterion("Sqlcount <>", value, "sqlcount"); return (Criteria) this; } public Criteria andSqlcountGreaterThan(Integer value) { addCriterion("Sqlcount >", value, "sqlcount"); return (Criteria) this; } public Criteria andSqlcountGreaterThanOrEqualTo(Integer value) { addCriterion("Sqlcount >=", value, "sqlcount"); return (Criteria) this; } public Criteria andSqlcountLessThan(Integer value) { addCriterion("Sqlcount <", value, "sqlcount"); return (Criteria) this; } public Criteria andSqlcountLessThanOrEqualTo(Integer value) { addCriterion("Sqlcount <=", value, "sqlcount"); return (Criteria) this; } public Criteria andSqlcountIn(List<Integer> values) { addCriterion("Sqlcount in", values, "sqlcount"); return (Criteria) this; } public Criteria andSqlcountNotIn(List<Integer> values) { addCriterion("Sqlcount not in", values, "sqlcount"); return (Criteria) this; } public Criteria andSqlcountBetween(Integer value1, Integer value2) { addCriterion("Sqlcount between", value1, value2, "sqlcount"); return (Criteria) this; } public Criteria andSqlcountNotBetween(Integer value1, Integer value2) { addCriterion("Sqlcount not between", value1, value2, "sqlcount"); return (Criteria) this; } public Criteria andUsermoneyIsNull() { addCriterion("usermoney is null"); return (Criteria) this; } public Criteria andUsermoneyIsNotNull() { addCriterion("usermoney is not null"); return (Criteria) this; } public Criteria andUsermoneyEqualTo(Double value) { addCriterion("usermoney =", value, "usermoney"); return (Criteria) this; } public Criteria andUsermoneyNotEqualTo(Double value) { addCriterion("usermoney <>", value, "usermoney"); return (Criteria) this; } public Criteria andUsermoneyGreaterThan(Double value) { addCriterion("usermoney >", value, "usermoney"); return (Criteria) this; } public Criteria andUsermoneyGreaterThanOrEqualTo(Double value) { addCriterion("usermoney >=", value, "usermoney"); return (Criteria) this; } public Criteria andUsermoneyLessThan(Double value) { addCriterion("usermoney <", value, "usermoney"); return (Criteria) this; } public Criteria andUsermoneyLessThanOrEqualTo(Double value) { addCriterion("usermoney <=", value, "usermoney"); return (Criteria) this; } public Criteria andUsermoneyIn(List<Double> values) { addCriterion("usermoney in", values, "usermoney"); return (Criteria) this; } public Criteria andUsermoneyNotIn(List<Double> values) { addCriterion("usermoney not in", values, "usermoney"); return (Criteria) this; } public Criteria andUsermoneyBetween(Double value1, Double value2) { addCriterion("usermoney between", value1, value2, "usermoney"); return (Criteria) this; } public Criteria andUsermoneyNotBetween(Double value1, Double value2) { addCriterion("usermoney not between", value1, value2, "usermoney"); return (Criteria) this; } public Criteria andUserspacelimtIsNull() { addCriterion("userspacelimt is null"); return (Criteria) this; } public Criteria andUserspacelimtIsNotNull() { addCriterion("userspacelimt is not null"); return (Criteria) this; } public Criteria andUserspacelimtEqualTo(Integer value) { addCriterion("userspacelimt =", value, "userspacelimt"); return (Criteria) this; } public Criteria andUserspacelimtNotEqualTo(Integer value) { addCriterion("userspacelimt <>", value, "userspacelimt"); return (Criteria) this; } public Criteria andUserspacelimtGreaterThan(Integer value) { addCriterion("userspacelimt >", value, "userspacelimt"); return (Criteria) this; } public Criteria andUserspacelimtGreaterThanOrEqualTo(Integer value) { addCriterion("userspacelimt >=", value, "userspacelimt"); return (Criteria) this; } public Criteria andUserspacelimtLessThan(Integer value) { addCriterion("userspacelimt <", value, "userspacelimt"); return (Criteria) this; } public Criteria andUserspacelimtLessThanOrEqualTo(Integer value) { addCriterion("userspacelimt <=", value, "userspacelimt"); return (Criteria) this; } public Criteria andUserspacelimtIn(List<Integer> values) { addCriterion("userspacelimt in", values, "userspacelimt"); return (Criteria) this; } public Criteria andUserspacelimtNotIn(List<Integer> values) { addCriterion("userspacelimt not in", values, "userspacelimt"); return (Criteria) this; } public Criteria andUserspacelimtBetween(Integer value1, Integer value2) { addCriterion("userspacelimt between", value1, value2, "userspacelimt"); return (Criteria) this; } public Criteria andUserspacelimtNotBetween(Integer value1, Integer value2) { addCriterion("userspacelimt not between", value1, value2, "userspacelimt"); return (Criteria) this; } public Criteria andLogspacelimtIsNull() { addCriterion("logspacelimt is null"); return (Criteria) this; } public Criteria andLogspacelimtIsNotNull() { addCriterion("logspacelimt is not null"); return (Criteria) this; } public Criteria andLogspacelimtEqualTo(Integer value) { addCriterion("logspacelimt =", value, "logspacelimt"); return (Criteria) this; } public Criteria andLogspacelimtNotEqualTo(Integer value) { addCriterion("logspacelimt <>", value, "logspacelimt"); return (Criteria) this; } public Criteria andLogspacelimtGreaterThan(Integer value) { addCriterion("logspacelimt >", value, "logspacelimt"); return (Criteria) this; } public Criteria andLogspacelimtGreaterThanOrEqualTo(Integer value) { addCriterion("logspacelimt >=", value, "logspacelimt"); return (Criteria) this; } public Criteria andLogspacelimtLessThan(Integer value) { addCriterion("logspacelimt <", value, "logspacelimt"); return (Criteria) this; } public Criteria andLogspacelimtLessThanOrEqualTo(Integer value) { addCriterion("logspacelimt <=", value, "logspacelimt"); return (Criteria) this; } public Criteria andLogspacelimtIn(List<Integer> values) { addCriterion("logspacelimt in", values, "logspacelimt"); return (Criteria) this; } public Criteria andLogspacelimtNotIn(List<Integer> values) { addCriterion("logspacelimt not in", values, "logspacelimt"); return (Criteria) this; } public Criteria andLogspacelimtBetween(Integer value1, Integer value2) { addCriterion("logspacelimt between", value1, value2, "logspacelimt"); return (Criteria) this; } public Criteria andLogspacelimtNotBetween(Integer value1, Integer value2) { addCriterion("logspacelimt not between", value1, value2, "logspacelimt"); return (Criteria) this; } public Criteria andBackuptypeIsNull() { addCriterion("backuptype is null"); return (Criteria) this; } public Criteria andBackuptypeIsNotNull() { addCriterion("backuptype is not null"); return (Criteria) this; } public Criteria andBackuptypeEqualTo(Integer value) { addCriterion("backuptype =", value, "backuptype"); return (Criteria) this; } public Criteria andBackuptypeNotEqualTo(Integer value) { addCriterion("backuptype <>", value, "backuptype"); return (Criteria) this; } public Criteria andBackuptypeGreaterThan(Integer value) { addCriterion("backuptype >", value, "backuptype"); return (Criteria) this; } public Criteria andBackuptypeGreaterThanOrEqualTo(Integer value) { addCriterion("backuptype >=", value, "backuptype"); return (Criteria) this; } public Criteria andBackuptypeLessThan(Integer value) { addCriterion("backuptype <", value, "backuptype"); return (Criteria) this; } public Criteria andBackuptypeLessThanOrEqualTo(Integer value) { addCriterion("backuptype <=", value, "backuptype"); return (Criteria) this; } public Criteria andBackuptypeIn(List<Integer> values) { addCriterion("backuptype in", values, "backuptype"); return (Criteria) this; } public Criteria andBackuptypeNotIn(List<Integer> values) { addCriterion("backuptype not in", values, "backuptype"); return (Criteria) this; } public Criteria andBackuptypeBetween(Integer value1, Integer value2) { addCriterion("backuptype between", value1, value2, "backuptype"); return (Criteria) this; } public Criteria andBackuptypeNotBetween(Integer value1, Integer value2) { addCriterion("backuptype not between", value1, value2, "backuptype"); return (Criteria) this; } public Criteria andServerlistidIsNull() { addCriterion("ServerlistID is null"); return (Criteria) this; } public Criteria andServerlistidIsNotNull() { addCriterion("ServerlistID is not null"); return (Criteria) this; } public Criteria andServerlistidEqualTo(Integer value) { addCriterion("ServerlistID =", value, "serverlistid"); return (Criteria) this; } public Criteria andServerlistidNotEqualTo(Integer value) { addCriterion("ServerlistID <>", value, "serverlistid"); return (Criteria) this; } public Criteria andServerlistidGreaterThan(Integer value) { addCriterion("ServerlistID >", value, "serverlistid"); return (Criteria) this; } public Criteria andServerlistidGreaterThanOrEqualTo(Integer value) { addCriterion("ServerlistID >=", value, "serverlistid"); return (Criteria) this; } public Criteria andServerlistidLessThan(Integer value) { addCriterion("ServerlistID <", value, "serverlistid"); return (Criteria) this; } public Criteria andServerlistidLessThanOrEqualTo(Integer value) { addCriterion("ServerlistID <=", value, "serverlistid"); return (Criteria) this; } public Criteria andServerlistidIn(List<Integer> values) { addCriterion("ServerlistID in", values, "serverlistid"); return (Criteria) this; } public Criteria andServerlistidNotIn(List<Integer> values) { addCriterion("ServerlistID not in", values, "serverlistid"); return (Criteria) this; } public Criteria andServerlistidBetween(Integer value1, Integer value2) { addCriterion("ServerlistID between", value1, value2, "serverlistid"); return (Criteria) this; } public Criteria andServerlistidNotBetween(Integer value1, Integer value2) { addCriterion("ServerlistID not between", value1, value2, "serverlistid"); return (Criteria) this; } public Criteria andIsbyhostIsNull() { addCriterion("isbyhost is null"); return (Criteria) this; } public Criteria andIsbyhostIsNotNull() { addCriterion("isbyhost is not null"); return (Criteria) this; } public Criteria andIsbyhostEqualTo(String value) { addCriterion("isbyhost =", value, "isbyhost"); return (Criteria) this; } public Criteria andIsbyhostNotEqualTo(String value) { addCriterion("isbyhost <>", value, "isbyhost"); return (Criteria) this; } public Criteria andIsbyhostGreaterThan(String value) { addCriterion("isbyhost >", value, "isbyhost"); return (Criteria) this; } public Criteria andIsbyhostGreaterThanOrEqualTo(String value) { addCriterion("isbyhost >=", value, "isbyhost"); return (Criteria) this; } public Criteria andIsbyhostLessThan(String value) { addCriterion("isbyhost <", value, "isbyhost"); return (Criteria) this; } public Criteria andIsbyhostLessThanOrEqualTo(String value) { addCriterion("isbyhost <=", value, "isbyhost"); return (Criteria) this; } public Criteria andIsbyhostLike(String value) { addCriterion("isbyhost like", value, "isbyhost"); return (Criteria) this; } public Criteria andIsbyhostNotLike(String value) { addCriterion("isbyhost not like", value, "isbyhost"); return (Criteria) this; } public Criteria andIsbyhostIn(List<String> values) { addCriterion("isbyhost in", values, "isbyhost"); return (Criteria) this; } public Criteria andIsbyhostNotIn(List<String> values) { addCriterion("isbyhost not in", values, "isbyhost"); return (Criteria) this; } public Criteria andIsbyhostBetween(String value1, String value2) { addCriterion("isbyhost between", value1, value2, "isbyhost"); return (Criteria) this; } public Criteria andIsbyhostNotBetween(String value1, String value2) { addCriterion("isbyhost not between", value1, value2, "isbyhost"); return (Criteria) this; } public Criteria andHosttypeIsNull() { addCriterion("Hosttype is null"); return (Criteria) this; } public Criteria andHosttypeIsNotNull() { addCriterion("Hosttype is not null"); return (Criteria) this; } public Criteria andHosttypeEqualTo(String value) { addCriterion("Hosttype =", value, "hosttype"); return (Criteria) this; } public Criteria andHosttypeNotEqualTo(String value) { addCriterion("Hosttype <>", value, "hosttype"); return (Criteria) this; } public Criteria andHosttypeGreaterThan(String value) { addCriterion("Hosttype >", value, "hosttype"); return (Criteria) this; } public Criteria andHosttypeGreaterThanOrEqualTo(String value) { addCriterion("Hosttype >=", value, "hosttype"); return (Criteria) this; } public Criteria andHosttypeLessThan(String value) { addCriterion("Hosttype <", value, "hosttype"); return (Criteria) this; } public Criteria andHosttypeLessThanOrEqualTo(String value) { addCriterion("Hosttype <=", value, "hosttype"); return (Criteria) this; } public Criteria andHosttypeLike(String value) { addCriterion("Hosttype like", value, "hosttype"); return (Criteria) this; } public Criteria andHosttypeNotLike(String value) { addCriterion("Hosttype not like", value, "hosttype"); return (Criteria) this; } public Criteria andHosttypeIn(List<String> values) { addCriterion("Hosttype in", values, "hosttype"); return (Criteria) this; } public Criteria andHosttypeNotIn(List<String> values) { addCriterion("Hosttype not in", values, "hosttype"); return (Criteria) this; } public Criteria andHosttypeBetween(String value1, String value2) { addCriterion("Hosttype between", value1, value2, "hosttype"); return (Criteria) this; } public Criteria andHosttypeNotBetween(String value1, String value2) { addCriterion("Hosttype not between", value1, value2, "hosttype"); return (Criteria) this; } public Criteria andCantestIsNull() { addCriterion("cantest is null"); return (Criteria) this; } public Criteria andCantestIsNotNull() { addCriterion("cantest is not null"); return (Criteria) this; } public Criteria andCantestEqualTo(String value) { addCriterion("cantest =", value, "cantest"); return (Criteria) this; } public Criteria andCantestNotEqualTo(String value) { addCriterion("cantest <>", value, "cantest"); return (Criteria) this; } public Criteria andCantestGreaterThan(String value) { addCriterion("cantest >", value, "cantest"); return (Criteria) this; } public Criteria andCantestGreaterThanOrEqualTo(String value) { addCriterion("cantest >=", value, "cantest"); return (Criteria) this; } public Criteria andCantestLessThan(String value) { addCriterion("cantest <", value, "cantest"); return (Criteria) this; } public Criteria andCantestLessThanOrEqualTo(String value) { addCriterion("cantest <=", value, "cantest"); return (Criteria) this; } public Criteria andCantestLike(String value) { addCriterion("cantest like", value, "cantest"); return (Criteria) this; } public Criteria andCantestNotLike(String value) { addCriterion("cantest not like", value, "cantest"); return (Criteria) this; } public Criteria andCantestIn(List<String> values) { addCriterion("cantest in", values, "cantest"); return (Criteria) this; } public Criteria andCantestNotIn(List<String> values) { addCriterion("cantest not in", values, "cantest"); return (Criteria) this; } public Criteria andCantestBetween(String value1, String value2) { addCriterion("cantest between", value1, value2, "cantest"); return (Criteria) this; } public Criteria andCantestNotBetween(String value1, String value2) { addCriterion("cantest not between", value1, value2, "cantest"); return (Criteria) this; } public Criteria andCanmonthIsNull() { addCriterion("canmonth is null"); return (Criteria) this; } public Criteria andCanmonthIsNotNull() { addCriterion("canmonth is not null"); return (Criteria) this; } public Criteria andCanmonthEqualTo(String value) { addCriterion("canmonth =", value, "canmonth"); return (Criteria) this; } public Criteria andCanmonthNotEqualTo(String value) { addCriterion("canmonth <>", value, "canmonth"); return (Criteria) this; } public Criteria andCanmonthGreaterThan(String value) { addCriterion("canmonth >", value, "canmonth"); return (Criteria) this; } public Criteria andCanmonthGreaterThanOrEqualTo(String value) { addCriterion("canmonth >=", value, "canmonth"); return (Criteria) this; } public Criteria andCanmonthLessThan(String value) { addCriterion("canmonth <", value, "canmonth"); return (Criteria) this; } public Criteria andCanmonthLessThanOrEqualTo(String value) { addCriterion("canmonth <=", value, "canmonth"); return (Criteria) this; } public Criteria andCanmonthLike(String value) { addCriterion("canmonth like", value, "canmonth"); return (Criteria) this; } public Criteria andCanmonthNotLike(String value) { addCriterion("canmonth not like", value, "canmonth"); return (Criteria) this; } public Criteria andCanmonthIn(List<String> values) { addCriterion("canmonth in", values, "canmonth"); return (Criteria) this; } public Criteria andCanmonthNotIn(List<String> values) { addCriterion("canmonth not in", values, "canmonth"); return (Criteria) this; } public Criteria andCanmonthBetween(String value1, String value2) { addCriterion("canmonth between", value1, value2, "canmonth"); return (Criteria) this; } public Criteria andCanmonthNotBetween(String value1, String value2) { addCriterion("canmonth not between", value1, value2, "canmonth"); return (Criteria) this; } public Criteria andCanhalfyearIsNull() { addCriterion("canhalfyear is null"); return (Criteria) this; } public Criteria andCanhalfyearIsNotNull() { addCriterion("canhalfyear is not null"); return (Criteria) this; } public Criteria andCanhalfyearEqualTo(String value) { addCriterion("canhalfyear =", value, "canhalfyear"); return (Criteria) this; } public Criteria andCanhalfyearNotEqualTo(String value) { addCriterion("canhalfyear <>", value, "canhalfyear"); return (Criteria) this; } public Criteria andCanhalfyearGreaterThan(String value) { addCriterion("canhalfyear >", value, "canhalfyear"); return (Criteria) this; } public Criteria andCanhalfyearGreaterThanOrEqualTo(String value) { addCriterion("canhalfyear >=", value, "canhalfyear"); return (Criteria) this; } public Criteria andCanhalfyearLessThan(String value) { addCriterion("canhalfyear <", value, "canhalfyear"); return (Criteria) this; } public Criteria andCanhalfyearLessThanOrEqualTo(String value) { addCriterion("canhalfyear <=", value, "canhalfyear"); return (Criteria) this; } public Criteria andCanhalfyearLike(String value) { addCriterion("canhalfyear like", value, "canhalfyear"); return (Criteria) this; } public Criteria andCanhalfyearNotLike(String value) { addCriterion("canhalfyear not like", value, "canhalfyear"); return (Criteria) this; } public Criteria andCanhalfyearIn(List<String> values) { addCriterion("canhalfyear in", values, "canhalfyear"); return (Criteria) this; } public Criteria andCanhalfyearNotIn(List<String> values) { addCriterion("canhalfyear not in", values, "canhalfyear"); return (Criteria) this; } public Criteria andCanhalfyearBetween(String value1, String value2) { addCriterion("canhalfyear between", value1, value2, "canhalfyear"); return (Criteria) this; } public Criteria andCanhalfyearNotBetween(String value1, String value2) { addCriterion("canhalfyear not between", value1, value2, "canhalfyear"); return (Criteria) this; } public Criteria andAgent1IsNull() { addCriterion("agent1 is null"); return (Criteria) this; } public Criteria andAgent1IsNotNull() { addCriterion("agent1 is not null"); return (Criteria) this; } public Criteria andAgent1EqualTo(String value) { addCriterion("agent1 =", value, "agent1"); return (Criteria) this; } public Criteria andAgent1NotEqualTo(String value) { addCriterion("agent1 <>", value, "agent1"); return (Criteria) this; } public Criteria andAgent1GreaterThan(String value) { addCriterion("agent1 >", value, "agent1"); return (Criteria) this; } public Criteria andAgent1GreaterThanOrEqualTo(String value) { addCriterion("agent1 >=", value, "agent1"); return (Criteria) this; } public Criteria andAgent1LessThan(String value) { addCriterion("agent1 <", value, "agent1"); return (Criteria) this; } public Criteria andAgent1LessThanOrEqualTo(String value) { addCriterion("agent1 <=", value, "agent1"); return (Criteria) this; } public Criteria andAgent1Like(String value) { addCriterion("agent1 like", value, "agent1"); return (Criteria) this; } public Criteria andAgent1NotLike(String value) { addCriterion("agent1 not like", value, "agent1"); return (Criteria) this; } public Criteria andAgent1In(List<String> values) { addCriterion("agent1 in", values, "agent1"); return (Criteria) this; } public Criteria andAgent1NotIn(List<String> values) { addCriterion("agent1 not in", values, "agent1"); return (Criteria) this; } public Criteria andAgent1Between(String value1, String value2) { addCriterion("agent1 between", value1, value2, "agent1"); return (Criteria) this; } public Criteria andAgent1NotBetween(String value1, String value2) { addCriterion("agent1 not between", value1, value2, "agent1"); return (Criteria) this; } public Criteria andAgent2IsNull() { addCriterion("agent2 is null"); return (Criteria) this; } public Criteria andAgent2IsNotNull() { addCriterion("agent2 is not null"); return (Criteria) this; } public Criteria andAgent2EqualTo(String value) { addCriterion("agent2 =", value, "agent2"); return (Criteria) this; } public Criteria andAgent2NotEqualTo(String value) { addCriterion("agent2 <>", value, "agent2"); return (Criteria) this; } public Criteria andAgent2GreaterThan(String value) { addCriterion("agent2 >", value, "agent2"); return (Criteria) this; } public Criteria andAgent2GreaterThanOrEqualTo(String value) { addCriterion("agent2 >=", value, "agent2"); return (Criteria) this; } public Criteria andAgent2LessThan(String value) { addCriterion("agent2 <", value, "agent2"); return (Criteria) this; } public Criteria andAgent2LessThanOrEqualTo(String value) { addCriterion("agent2 <=", value, "agent2"); return (Criteria) this; } public Criteria andAgent2Like(String value) { addCriterion("agent2 like", value, "agent2"); return (Criteria) this; } public Criteria andAgent2NotLike(String value) { addCriterion("agent2 not like", value, "agent2"); return (Criteria) this; } public Criteria andAgent2In(List<String> values) { addCriterion("agent2 in", values, "agent2"); return (Criteria) this; } public Criteria andAgent2NotIn(List<String> values) { addCriterion("agent2 not in", values, "agent2"); return (Criteria) this; } public Criteria andAgent2Between(String value1, String value2) { addCriterion("agent2 between", value1, value2, "agent2"); return (Criteria) this; } public Criteria andAgent2NotBetween(String value1, String value2) { addCriterion("agent2 not between", value1, value2, "agent2"); return (Criteria) this; } public Criteria andCanbyenduserIsNull() { addCriterion("canbyenduser is null"); return (Criteria) this; } public Criteria andCanbyenduserIsNotNull() { addCriterion("canbyenduser is not null"); return (Criteria) this; } public Criteria andCanbyenduserEqualTo(String value) { addCriterion("canbyenduser =", value, "canbyenduser"); return (Criteria) this; } public Criteria andCanbyenduserNotEqualTo(String value) { addCriterion("canbyenduser <>", value, "canbyenduser"); return (Criteria) this; } public Criteria andCanbyenduserGreaterThan(String value) { addCriterion("canbyenduser >", value, "canbyenduser"); return (Criteria) this; } public Criteria andCanbyenduserGreaterThanOrEqualTo(String value) { addCriterion("canbyenduser >=", value, "canbyenduser"); return (Criteria) this; } public Criteria andCanbyenduserLessThan(String value) { addCriterion("canbyenduser <", value, "canbyenduser"); return (Criteria) this; } public Criteria andCanbyenduserLessThanOrEqualTo(String value) { addCriterion("canbyenduser <=", value, "canbyenduser"); return (Criteria) this; } public Criteria andCanbyenduserLike(String value) { addCriterion("canbyenduser like", value, "canbyenduser"); return (Criteria) this; } public Criteria andCanbyenduserNotLike(String value) { addCriterion("canbyenduser not like", value, "canbyenduser"); return (Criteria) this; } public Criteria andCanbyenduserIn(List<String> values) { addCriterion("canbyenduser in", values, "canbyenduser"); return (Criteria) this; } public Criteria andCanbyenduserNotIn(List<String> values) { addCriterion("canbyenduser not in", values, "canbyenduser"); return (Criteria) this; } public Criteria andCanbyenduserBetween(String value1, String value2) { addCriterion("canbyenduser between", value1, value2, "canbyenduser"); return (Criteria) this; } public Criteria andCanbyenduserNotBetween(String value1, String value2) { addCriterion("canbyenduser not between", value1, value2, "canbyenduser"); return (Criteria) this; } public Criteria andCanbyagnenduserIsNull() { addCriterion("canbyagnenduser is null"); return (Criteria) this; } public Criteria andCanbyagnenduserIsNotNull() { addCriterion("canbyagnenduser is not null"); return (Criteria) this; } public Criteria andCanbyagnenduserEqualTo(String value) { addCriterion("canbyagnenduser =", value, "canbyagnenduser"); return (Criteria) this; } public Criteria andCanbyagnenduserNotEqualTo(String value) { addCriterion("canbyagnenduser <>", value, "canbyagnenduser"); return (Criteria) this; } public Criteria andCanbyagnenduserGreaterThan(String value) { addCriterion("canbyagnenduser >", value, "canbyagnenduser"); return (Criteria) this; } public Criteria andCanbyagnenduserGreaterThanOrEqualTo(String value) { addCriterion("canbyagnenduser >=", value, "canbyagnenduser"); return (Criteria) this; } public Criteria andCanbyagnenduserLessThan(String value) { addCriterion("canbyagnenduser <", value, "canbyagnenduser"); return (Criteria) this; } public Criteria andCanbyagnenduserLessThanOrEqualTo(String value) { addCriterion("canbyagnenduser <=", value, "canbyagnenduser"); return (Criteria) this; } public Criteria andCanbyagnenduserLike(String value) { addCriterion("canbyagnenduser like", value, "canbyagnenduser"); return (Criteria) this; } public Criteria andCanbyagnenduserNotLike(String value) { addCriterion("canbyagnenduser not like", value, "canbyagnenduser"); return (Criteria) this; } public Criteria andCanbyagnenduserIn(List<String> values) { addCriterion("canbyagnenduser in", values, "canbyagnenduser"); return (Criteria) this; } public Criteria andCanbyagnenduserNotIn(List<String> values) { addCriterion("canbyagnenduser not in", values, "canbyagnenduser"); return (Criteria) this; } public Criteria andCanbyagnenduserBetween(String value1, String value2) { addCriterion("canbyagnenduser between", value1, value2, "canbyagnenduser"); return (Criteria) this; } public Criteria andCanbyagnenduserNotBetween(String value1, String value2) { addCriterion("canbyagnenduser not between", value1, value2, "canbyagnenduser"); return (Criteria) this; } public Criteria andCanbyagnIsNull() { addCriterion("canbyagn is null"); return (Criteria) this; } public Criteria andCanbyagnIsNotNull() { addCriterion("canbyagn is not null"); return (Criteria) this; } public Criteria andCanbyagnEqualTo(String value) { addCriterion("canbyagn =", value, "canbyagn"); return (Criteria) this; } public Criteria andCanbyagnNotEqualTo(String value) { addCriterion("canbyagn <>", value, "canbyagn"); return (Criteria) this; } public Criteria andCanbyagnGreaterThan(String value) { addCriterion("canbyagn >", value, "canbyagn"); return (Criteria) this; } public Criteria andCanbyagnGreaterThanOrEqualTo(String value) { addCriterion("canbyagn >=", value, "canbyagn"); return (Criteria) this; } public Criteria andCanbyagnLessThan(String value) { addCriterion("canbyagn <", value, "canbyagn"); return (Criteria) this; } public Criteria andCanbyagnLessThanOrEqualTo(String value) { addCriterion("canbyagn <=", value, "canbyagn"); return (Criteria) this; } public Criteria andCanbyagnLike(String value) { addCriterion("canbyagn like", value, "canbyagn"); return (Criteria) this; } public Criteria andCanbyagnNotLike(String value) { addCriterion("canbyagn not like", value, "canbyagn"); return (Criteria) this; } public Criteria andCanbyagnIn(List<String> values) { addCriterion("canbyagn in", values, "canbyagn"); return (Criteria) this; } public Criteria andCanbyagnNotIn(List<String> values) { addCriterion("canbyagn not in", values, "canbyagn"); return (Criteria) this; } public Criteria andCanbyagnBetween(String value1, String value2) { addCriterion("canbyagn between", value1, value2, "canbyagn"); return (Criteria) this; } public Criteria andCanbyagnNotBetween(String value1, String value2) { addCriterion("canbyagn not between", value1, value2, "canbyagn"); return (Criteria) this; } public Criteria andOrderbyidIsNull() { addCriterion("orderbyid is null"); return (Criteria) this; } public Criteria andOrderbyidIsNotNull() { addCriterion("orderbyid is not null"); return (Criteria) this; } public Criteria andOrderbyidEqualTo(Integer value) { addCriterion("orderbyid =", value, "orderbyid"); return (Criteria) this; } public Criteria andOrderbyidNotEqualTo(Integer value) { addCriterion("orderbyid <>", value, "orderbyid"); return (Criteria) this; } public Criteria andOrderbyidGreaterThan(Integer value) { addCriterion("orderbyid >", value, "orderbyid"); return (Criteria) this; } public Criteria andOrderbyidGreaterThanOrEqualTo(Integer value) { addCriterion("orderbyid >=", value, "orderbyid"); return (Criteria) this; } public Criteria andOrderbyidLessThan(Integer value) { addCriterion("orderbyid <", value, "orderbyid"); return (Criteria) this; } public Criteria andOrderbyidLessThanOrEqualTo(Integer value) { addCriterion("orderbyid <=", value, "orderbyid"); return (Criteria) this; } public Criteria andOrderbyidIn(List<Integer> values) { addCriterion("orderbyid in", values, "orderbyid"); return (Criteria) this; } public Criteria andOrderbyidNotIn(List<Integer> values) { addCriterion("orderbyid not in", values, "orderbyid"); return (Criteria) this; } public Criteria andOrderbyidBetween(Integer value1, Integer value2) { addCriterion("orderbyid between", value1, value2, "orderbyid"); return (Criteria) this; } public Criteria andOrderbyidNotBetween(Integer value1, Integer value2) { addCriterion("orderbyid not between", value1, value2, "orderbyid"); return (Criteria) this; } public Criteria andServerlistid2IsNull() { addCriterion("ServerlistID2 is null"); return (Criteria) this; } public Criteria andServerlistid2IsNotNull() { addCriterion("ServerlistID2 is not null"); return (Criteria) this; } public Criteria andServerlistid2EqualTo(Integer value) { addCriterion("ServerlistID2 =", value, "serverlistid2"); return (Criteria) this; } public Criteria andServerlistid2NotEqualTo(Integer value) { addCriterion("ServerlistID2 <>", value, "serverlistid2"); return (Criteria) this; } public Criteria andServerlistid2GreaterThan(Integer value) { addCriterion("ServerlistID2 >", value, "serverlistid2"); return (Criteria) this; } public Criteria andServerlistid2GreaterThanOrEqualTo(Integer value) { addCriterion("ServerlistID2 >=", value, "serverlistid2"); return (Criteria) this; } public Criteria andServerlistid2LessThan(Integer value) { addCriterion("ServerlistID2 <", value, "serverlistid2"); return (Criteria) this; } public Criteria andServerlistid2LessThanOrEqualTo(Integer value) { addCriterion("ServerlistID2 <=", value, "serverlistid2"); return (Criteria) this; } public Criteria andServerlistid2In(List<Integer> values) { addCriterion("ServerlistID2 in", values, "serverlistid2"); return (Criteria) this; } public Criteria andServerlistid2NotIn(List<Integer> values) { addCriterion("ServerlistID2 not in", values, "serverlistid2"); return (Criteria) this; } public Criteria andServerlistid2Between(Integer value1, Integer value2) { addCriterion("ServerlistID2 between", value1, value2, "serverlistid2"); return (Criteria) this; } public Criteria andServerlistid2NotBetween(Integer value1, Integer value2) { addCriterion("ServerlistID2 not between", value1, value2, "serverlistid2"); return (Criteria) this; } public Criteria andServerlistid3IsNull() { addCriterion("ServerlistID3 is null"); return (Criteria) this; } public Criteria andServerlistid3IsNotNull() { addCriterion("ServerlistID3 is not null"); return (Criteria) this; } public Criteria andServerlistid3EqualTo(Integer value) { addCriterion("ServerlistID3 =", value, "serverlistid3"); return (Criteria) this; } public Criteria andServerlistid3NotEqualTo(Integer value) { addCriterion("ServerlistID3 <>", value, "serverlistid3"); return (Criteria) this; } public Criteria andServerlistid3GreaterThan(Integer value) { addCriterion("ServerlistID3 >", value, "serverlistid3"); return (Criteria) this; } public Criteria andServerlistid3GreaterThanOrEqualTo(Integer value) { addCriterion("ServerlistID3 >=", value, "serverlistid3"); return (Criteria) this; } public Criteria andServerlistid3LessThan(Integer value) { addCriterion("ServerlistID3 <", value, "serverlistid3"); return (Criteria) this; } public Criteria andServerlistid3LessThanOrEqualTo(Integer value) { addCriterion("ServerlistID3 <=", value, "serverlistid3"); return (Criteria) this; } public Criteria andServerlistid3In(List<Integer> values) { addCriterion("ServerlistID3 in", values, "serverlistid3"); return (Criteria) this; } public Criteria andServerlistid3NotIn(List<Integer> values) { addCriterion("ServerlistID3 not in", values, "serverlistid3"); return (Criteria) this; } public Criteria andServerlistid3Between(Integer value1, Integer value2) { addCriterion("ServerlistID3 between", value1, value2, "serverlistid3"); return (Criteria) this; } public Criteria andServerlistid3NotBetween(Integer value1, Integer value2) { addCriterion("ServerlistID3 not between", value1, value2, "serverlistid3"); return (Criteria) this; } public Criteria andServerlistid4IsNull() { addCriterion("ServerlistID4 is null"); return (Criteria) this; } public Criteria andServerlistid4IsNotNull() { addCriterion("ServerlistID4 is not null"); return (Criteria) this; } public Criteria andServerlistid4EqualTo(Integer value) { addCriterion("ServerlistID4 =", value, "serverlistid4"); return (Criteria) this; } public Criteria andServerlistid4NotEqualTo(Integer value) { addCriterion("ServerlistID4 <>", value, "serverlistid4"); return (Criteria) this; } public Criteria andServerlistid4GreaterThan(Integer value) { addCriterion("ServerlistID4 >", value, "serverlistid4"); return (Criteria) this; } public Criteria andServerlistid4GreaterThanOrEqualTo(Integer value) { addCriterion("ServerlistID4 >=", value, "serverlistid4"); return (Criteria) this; } public Criteria andServerlistid4LessThan(Integer value) { addCriterion("ServerlistID4 <", value, "serverlistid4"); return (Criteria) this; } public Criteria andServerlistid4LessThanOrEqualTo(Integer value) { addCriterion("ServerlistID4 <=", value, "serverlistid4"); return (Criteria) this; } public Criteria andServerlistid4In(List<Integer> values) { addCriterion("ServerlistID4 in", values, "serverlistid4"); return (Criteria) this; } public Criteria andServerlistid4NotIn(List<Integer> values) { addCriterion("ServerlistID4 not in", values, "serverlistid4"); return (Criteria) this; } public Criteria andServerlistid4Between(Integer value1, Integer value2) { addCriterion("ServerlistID4 between", value1, value2, "serverlistid4"); return (Criteria) this; } public Criteria andServerlistid4NotBetween(Integer value1, Integer value2) { addCriterion("ServerlistID4 not between", value1, value2, "serverlistid4"); return (Criteria) this; } public Criteria andServerlistid5IsNull() { addCriterion("ServerlistID5 is null"); return (Criteria) this; } public Criteria andServerlistid5IsNotNull() { addCriterion("ServerlistID5 is not null"); return (Criteria) this; } public Criteria andServerlistid5EqualTo(Integer value) { addCriterion("ServerlistID5 =", value, "serverlistid5"); return (Criteria) this; } public Criteria andServerlistid5NotEqualTo(Integer value) { addCriterion("ServerlistID5 <>", value, "serverlistid5"); return (Criteria) this; } public Criteria andServerlistid5GreaterThan(Integer value) { addCriterion("ServerlistID5 >", value, "serverlistid5"); return (Criteria) this; } public Criteria andServerlistid5GreaterThanOrEqualTo(Integer value) { addCriterion("ServerlistID5 >=", value, "serverlistid5"); return (Criteria) this; } public Criteria andServerlistid5LessThan(Integer value) { addCriterion("ServerlistID5 <", value, "serverlistid5"); return (Criteria) this; } public Criteria andServerlistid5LessThanOrEqualTo(Integer value) { addCriterion("ServerlistID5 <=", value, "serverlistid5"); return (Criteria) this; } public Criteria andServerlistid5In(List<Integer> values) { addCriterion("ServerlistID5 in", values, "serverlistid5"); return (Criteria) this; } public Criteria andServerlistid5NotIn(List<Integer> values) { addCriterion("ServerlistID5 not in", values, "serverlistid5"); return (Criteria) this; } public Criteria andServerlistid5Between(Integer value1, Integer value2) { addCriterion("ServerlistID5 between", value1, value2, "serverlistid5"); return (Criteria) this; } public Criteria andServerlistid5NotBetween(Integer value1, Integer value2) { addCriterion("ServerlistID5 not between", value1, value2, "serverlistid5"); return (Criteria) this; } public Criteria andTypeidIsNull() { addCriterion("typeid is null"); return (Criteria) this; } public Criteria andTypeidIsNotNull() { addCriterion("typeid is not null"); return (Criteria) this; } public Criteria andTypeidEqualTo(Integer value) { addCriterion("typeid =", value, "typeid"); return (Criteria) this; } public Criteria andTypeidNotEqualTo(Integer value) { addCriterion("typeid <>", value, "typeid"); return (Criteria) this; } public Criteria andTypeidGreaterThan(Integer value) { addCriterion("typeid >", value, "typeid"); return (Criteria) this; } public Criteria andTypeidGreaterThanOrEqualTo(Integer value) { addCriterion("typeid >=", value, "typeid"); return (Criteria) this; } public Criteria andTypeidLessThan(Integer value) { addCriterion("typeid <", value, "typeid"); return (Criteria) this; } public Criteria andTypeidLessThanOrEqualTo(Integer value) { addCriterion("typeid <=", value, "typeid"); return (Criteria) this; } public Criteria andTypeidIn(List<Integer> values) { addCriterion("typeid in", values, "typeid"); return (Criteria) this; } public Criteria andTypeidNotIn(List<Integer> values) { addCriterion("typeid not in", values, "typeid"); return (Criteria) this; } public Criteria andTypeidBetween(Integer value1, Integer value2) { addCriterion("typeid between", value1, value2, "typeid"); return (Criteria) this; } public Criteria andTypeidNotBetween(Integer value1, Integer value2) { addCriterion("typeid not between", value1, value2, "typeid"); return (Criteria) this; } public Criteria andCanseasonIsNull() { addCriterion("canseason is null"); return (Criteria) this; } public Criteria andCanseasonIsNotNull() { addCriterion("canseason is not null"); return (Criteria) this; } public Criteria andCanseasonEqualTo(String value) { addCriterion("canseason =", value, "canseason"); return (Criteria) this; } public Criteria andCanseasonNotEqualTo(String value) { addCriterion("canseason <>", value, "canseason"); return (Criteria) this; } public Criteria andCanseasonGreaterThan(String value) { addCriterion("canseason >", value, "canseason"); return (Criteria) this; } public Criteria andCanseasonGreaterThanOrEqualTo(String value) { addCriterion("canseason >=", value, "canseason"); return (Criteria) this; } public Criteria andCanseasonLessThan(String value) { addCriterion("canseason <", value, "canseason"); return (Criteria) this; } public Criteria andCanseasonLessThanOrEqualTo(String value) { addCriterion("canseason <=", value, "canseason"); return (Criteria) this; } public Criteria andCanseasonLike(String value) { addCriterion("canseason like", value, "canseason"); return (Criteria) this; } public Criteria andCanseasonNotLike(String value) { addCriterion("canseason not like", value, "canseason"); return (Criteria) this; } public Criteria andCanseasonIn(List<String> values) { addCriterion("canseason in", values, "canseason"); return (Criteria) this; } public Criteria andCanseasonNotIn(List<String> values) { addCriterion("canseason not in", values, "canseason"); return (Criteria) this; } public Criteria andCanseasonBetween(String value1, String value2) { addCriterion("canseason between", value1, value2, "canseason"); return (Criteria) this; } public Criteria andCanseasonNotBetween(String value1, String value2) { addCriterion("canseason not between", value1, value2, "canseason"); return (Criteria) this; } public Criteria andUpdatebytypeidIsNull() { addCriterion("updatebytypeid is null"); return (Criteria) this; } public Criteria andUpdatebytypeidIsNotNull() { addCriterion("updatebytypeid is not null"); return (Criteria) this; } public Criteria andUpdatebytypeidEqualTo(String value) { addCriterion("updatebytypeid =", value, "updatebytypeid"); return (Criteria) this; } public Criteria andUpdatebytypeidNotEqualTo(String value) { addCriterion("updatebytypeid <>", value, "updatebytypeid"); return (Criteria) this; } public Criteria andUpdatebytypeidGreaterThan(String value) { addCriterion("updatebytypeid >", value, "updatebytypeid"); return (Criteria) this; } public Criteria andUpdatebytypeidGreaterThanOrEqualTo(String value) { addCriterion("updatebytypeid >=", value, "updatebytypeid"); return (Criteria) this; } public Criteria andUpdatebytypeidLessThan(String value) { addCriterion("updatebytypeid <", value, "updatebytypeid"); return (Criteria) this; } public Criteria andUpdatebytypeidLessThanOrEqualTo(String value) { addCriterion("updatebytypeid <=", value, "updatebytypeid"); return (Criteria) this; } public Criteria andUpdatebytypeidLike(String value) { addCriterion("updatebytypeid like", value, "updatebytypeid"); return (Criteria) this; } public Criteria andUpdatebytypeidNotLike(String value) { addCriterion("updatebytypeid not like", value, "updatebytypeid"); return (Criteria) this; } public Criteria andUpdatebytypeidIn(List<String> values) { addCriterion("updatebytypeid in", values, "updatebytypeid"); return (Criteria) this; } public Criteria andUpdatebytypeidNotIn(List<String> values) { addCriterion("updatebytypeid not in", values, "updatebytypeid"); return (Criteria) this; } public Criteria andUpdatebytypeidBetween(String value1, String value2) { addCriterion("updatebytypeid between", value1, value2, "updatebytypeid"); return (Criteria) this; } public Criteria andUpdatebytypeidNotBetween(String value1, String value2) { addCriterion("updatebytypeid not between", value1, value2, "updatebytypeid"); return (Criteria) this; } public Criteria andCanupdatespaceIsNull() { addCriterion("canupdatespace is null"); return (Criteria) this; } public Criteria andCanupdatespaceIsNotNull() { addCriterion("canupdatespace is not null"); return (Criteria) this; } public Criteria andCanupdatespaceEqualTo(String value) { addCriterion("canupdatespace =", value, "canupdatespace"); return (Criteria) this; } public Criteria andCanupdatespaceNotEqualTo(String value) { addCriterion("canupdatespace <>", value, "canupdatespace"); return (Criteria) this; } public Criteria andCanupdatespaceGreaterThan(String value) { addCriterion("canupdatespace >", value, "canupdatespace"); return (Criteria) this; } public Criteria andCanupdatespaceGreaterThanOrEqualTo(String value) { addCriterion("canupdatespace >=", value, "canupdatespace"); return (Criteria) this; } public Criteria andCanupdatespaceLessThan(String value) { addCriterion("canupdatespace <", value, "canupdatespace"); return (Criteria) this; } public Criteria andCanupdatespaceLessThanOrEqualTo(String value) { addCriterion("canupdatespace <=", value, "canupdatespace"); return (Criteria) this; } public Criteria andCanupdatespaceLike(String value) { addCriterion("canupdatespace like", value, "canupdatespace"); return (Criteria) this; } public Criteria andCanupdatespaceNotLike(String value) { addCriterion("canupdatespace not like", value, "canupdatespace"); return (Criteria) this; } public Criteria andCanupdatespaceIn(List<String> values) { addCriterion("canupdatespace in", values, "canupdatespace"); return (Criteria) this; } public Criteria andCanupdatespaceNotIn(List<String> values) { addCriterion("canupdatespace not in", values, "canupdatespace"); return (Criteria) this; } public Criteria andCanupdatespaceBetween(String value1, String value2) { addCriterion("canupdatespace between", value1, value2, "canupdatespace"); return (Criteria) this; } public Criteria andCanupdatespaceNotBetween(String value1, String value2) { addCriterion("canupdatespace not between", value1, value2, "canupdatespace"); return (Criteria) this; } public Criteria andUpdatespacemoneyIsNull() { addCriterion("updatespacemoney is null"); return (Criteria) this; } public Criteria andUpdatespacemoneyIsNotNull() { addCriterion("updatespacemoney is not null"); return (Criteria) this; } public Criteria andUpdatespacemoneyEqualTo(BigDecimal value) { addCriterion("updatespacemoney =", value, "updatespacemoney"); return (Criteria) this; } public Criteria andUpdatespacemoneyNotEqualTo(BigDecimal value) { addCriterion("updatespacemoney <>", value, "updatespacemoney"); return (Criteria) this; } public Criteria andUpdatespacemoneyGreaterThan(BigDecimal value) { addCriterion("updatespacemoney >", value, "updatespacemoney"); return (Criteria) this; } public Criteria andUpdatespacemoneyGreaterThanOrEqualTo(BigDecimal value) { addCriterion("updatespacemoney >=", value, "updatespacemoney"); return (Criteria) this; } public Criteria andUpdatespacemoneyLessThan(BigDecimal value) { addCriterion("updatespacemoney <", value, "updatespacemoney"); return (Criteria) this; } public Criteria andUpdatespacemoneyLessThanOrEqualTo(BigDecimal value) { addCriterion("updatespacemoney <=", value, "updatespacemoney"); return (Criteria) this; } public Criteria andUpdatespacemoneyIn(List<BigDecimal> values) { addCriterion("updatespacemoney in", values, "updatespacemoney"); return (Criteria) this; } public Criteria andUpdatespacemoneyNotIn(List<BigDecimal> values) { addCriterion("updatespacemoney not in", values, "updatespacemoney"); return (Criteria) this; } public Criteria andUpdatespacemoneyBetween(BigDecimal value1, BigDecimal value2) { addCriterion("updatespacemoney between", value1, value2, "updatespacemoney"); return (Criteria) this; } public Criteria andUpdatespacemoneyNotBetween(BigDecimal value1, BigDecimal value2) { addCriterion("updatespacemoney not between", value1, value2, "updatespacemoney"); return (Criteria) this; } public Criteria andPayMonthIsNull() { addCriterion("PAY_Month is null"); return (Criteria) this; } public Criteria andPayMonthIsNotNull() { addCriterion("PAY_Month is not null"); return (Criteria) this; } public Criteria andPayMonthEqualTo(String value) { addCriterion("PAY_Month =", value, "payMonth"); return (Criteria) this; } public Criteria andPayMonthNotEqualTo(String value) { addCriterion("PAY_Month <>", value, "payMonth"); return (Criteria) this; } public Criteria andPayMonthGreaterThan(String value) { addCriterion("PAY_Month >", value, "payMonth"); return (Criteria) this; } public Criteria andPayMonthGreaterThanOrEqualTo(String value) { addCriterion("PAY_Month >=", value, "payMonth"); return (Criteria) this; } public Criteria andPayMonthLessThan(String value) { addCriterion("PAY_Month <", value, "payMonth"); return (Criteria) this; } public Criteria andPayMonthLessThanOrEqualTo(String value) { addCriterion("PAY_Month <=", value, "payMonth"); return (Criteria) this; } public Criteria andPayMonthLike(String value) { addCriterion("PAY_Month like", value, "payMonth"); return (Criteria) this; } public Criteria andPayMonthNotLike(String value) { addCriterion("PAY_Month not like", value, "payMonth"); return (Criteria) this; } public Criteria andPayMonthIn(List<String> values) { addCriterion("PAY_Month in", values, "payMonth"); return (Criteria) this; } public Criteria andPayMonthNotIn(List<String> values) { addCriterion("PAY_Month not in", values, "payMonth"); return (Criteria) this; } public Criteria andPayMonthBetween(String value1, String value2) { addCriterion("PAY_Month between", value1, value2, "payMonth"); return (Criteria) this; } public Criteria andPayMonthNotBetween(String value1, String value2) { addCriterion("PAY_Month not between", value1, value2, "payMonth"); return (Criteria) this; } public Criteria andPaySeasonIsNull() { addCriterion("PAY_Season is null"); return (Criteria) this; } public Criteria andPaySeasonIsNotNull() { addCriterion("PAY_Season is not null"); return (Criteria) this; } public Criteria andPaySeasonEqualTo(String value) { addCriterion("PAY_Season =", value, "paySeason"); return (Criteria) this; } public Criteria andPaySeasonNotEqualTo(String value) { addCriterion("PAY_Season <>", value, "paySeason"); return (Criteria) this; } public Criteria andPaySeasonGreaterThan(String value) { addCriterion("PAY_Season >", value, "paySeason"); return (Criteria) this; } public Criteria andPaySeasonGreaterThanOrEqualTo(String value) { addCriterion("PAY_Season >=", value, "paySeason"); return (Criteria) this; } public Criteria andPaySeasonLessThan(String value) { addCriterion("PAY_Season <", value, "paySeason"); return (Criteria) this; } public Criteria andPaySeasonLessThanOrEqualTo(String value) { addCriterion("PAY_Season <=", value, "paySeason"); return (Criteria) this; } public Criteria andPaySeasonLike(String value) { addCriterion("PAY_Season like", value, "paySeason"); return (Criteria) this; } public Criteria andPaySeasonNotLike(String value) { addCriterion("PAY_Season not like", value, "paySeason"); return (Criteria) this; } public Criteria andPaySeasonIn(List<String> values) { addCriterion("PAY_Season in", values, "paySeason"); return (Criteria) this; } public Criteria andPaySeasonNotIn(List<String> values) { addCriterion("PAY_Season not in", values, "paySeason"); return (Criteria) this; } public Criteria andPaySeasonBetween(String value1, String value2) { addCriterion("PAY_Season between", value1, value2, "paySeason"); return (Criteria) this; } public Criteria andPaySeasonNotBetween(String value1, String value2) { addCriterion("PAY_Season not between", value1, value2, "paySeason"); return (Criteria) this; } public Criteria andPayHalfyearIsNull() { addCriterion("PAY_halfyear is null"); return (Criteria) this; } public Criteria andPayHalfyearIsNotNull() { addCriterion("PAY_halfyear is not null"); return (Criteria) this; } public Criteria andPayHalfyearEqualTo(String value) { addCriterion("PAY_halfyear =", value, "payHalfyear"); return (Criteria) this; } public Criteria andPayHalfyearNotEqualTo(String value) { addCriterion("PAY_halfyear <>", value, "payHalfyear"); return (Criteria) this; } public Criteria andPayHalfyearGreaterThan(String value) { addCriterion("PAY_halfyear >", value, "payHalfyear"); return (Criteria) this; } public Criteria andPayHalfyearGreaterThanOrEqualTo(String value) { addCriterion("PAY_halfyear >=", value, "payHalfyear"); return (Criteria) this; } public Criteria andPayHalfyearLessThan(String value) { addCriterion("PAY_halfyear <", value, "payHalfyear"); return (Criteria) this; } public Criteria andPayHalfyearLessThanOrEqualTo(String value) { addCriterion("PAY_halfyear <=", value, "payHalfyear"); return (Criteria) this; } public Criteria andPayHalfyearLike(String value) { addCriterion("PAY_halfyear like", value, "payHalfyear"); return (Criteria) this; } public Criteria andPayHalfyearNotLike(String value) { addCriterion("PAY_halfyear not like", value, "payHalfyear"); return (Criteria) this; } public Criteria andPayHalfyearIn(List<String> values) { addCriterion("PAY_halfyear in", values, "payHalfyear"); return (Criteria) this; } public Criteria andPayHalfyearNotIn(List<String> values) { addCriterion("PAY_halfyear not in", values, "payHalfyear"); return (Criteria) this; } public Criteria andPayHalfyearBetween(String value1, String value2) { addCriterion("PAY_halfyear between", value1, value2, "payHalfyear"); return (Criteria) this; } public Criteria andPayHalfyearNotBetween(String value1, String value2) { addCriterion("PAY_halfyear not between", value1, value2, "payHalfyear"); return (Criteria) this; } public Criteria andPayNextyearIsNull() { addCriterion("PAY_Nextyear is null"); return (Criteria) this; } public Criteria andPayNextyearIsNotNull() { addCriterion("PAY_Nextyear is not null"); return (Criteria) this; } public Criteria andPayNextyearEqualTo(String value) { addCriterion("PAY_Nextyear =", value, "payNextyear"); return (Criteria) this; } public Criteria andPayNextyearNotEqualTo(String value) { addCriterion("PAY_Nextyear <>", value, "payNextyear"); return (Criteria) this; } public Criteria andPayNextyearGreaterThan(String value) { addCriterion("PAY_Nextyear >", value, "payNextyear"); return (Criteria) this; } public Criteria andPayNextyearGreaterThanOrEqualTo(String value) { addCriterion("PAY_Nextyear >=", value, "payNextyear"); return (Criteria) this; } public Criteria andPayNextyearLessThan(String value) { addCriterion("PAY_Nextyear <", value, "payNextyear"); return (Criteria) this; } public Criteria andPayNextyearLessThanOrEqualTo(String value) { addCriterion("PAY_Nextyear <=", value, "payNextyear"); return (Criteria) this; } public Criteria andPayNextyearLike(String value) { addCriterion("PAY_Nextyear like", value, "payNextyear"); return (Criteria) this; } public Criteria andPayNextyearNotLike(String value) { addCriterion("PAY_Nextyear not like", value, "payNextyear"); return (Criteria) this; } public Criteria andPayNextyearIn(List<String> values) { addCriterion("PAY_Nextyear in", values, "payNextyear"); return (Criteria) this; } public Criteria andPayNextyearNotIn(List<String> values) { addCriterion("PAY_Nextyear not in", values, "payNextyear"); return (Criteria) this; } public Criteria andPayNextyearBetween(String value1, String value2) { addCriterion("PAY_Nextyear between", value1, value2, "payNextyear"); return (Criteria) this; } public Criteria andPayNextyearNotBetween(String value1, String value2) { addCriterion("PAY_Nextyear not between", value1, value2, "payNextyear"); return (Criteria) this; } public Criteria andPay2yearIsNull() { addCriterion("PAY_2year is null"); return (Criteria) this; } public Criteria andPay2yearIsNotNull() { addCriterion("PAY_2year is not null"); return (Criteria) this; } public Criteria andPay2yearEqualTo(String value) { addCriterion("PAY_2year =", value, "pay2year"); return (Criteria) this; } public Criteria andPay2yearNotEqualTo(String value) { addCriterion("PAY_2year <>", value, "pay2year"); return (Criteria) this; } public Criteria andPay2yearGreaterThan(String value) { addCriterion("PAY_2year >", value, "pay2year"); return (Criteria) this; } public Criteria andPay2yearGreaterThanOrEqualTo(String value) { addCriterion("PAY_2year >=", value, "pay2year"); return (Criteria) this; } public Criteria andPay2yearLessThan(String value) { addCriterion("PAY_2year <", value, "pay2year"); return (Criteria) this; } public Criteria andPay2yearLessThanOrEqualTo(String value) { addCriterion("PAY_2year <=", value, "pay2year"); return (Criteria) this; } public Criteria andPay2yearLike(String value) { addCriterion("PAY_2year like", value, "pay2year"); return (Criteria) this; } public Criteria andPay2yearNotLike(String value) { addCriterion("PAY_2year not like", value, "pay2year"); return (Criteria) this; } public Criteria andPay2yearIn(List<String> values) { addCriterion("PAY_2year in", values, "pay2year"); return (Criteria) this; } public Criteria andPay2yearNotIn(List<String> values) { addCriterion("PAY_2year not in", values, "pay2year"); return (Criteria) this; } public Criteria andPay2yearBetween(String value1, String value2) { addCriterion("PAY_2year between", value1, value2, "pay2year"); return (Criteria) this; } public Criteria andPay2yearNotBetween(String value1, String value2) { addCriterion("PAY_2year not between", value1, value2, "pay2year"); return (Criteria) this; } public Criteria andPay3yearIsNull() { addCriterion("PAY_3year is null"); return (Criteria) this; } public Criteria andPay3yearIsNotNull() { addCriterion("PAY_3year is not null"); return (Criteria) this; } public Criteria andPay3yearEqualTo(String value) { addCriterion("PAY_3year =", value, "pay3year"); return (Criteria) this; } public Criteria andPay3yearNotEqualTo(String value) { addCriterion("PAY_3year <>", value, "pay3year"); return (Criteria) this; } public Criteria andPay3yearGreaterThan(String value) { addCriterion("PAY_3year >", value, "pay3year"); return (Criteria) this; } public Criteria andPay3yearGreaterThanOrEqualTo(String value) { addCriterion("PAY_3year >=", value, "pay3year"); return (Criteria) this; } public Criteria andPay3yearLessThan(String value) { addCriterion("PAY_3year <", value, "pay3year"); return (Criteria) this; } public Criteria andPay3yearLessThanOrEqualTo(String value) { addCriterion("PAY_3year <=", value, "pay3year"); return (Criteria) this; } public Criteria andPay3yearLike(String value) { addCriterion("PAY_3year like", value, "pay3year"); return (Criteria) this; } public Criteria andPay3yearNotLike(String value) { addCriterion("PAY_3year not like", value, "pay3year"); return (Criteria) this; } public Criteria andPay3yearIn(List<String> values) { addCriterion("PAY_3year in", values, "pay3year"); return (Criteria) this; } public Criteria andPay3yearNotIn(List<String> values) { addCriterion("PAY_3year not in", values, "pay3year"); return (Criteria) this; } public Criteria andPay3yearBetween(String value1, String value2) { addCriterion("PAY_3year between", value1, value2, "pay3year"); return (Criteria) this; } public Criteria andPay3yearNotBetween(String value1, String value2) { addCriterion("PAY_3year not between", value1, value2, "pay3year"); return (Criteria) this; } public Criteria andPay4yearIsNull() { addCriterion("PAY_4year is null"); return (Criteria) this; } public Criteria andPay4yearIsNotNull() { addCriterion("PAY_4year is not null"); return (Criteria) this; } public Criteria andPay4yearEqualTo(String value) { addCriterion("PAY_4year =", value, "pay4year"); return (Criteria) this; } public Criteria andPay4yearNotEqualTo(String value) { addCriterion("PAY_4year <>", value, "pay4year"); return (Criteria) this; } public Criteria andPay4yearGreaterThan(String value) { addCriterion("PAY_4year >", value, "pay4year"); return (Criteria) this; } public Criteria andPay4yearGreaterThanOrEqualTo(String value) { addCriterion("PAY_4year >=", value, "pay4year"); return (Criteria) this; } public Criteria andPay4yearLessThan(String value) { addCriterion("PAY_4year <", value, "pay4year"); return (Criteria) this; } public Criteria andPay4yearLessThanOrEqualTo(String value) { addCriterion("PAY_4year <=", value, "pay4year"); return (Criteria) this; } public Criteria andPay4yearLike(String value) { addCriterion("PAY_4year like", value, "pay4year"); return (Criteria) this; } public Criteria andPay4yearNotLike(String value) { addCriterion("PAY_4year not like", value, "pay4year"); return (Criteria) this; } public Criteria andPay4yearIn(List<String> values) { addCriterion("PAY_4year in", values, "pay4year"); return (Criteria) this; } public Criteria andPay4yearNotIn(List<String> values) { addCriterion("PAY_4year not in", values, "pay4year"); return (Criteria) this; } public Criteria andPay4yearBetween(String value1, String value2) { addCriterion("PAY_4year between", value1, value2, "pay4year"); return (Criteria) this; } public Criteria andPay4yearNotBetween(String value1, String value2) { addCriterion("PAY_4year not between", value1, value2, "pay4year"); return (Criteria) this; } public Criteria andPay5yearIsNull() { addCriterion("PAY_5year is null"); return (Criteria) this; } public Criteria andPay5yearIsNotNull() { addCriterion("PAY_5year is not null"); return (Criteria) this; } public Criteria andPay5yearEqualTo(String value) { addCriterion("PAY_5year =", value, "pay5year"); return (Criteria) this; } public Criteria andPay5yearNotEqualTo(String value) { addCriterion("PAY_5year <>", value, "pay5year"); return (Criteria) this; } public Criteria andPay5yearGreaterThan(String value) { addCriterion("PAY_5year >", value, "pay5year"); return (Criteria) this; } public Criteria andPay5yearGreaterThanOrEqualTo(String value) { addCriterion("PAY_5year >=", value, "pay5year"); return (Criteria) this; } public Criteria andPay5yearLessThan(String value) { addCriterion("PAY_5year <", value, "pay5year"); return (Criteria) this; } public Criteria andPay5yearLessThanOrEqualTo(String value) { addCriterion("PAY_5year <=", value, "pay5year"); return (Criteria) this; } public Criteria andPay5yearLike(String value) { addCriterion("PAY_5year like", value, "pay5year"); return (Criteria) this; } public Criteria andPay5yearNotLike(String value) { addCriterion("PAY_5year not like", value, "pay5year"); return (Criteria) this; } public Criteria andPay5yearIn(List<String> values) { addCriterion("PAY_5year in", values, "pay5year"); return (Criteria) this; } public Criteria andPay5yearNotIn(List<String> values) { addCriterion("PAY_5year not in", values, "pay5year"); return (Criteria) this; } public Criteria andPay5yearBetween(String value1, String value2) { addCriterion("PAY_5year between", value1, value2, "pay5year"); return (Criteria) this; } public Criteria andPay5yearNotBetween(String value1, String value2) { addCriterion("PAY_5year not between", value1, value2, "pay5year"); return (Criteria) this; } public Criteria andOnlyusebyagnIsNull() { addCriterion("onlyusebyagn is null"); return (Criteria) this; } public Criteria andOnlyusebyagnIsNotNull() { addCriterion("onlyusebyagn is not null"); return (Criteria) this; } public Criteria andOnlyusebyagnEqualTo(String value) { addCriterion("onlyusebyagn =", value, "onlyusebyagn"); return (Criteria) this; } public Criteria andOnlyusebyagnNotEqualTo(String value) { addCriterion("onlyusebyagn <>", value, "onlyusebyagn"); return (Criteria) this; } public Criteria andOnlyusebyagnGreaterThan(String value) { addCriterion("onlyusebyagn >", value, "onlyusebyagn"); return (Criteria) this; } public Criteria andOnlyusebyagnGreaterThanOrEqualTo(String value) { addCriterion("onlyusebyagn >=", value, "onlyusebyagn"); return (Criteria) this; } public Criteria andOnlyusebyagnLessThan(String value) { addCriterion("onlyusebyagn <", value, "onlyusebyagn"); return (Criteria) this; } public Criteria andOnlyusebyagnLessThanOrEqualTo(String value) { addCriterion("onlyusebyagn <=", value, "onlyusebyagn"); return (Criteria) this; } public Criteria andOnlyusebyagnLike(String value) { addCriterion("onlyusebyagn like", value, "onlyusebyagn"); return (Criteria) this; } public Criteria andOnlyusebyagnNotLike(String value) { addCriterion("onlyusebyagn not like", value, "onlyusebyagn"); return (Criteria) this; } public Criteria andOnlyusebyagnIn(List<String> values) { addCriterion("onlyusebyagn in", values, "onlyusebyagn"); return (Criteria) this; } public Criteria andOnlyusebyagnNotIn(List<String> values) { addCriterion("onlyusebyagn not in", values, "onlyusebyagn"); return (Criteria) this; } public Criteria andOnlyusebyagnBetween(String value1, String value2) { addCriterion("onlyusebyagn between", value1, value2, "onlyusebyagn"); return (Criteria) this; } public Criteria andOnlyusebyagnNotBetween(String value1, String value2) { addCriterion("onlyusebyagn not between", value1, value2, "onlyusebyagn"); return (Criteria) this; } } /** * This class was generated by MyBatis Generator. * This class corresponds to the database table FreeHost_SqlProductlist * * @mbg.generated do_not_delete_during_merge Fri May 11 11:16:07 CST 2018 */ public static class Criteria extends GeneratedCriteria { protected Criteria() { super(); } } /** * This class was generated by MyBatis Generator. * This class corresponds to the database table FreeHost_SqlProductlist * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public static class Criterion { private String condition; private Object value; private Object secondValue; private boolean noValue; private boolean singleValue; private boolean betweenValue; private boolean listValue; private String typeHandler; public String getCondition() { return condition; } public Object getValue() { return value; } public Object getSecondValue() { return secondValue; } public boolean isNoValue() { return noValue; } public boolean isSingleValue() { return singleValue; } public boolean isBetweenValue() { return betweenValue; } public boolean isListValue() { return listValue; } public String getTypeHandler() { return typeHandler; } protected Criterion(String condition) { super(); this.condition = condition; this.typeHandler = null; this.noValue = true; } protected Criterion(String condition, Object value, String typeHandler) { super(); this.condition = condition; this.value = value; this.typeHandler = typeHandler; if (value instanceof List<?>) { this.listValue = true; } else { this.singleValue = true; } } protected Criterion(String condition, Object value) { this(condition, value, null); } protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { super(); this.condition = condition; this.value = value; this.secondValue = secondValue; this.typeHandler = typeHandler; this.betweenValue = true; } protected Criterion(String condition, Object value, Object secondValue) { this(condition, value, secondValue, null); } } }
package com.web.TestNgRltd; import java.io.IOException; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.firefox.FirefoxDriver; import org.testng.Assert; import org.testng.ITestResult; import org.testng.annotations.AfterClass; import org.testng.annotations.AfterMethod; import org.testng.annotations.AfterTest; import org.testng.annotations.Test; public class ParallelExc { WebDriver driver; @Test public void chrmBrw(){ System.setProperty("webdriver.chrome.driver", "D:\\BrowserDrivers\\chromedriver.exe"); driver=new ChromeDriver(); driver.navigate().to("https://chaipoint.com/"); driver.manage().window().maximize(); // driver.findElement(By.xpath("//input[@type='checkbox']")).click(); // Assert.assertTrue(false); } @Test public void fireFoxBrowser(){ driver=new FirefoxDriver(); driver.navigate().to("https://www.wikipedia.org/"); driver.manage().window().maximize(); // driver.findElement(By.xpath("input[@type='checkbox']")).click(); } @AfterMethod() public void tearDown(ITestResult result) throws IOException{ if(ITestResult.FAILURE==result.getStatus()){ FailedScreenShot.captureScreenShots(driver, result.getName()); } driver.quit(); } /*@AfterClass() public void closeBrwser(){ driver.quit(); }*/ }
package org.firstinspires.ftc.teamcode; import com.qualcomm.robotcore.eventloop.opmode.OpMode; import com.qualcomm.robotcore.eventloop.opmode.TeleOp; import com.qualcomm.robotcore.hardware.DcMotor; import com.qualcomm.robotcore.hardware.Servo; import com.qualcomm.robotcore.hardware.TouchSensor; import com.qualcomm.robotcore.hardware.GyroSensor; /** * Created by Team 10464 on 9/21/16. */ @TeleOp(name="Protobot Tank", group="Protobot") public class ProtoBot extends OpMode { private DcMotor motorUp; private DcMotor motorDown; private DcMotor motorLeft; private DcMotor motorRight; private DcMotor motorRightShooter; private DcMotor motorLeftShooter; private DcMotor motorConveyer; private Servo servoCollector; private Servo servoLeftButton; private Servo servoRightButton; private TouchSensor touchRight; private GyroSensor gyro; private double resetTime; private int cDist, lDist, dDist, tDist; public void init(){ motorUp = hardwareMap.dcMotor.get("front"); motorDown = hardwareMap.dcMotor.get("back"); motorLeft = hardwareMap.dcMotor.get("left"); motorRight = hardwareMap.dcMotor.get("right"); motorRightShooter = hardwareMap.dcMotor.get("r_shoot"); motorLeftShooter = hardwareMap.dcMotor.get("l_shoot"); motorConveyer = hardwareMap.dcMotor.get("conveyor"); servoCollector = hardwareMap.servo.get("collector"); servoLeftButton = hardwareMap.servo.get("l_button"); servoRightButton = hardwareMap.servo.get("r_button"); touchRight = hardwareMap.touchSensor.get("right_touch"); gyro = hardwareMap.gyroSensor.get("gyro"); gyro.calibrate(); motorUp.setDirection(DcMotor.Direction.REVERSE); motorLeft.setDirection(DcMotor.Direction.REVERSE); motorRightShooter.setDirection(DcMotor.Direction.REVERSE); } public void loop(){ int theta = gyro.getHeading(); // Used to get spin speed of shooting motors // lDist - last read encoder value // cDist - current encoder value // dDist - encoder degrees between lDist and cDist (distance traveled) // tDist - total distance traveled since we reset // resetTime - time since reset lDist = cDist; cDist = motorRightShooter.getCurrentPosition(); dDist = cDist - lDist; tDist += dDist; // motorspeed = dx/dt * (60 seconds/1 minute) * (1 rotation/1120 encoder degrees) = (rotations/minute) double motorSpeed = 60*tDist/(getRuntime() - resetTime)/1120; // Drivetrain controls if(gamepad1.left_trigger > .1 || gamepad1.right_trigger > .1){ if(gamepad1.left_trigger > gamepad1.right_trigger){ motorUp.setPower(gamepad1.left_trigger); motorLeft.setPower(gamepad1.left_trigger); motorDown.setPower(-gamepad1.left_trigger); motorRight.setPower(-gamepad1.left_trigger); }else{ motorUp.setPower(-gamepad1.right_trigger); motorLeft.setPower(-gamepad1.right_trigger); motorDown.setPower(gamepad1.right_trigger); motorRight.setPower(gamepad1.right_trigger); } }else{ motorUp.setPower(-gamepad1.left_stick_x); motorDown.setPower(-gamepad1.left_stick_x); motorLeft.setPower(gamepad1.left_stick_y); motorRight.setPower(gamepad1.left_stick_y); } // Activates shooters if(gamepad1.b){ motorRightShooter.setPower(1); motorLeftShooter.setPower(1); motorConveyer.setPower(1); }else if(gamepad1.a){ motorRightShooter.setPower(-1); motorLeftShooter.setPower(-1); motorConveyer.setPower(-1); }else{ motorRightShooter.setPower(0); motorLeftShooter.setPower(0); motorConveyer.setPower(0); } // Activates collectors if(gamepad1.x){ servoCollector.setPosition(1); }else if(gamepad1.y){ servoCollector.setPosition(0); }else{ servoCollector.setPosition(.5); } if(gamepad1.right_bumper){ servoLeftButton.setPosition(0); servoRightButton.setPosition(0); }else if(gamepad1.left_bumper){ servoLeftButton.setPosition(1); servoRightButton.setPosition(1); }else{ servoLeftButton.setPosition(.5); servoRightButton.setPosition(.5); } // Put telemetry here telemetry.addData("motor speed", motorSpeed); telemetry.addData("theta", theta); } }
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package modelo; import rede.JogadaSoletrando; /** * * @author Bisnaguete */ public class Partida { private Jogador jogadorEu; private Jogador jogadorOponente; private boolean conectado; private Nivel nivelAtual; private Vez vez; private int contadorRodada; private int vencedor; public Partida() { jogadorEu = new Jogador(); jogadorOponente = new Jogador(); conectado = false; nivelAtual = new Nivel(1); vez = new Vez(null); } public boolean ouvirPalavra() { boolean podeOuvir = vez.podeOuvir(); if(podeOuvir) { vez.ouvirPalavra(); vez.decrementarPodeOuvir(); } return podeOuvir; } public void adicionarLetra(char letra) { vez.adicionarLetra(letra); } public boolean verificarGrafia() { return vez.verificaGrafia(); } public boolean isPrimeiroDaRodada() { return jogadorEu.isPrimeiroDaRodada(); } public boolean comparaEstadoJogadores() { return jogadorEu.getAcertou() == jogadorOponente.getAcertou(); } public void verificaVencedor() { if(comparaEstadoJogadores()) { setVencedor(0); } else { if(jogadorEu.getAcertou()) { setVencedor(-1); } else { setVencedor(1); } } } public void iniciarVez(){ incrementarContadorRodada(); if(contadorRodada > 10) { proximoNivel(); if(isPrimeiroDaRodada()) { setContadorRodada(1); } else { setContadorRodada(2); } } Palavra palavra = getProximaPalavra(); setVez(new Vez(palavra)); } public void setConfirmouPalavra() { vez.setPalavraConfirmada(true); } public boolean getConectado() { return conectado; } public void setConectado(boolean conectado) { this.conectado = conectado; } public void setPrimeiroDaRodada(int posicao) { if(posicao == 1) jogadorEu.setPrimeiroDaRodada(true); else jogadorEu.setPrimeiroDaRodada(false); } //REVISAR : Diagrama de sequencia, como atribuir o contadorRodda = 1? public Palavra getProximaPalavra() { return nivelAtual.getPalavra(contadorRodada); } public void setNome(String nome) { jogadorEu.setNome(nome); } public void setNomeAdversario(String nome) { jogadorOponente.setNome(nome); } private void incrementarContadorRodada() { contadorRodada = contadorRodada+2; } private void proximoNivel() { nivelAtual = new Nivel(nivelAtual.getNivel()+1); } public int getContadorRodada() { return contadorRodada; } public void setContadorRodada(int contadorRodada) { this.contadorRodada = contadorRodada; } public void setVez(Vez vez) { this.vez = vez; } public JogadaSoletrando instanciarJogada() { JogadaSoletrando jogada = new JogadaSoletrando(); jogada.setAcertou(jogadorEu.getAcertou()); jogada.setConfirmouPalavra(vez.getPalavraConfirmada()); jogada.setCaractere(vez.getUltimoCaractere()); jogada.setVencedor(getVencedor()); return jogada; } public int getVencedor() { return vencedor; } public void setVencedor(int vencedor) { this.vencedor = vencedor; } public String getSinonimo() { return vez.getSinonimo(); } public String getSignificado() { return vez.getSignificado(); } public String getFrase() { return vez.getFrase(); } public void setAcertouOponente(boolean acertou) { jogadorOponente.setAcertou(acertou); } public void setAcerteiPalavra(boolean acertou) { jogadorEu.setAcertou(acertou); } public String getNivelAtual() { return String.valueOf(nivelAtual.getNivel()); } public String getRodadaAtual() { return String.valueOf(contadorRodada); } }
package com.jack.jkbase.service.impl; import com.jack.jkbase.annotation.Operation; import com.jack.jkbase.config.ShiroConfig; import com.jack.jkbase.entity.SysUser; import com.jack.jkbase.entity.ViewSysUser; import com.jack.jkbase.mapper.SysUserMapper; import com.jack.jkbase.mapper.ViewSysUserMapper; import com.jack.jkbase.service.ISysUserService; import com.jack.jkbase.util.Helper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; /** * <p> * 服务实现类 * </p> * * @author LIBO * @since 2020-09-23 */ @Service public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> implements ISysUserService { @Autowired ViewSysUserMapper viewMapper; public ViewSysUserMapper getViewMapper() { return viewMapper; } @Operation(type=Helper.logTypeOperation,desc="用户更改个人密码",arguDesc={"用户ID",""}) public boolean updatePassword(int userid,String password,String salt){ return update(null,Wrappers.lambdaUpdate(SysUser.class).eq(SysUser::getUserid, userid) .set(SysUser::getuPwd, ShiroConfig.hashUserPwd(password,salt)) ); } public boolean updateUserInfo(int userid,int companyid,String mobile,String nick){ return update(null,Wrappers.lambdaUpdate(SysUser.class).eq(SysUser::getUserid, userid) .set(SysUser::getuCompanyid, companyid) .set(SysUser::getuCname, nick) .set(SysUser::getuMobileno, mobile) ); } //@Operation(type=Helper.logTypeOperation,desc="用户修改头像",arguDesc={"用户ID",""}) public boolean updatePhoto(int userid,String photo){ return update(null,Wrappers.lambdaUpdate(SysUser.class).eq(SysUser::getUserid, userid) .set(SysUser::getuPhotourl, photo) ); } //根据角色id查找用户列表,不包含超级管理员 public List<ViewSysUser> selectByRoleExclude(int roleId){ String sql = String.format("select R_UserID from sys_user_role where R_RoleID =%d ",roleId); return viewMapper.selectList(Wrappers.lambdaQuery(ViewSysUser.class) .select(SysUser::getUserid,SysUser::getuCname,ViewSysUser::getuCompanyname) .ne(SysUser::getUserid, Helper.adminId) .notInSql(ViewSysUser::getUserid, sql) ); } //根据角色id查找用户列表 public List<ViewSysUser> selectByRoleid(int roleId){ String sql = String.format("select R_UserID from sys_user_role where R_RoleID =%d ",roleId); return viewMapper.selectList(Wrappers.lambdaQuery(ViewSysUser.class) .inSql(ViewSysUser::getUserid, sql) ); } public List<ViewSysUser> selectAll(){ return viewMapper.selectList(null); } public ViewSysUser selecById(int id) { return viewMapper.selectById(id); } public ViewSysUser selectByUsername(String username) { return viewMapper.selectOne(Wrappers.lambdaQuery(ViewSysUser.class) .eq(ViewSysUser::getuLoginname, username)); } }
import bank.Entity; import bank.Individual; import bank.IndividualEntrepreneur; public class Main { public static void main(String[] args) { Individual individual = new Individual(5000); Entity entity = new Entity(7000); IndividualEntrepreneur individualEntrepreneur = new IndividualEntrepreneur(6000); individual.replenishment(300); individual.withdrawal(500); individual.withdrawal(5500); entity.withdrawal(1000); entity.withdrawal(11000); entity.replenishment(15000); individualEntrepreneur.replenishment(1500); individualEntrepreneur.replenishment(150); individualEntrepreneur.withdrawal(5000); System.out.println(entity.getPaymentAccount()); System.out.println(individualEntrepreneur.getPaymentAccount()); System.out.println(individual.getPaymentAccount()); } }
package com.cms.common.service.impl; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import net.sf.json.JSONArray; import org.apache.commons.lang.StringUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.w3c.dom.Element; import org.w3c.dom.Node; import org.w3c.dom.NodeList; import com.cms.common.cache.GlobalCache; import com.cms.common.cache.impl.UrlExecSqlCache; import com.cms.common.cache.impl.UrlValidationCache; import com.cms.common.exception.CustomException; import com.cms.common.form.PaginForm; import com.cms.common.form.RequestDataForm; import com.cms.common.form.ResponseDataForm; import com.cms.common.listener.SpringContextUtil; import com.cms.common.service.IServiceCallback; import com.cms.common.sqlparse.SqlResultForm; import com.cms.common.utils.Environment; import com.cms.common.utils.MapUtils; import com.cms.common.utils.RegexUtils; import com.cms.common.utils.XmlUtils; import com.google.gson.Gson; /** * ajax通用处理类 * @author zl */ @Service("ajaxService") public class AjaxService extends AbstractService { @Transactional public ResponseDataForm service(RequestDataForm requestDataForm) throws Exception { // 实现如下: ResponseDataForm rdf = new ResponseDataForm(); Map<String, Object> urlSqlMap = requestDataForm.getUrlSqlMap(); //执行验证 String validation = MapUtils.getString(urlSqlMap, "VALIDATION_ID"); if (!"".equals(validation)) { Map<String, Map<String, Element>> validationMap = GlobalCache.getCache(UrlValidationCache.class, Map.class); String[] keys = validation.split("\\."); Map<String, Element> map = validationMap.get(keys[1]); if(map==null || map.isEmpty() || !map.containsKey(keys[2])){ throw new CustomException("validation_id["+validation+"]不存在"); } NodeList sqlNodes = map.get(keys[2]).getChildNodes();//XmlUtils.getNoteListByString(validation); Element element = null; rdf.setResult(ResponseDataForm.SESSFUL); ArrayList<String> msgList=new ArrayList<String>(); for (int i = 0; i < sqlNodes.getLength(); i++) { Node child = sqlNodes.item(i); if (child.getNodeType() != Node.ELEMENT_NODE) continue; element = (Element) child; ResponseDataForm result = validator(element,requestDataForm); if(ResponseDataForm.FAULAIE.equals(result.getResult())) {//服务器验证失败 rdf.setResult(ResponseDataForm.FAULAIE); msgList.add(result.getResultInfo()); } } if(ResponseDataForm.FAULAIE.equals(rdf.getResult())){ rdf.setResultInfo(StringUtils.join(msgList,"\r\n")); return rdf; } } String sqlId=MapUtils.getString(urlSqlMap, "SQL_ID"); Map<String,Map<String,String>> cache = GlobalCache.getCache(UrlExecSqlCache.class,Map.class); String[] keys = sqlId.split("\\."); Map<String, String> map = cache.get(keys[1]); if(map==null || map.isEmpty()){ throw new CustomException("sql_id["+sqlId+"]不存在"); } if(!map.containsKey(keys[2])){ throw new CustomException("sql_id["+sqlId+"]不存在"); } String xml=map.get(keys[2]); Element root = XmlUtils.getElementByString(xml); NodeList sqlNodes = root.getChildNodes(); ArrayList<Object> relist=new ArrayList<Object>(); for (int i = 0; i < sqlNodes.getLength(); i++) { Node child = sqlNodes.item(i); if (child.getNodeType() != Node.ELEMENT_NODE) continue; Element element = (Element) child; Object ajaxObject = null; String operator = element.getAttribute("operator");//select/insert_file/del_file/execute/callback if("select".equalsIgnoreCase(operator)){ ajaxObject=opSelect(element,requestDataForm); relist.add(ajaxObject); }else if("execute".equalsIgnoreCase(operator)){ opExecute(element,requestDataForm); }else if("insert_file".equalsIgnoreCase(operator)){ throw new CustomException("方法未实现"); }else if("del_file".equalsIgnoreCase(operator)){ throw new CustomException("方法未实现"); }else if("callback".equalsIgnoreCase(operator)){ ResponseDataForm responseDataForm = opCallBack(element,requestDataForm); if(ResponseDataForm.SESSFUL.equals(responseDataForm.getResult())){ if(responseDataForm.getResultObj()!=null){ relist.add(responseDataForm.getResultObj()); } }else{ return responseDataForm; } }else{ throw new CustomException("xmlconfig param[\"operator\"="+operator+"] is undefind"); } } rdf.setResult(ResponseDataForm.SESSFUL); rdf.setResultInfo("操作成功"); if(relist.size()>1){ // rdf.setResultObj(new Gson().toJson(relist)); rdf.setResultObj(relist); }else if(relist.size()==1){ // rdf.setResultObj(new Gson().toJson(relist.get(0))); rdf.setResultObj(relist.get(0)); System.out.println(relist.get(0)); // System.out.println(new Gson().toJson(relist.get(0))); } return rdf; } /** * 执行查询语句 * @param element * @param requestDataForm * @return * @throws Exception */ private Object opSelect(Element element,RequestDataForm requestDataForm) throws Exception{ String resultType = element.getAttribute("resultType"); if(StringUtils.isEmpty(resultType)){ resultType="list"; } Object obj = null; if("string".equals(resultType)) { SqlResultForm srf = sqlParse.parseNode(element, requestDataForm, requestDataForm.getUserSession()); obj = jdbcDao.queryForString(srf.getParsedSql(), srf.getValueList().toArray()); } else if("map".equals(resultType)) { SqlResultForm srf = sqlParse.parseNode(element, requestDataForm, requestDataForm.getUserSession()); obj = jdbcDao.queryForMap(srf.getParsedSql(), srf.getValueList().toArray()); } else if("list".equals(resultType)){ SqlResultForm srf = sqlParse.parseNode(element, requestDataForm, requestDataForm.getUserSession()); obj = jdbcDao.queryForList(srf.getParsedSql(), srf.getValueList().toArray()); } else if("autoPaging".equals(resultType)){ SqlResultForm srf = sqlParse.parseNode(element, requestDataForm, requestDataForm.getUserSession()); PaginForm paginForm = new PaginForm(); String parsedSql = "select count(1) from (" + srf.getParsedSql() + ") aa"; int count = Integer.parseInt(jdbcDao.queryForString(parsedSql, srf.getValueList().toArray()));//获取总数 paginForm.setTotalCount(count); int numPerPage = requestDataForm.getInteger(Environment.CTRL_NUMPERPAGE,0) == 0 ? Integer.parseInt(Environment.DEFAULT_NUMPERPAGE) : requestDataForm.getInteger(Environment.CTRL_NUMPERPAGE,0); int pageNum = requestDataForm.getInteger(Environment.CTRL_PAGENUM,0)==0 ? Integer.parseInt(Environment.DEFAULT_PAGENUM) : requestDataForm.getInteger(Environment.CTRL_PAGENUM,0); int startNum = numPerPage*(pageNum-1); int endNum = numPerPage; requestDataForm.put(Environment.CTRL_PAGESTART, String.valueOf(startNum)); requestDataForm.put(Environment.CTRL_PAGEEND, String.valueOf(endNum)); requestDataForm.put(Environment.CTRL_NUMPERPAGE, String.valueOf(numPerPage)); paginForm.setPageNum(pageNum); paginForm.setNumPerPage(numPerPage); paginForm.setStartNum(startNum); paginForm.setPageNumShown(requestDataForm.getInteger(Environment.CTRL_PAGENUMSHOWN,0) == 0 ? Integer.parseInt(Environment.DEFAULT_PAGENUMSHOWN) : requestDataForm.getInteger(Environment.CTRL_PAGENUMSHOWN,0)); parsedSql = srf.getParsedSql() + " limit " + startNum + "," + endNum; List<Map<String, Object>> rsList = jdbcDao.queryForList(parsedSql, srf.getValueList().toArray()); paginForm.setDataList(rsList); obj=paginForm; // obj = rsList; } else if("paging".equals(resultType)){ PaginForm paginForm = new PaginForm(); requestDataForm.put(Environment.CTRL_QUERYCOUNT, "havet");//新增查询总数条件,值为随意 SqlResultForm srfCount = sqlParse.parseNode(element, requestDataForm, requestDataForm.getUserSession()); requestDataForm.remove(Environment.CTRL_QUERYCOUNT);//移除查询总数条件 int count = Integer.parseInt(jdbcDao.queryForString(srfCount.getParsedSql(), srfCount.getValueList().toArray()));//获取总数 paginForm.setTotalCount(count); int numPerPage = requestDataForm.getInteger(Environment.CTRL_NUMPERPAGE,0) == 0 ? Integer.parseInt(Environment.DEFAULT_NUMPERPAGE) : requestDataForm.getInteger(Environment.CTRL_NUMPERPAGE,0); int pageNum = requestDataForm.getInteger(Environment.CTRL_PAGENUM,0)==0 ? Integer.parseInt(Environment.DEFAULT_PAGENUM) : requestDataForm.getInteger(Environment.CTRL_PAGENUM,0); int startNum = numPerPage*(pageNum-1); int endNum = numPerPage; requestDataForm.put(Environment.CTRL_PAGESTART, String.valueOf(startNum)); requestDataForm.put(Environment.CTRL_PAGEEND, String.valueOf(endNum)); requestDataForm.put(Environment.CTRL_NUMPERPAGE, String.valueOf(numPerPage)); paginForm.setPageNum(pageNum); paginForm.setNumPerPage(numPerPage); paginForm.setStartNum(startNum); paginForm.setPageNumShown(requestDataForm.getInteger(Environment.CTRL_PAGENUMSHOWN,0) == 0 ? Integer.parseInt(Environment.DEFAULT_PAGENUMSHOWN) : requestDataForm.getInteger(Environment.CTRL_PAGENUMSHOWN,0)); SqlResultForm srf = sqlParse.parseNode(element, requestDataForm, requestDataForm.getUserSession()); List<Map<String, Object>> rsList = jdbcDao.queryForList(srf.getParsedSql(), srf.getValueList().toArray());//获取数据 paginForm.setDataList(rsList); obj=paginForm; } return obj; } /** * 执行insert、update、delete的sql语句 * @param element * @param requestDataForm * @throws Exception */ private void opExecute(Element element,RequestDataForm requestDataForm) throws Exception{ String iterFields = element.getAttribute("iterfields");// 多个变量用,号隔开,循环迭代标志,页面迭代的参数,多个用,号隔开;可以是页面直接提交多个数值或一个数值配合iterfieldsplit参数进行分解,如果为多个,必须保证页面提交参数的数值个数必须相同 String iterFieldSplit = element.getAttribute("iterfieldsplit");// 可以为空,为空,则按页面提交参数的个数(参考iterfields中的第一个)进行迭代,如果此参数不为空,将iterfield按此参数进行分解并迭代。如iterfields=rights,iterFieldSplit=“,”,页面提交的rights参数值为101,102,迭代的次数为2 int iterSize = 1; String[] iterFieldArr = null; if (!"".equals(iterFields)) { iterFieldArr = iterFields.split(","); if ("".equals(iterFieldSplit)) {// 按照提交的数值个数进行循环 iterSize = requestDataForm.getStringList(iterFieldArr[0]).size(); } else { if(StringUtils.isEmpty(requestDataForm.getString(iterFieldArr[0]))){ iterSize=0; }else iterSize = requestDataForm.getString(iterFieldArr[0]).split(iterFieldSplit).length; } } HashMap<String,String[]> fieldsMap=new HashMap<String,String[]>(); if (iterFieldArr != null) { for (String piterfield : iterFieldArr) { if ("".equals(iterFieldSplit)) { fieldsMap.put(piterfield, requestDataForm.getStringList(piterfield).toArray(new String[]{})); }else{ fieldsMap.put(piterfield,requestDataForm.getString(piterfield).split(iterFieldSplit)); } } } for (int i = 0; i < iterSize; i++) {// 循环的次数 if(!fieldsMap.isEmpty()){ for(Map.Entry<String, String[]> entry:fieldsMap.entrySet()){ requestDataForm.put(entry.getKey(), entry.getValue()[i]); } } SqlResultForm srf = sqlParse.parseNode(element, requestDataForm, requestDataForm.getUserSession()); jdbcDao.execute(srf.getParsedSql(), srf.getValueList().toArray()); } } /** * 执行回调节点 * @param element * @param requestDataForm * @return * @throws Exception */ private ResponseDataForm opCallBack(Element element,RequestDataForm requestDataForm) throws Exception{ ResponseDataForm rdf=new ResponseDataForm(); String clazz = element.getAttribute("class");//可选,用于opertor为callbak回调适用的类 try{ rdf = SpringContextUtil.getBean(clazz,IServiceCallback.class).serviceCallback(requestDataForm); }catch(Exception e){ e.printStackTrace(); rdf.setResult(ResponseDataForm.FAULAIE); rdf.setResultInfo("操作出错,"+e.getMessage()); } // Class<?> cls = Class.forName(clazz); // Object newInstance = cls.newInstance(); // if(newInstance instanceof IServiceCallback){ // IServiceCallback sc=(IServiceCallback) newInstance; // rdf = ((IServiceCallback) newInstance).serviceCallback(requestDataForm); // Method method = cls.getMethod("serviceCallback", new Class[] { RequestDataForm.class, ResponseDataForm.class }); // method.invoke(newInstance,new Object[] { requestDataForm, rdf}); // }else{ // throw new CustomException(clazz + "未实现 IServiceCallback 接口!"); // } return rdf; } private ResponseDataForm validator(Element data, RequestDataForm requestDataForm) throws Exception{ ResponseDataForm rdf=new ResponseDataForm(); String field = data.getAttribute("field");// 验证的参数名称 String method = "".equals("method") ? "reg" : data.getAttribute("method");// 验证方法,reg/database为空时候为reg String msg = data.getAttribute("msg");// 提示信息 boolean required = "".equals("required") ? true : Boolean.parseBoolean(data.getAttribute("required"));// true/false是否必填,为空时候为true String reg = data.getAttribute("reg");// 正则表达式,可以为空, int maxlength = (data.getAttribute("maxlength") == null || "".equals( data.getAttribute("maxlength"))) ? -1 : Integer.parseInt(data.getAttribute("maxlength"));// 最大长度,数字,可以为空 int minlength = (data.getAttribute("minlength") == null || "".equals( data.getAttribute("minlength")))? -1 : Integer.parseInt(data.getAttribute("minlength"));// 最小长度,数字,可以为空 String orisql = data.getAttribute("sql");// 验证方式为database,判断的sql if (method.equals("database")) { SqlResultForm srf = sqlParse.parseString(orisql, requestDataForm,requestDataForm.getUserSession()); String result = jdbcDao.queryForString(srf.getParsedSql(), srf.getValueList().toArray()); if(!"0".equals(result)){ rdf.setResult(ResponseDataForm.FAULAIE); rdf.setResultInfo(msg); return rdf; } } else if (method.equals("reg")) { if(requestDataForm.getString(field,null)==null) { throw new CustomException("\t\r\n需要验证的参数:[" + field + "]不存在,请确定表单有存在该参数!"); } String value = requestDataForm.getString(field); if ("".equals(value) && !required){ rdf.setResult(ResponseDataForm.FAULAIE); msg=StringUtils.isEmpty(msg)?("["+field+"]参数不能为空"):msg; rdf.setResultInfo(msg); return rdf; } if(!RegexUtils.match(reg, value)){ rdf.setResult(ResponseDataForm.FAULAIE); msg=StringUtils.isEmpty(msg)?("["+field+"]的内容格式不正确"):msg; rdf.setResultInfo(msg); return rdf; } if (minlength > 0 && value.length() < minlength) { rdf.setResult(ResponseDataForm.FAULAIE); msg=StringUtils.isEmpty(msg)?("["+field+"]的内容长度不能小于"+minlength):msg; rdf.setResultInfo(msg); return rdf; } if (maxlength > 0 && value.length() > maxlength) { rdf.setResult(ResponseDataForm.FAULAIE); msg=StringUtils.isEmpty(msg)?("["+field+"]的内容长度不能大于"+maxlength):msg; rdf.setResultInfo(msg); return rdf; } } else { throw new CustomException("\t\r\n验证方法:" + method + "不存在,数据库验证请使用:database,正则表达式验证请使用:reg!"); } rdf.setResult(ResponseDataForm.SESSFUL); return rdf; } }
package com.example.mrt.testviewpager.Adapter; import android.app.Activity; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.TextView; import com.example.mrt.testviewpager.Model.LocationModel; import com.example.mrt.testviewpager.R; import java.util.ArrayList; /** * Created by Mr.T on 15/12/2017. */ public class DistrictAdapter extends RecyclerView.Adapter<DistrictAdapter.ViewHolder> { Activity activity; ArrayList<LocationModel> listLocation; public DistrictAdapter(Activity activity, ArrayList<LocationModel> listLocation) { this.activity = activity; this.listLocation = listLocation; } @Override public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_merchant_district, parent, false); return new DistrictAdapter.ViewHolder(v); } @Override public void onBindViewHolder(ViewHolder holder, int position) { final LocationModel model = listLocation.get(position); holder.txtDistrict.setText(model.getName()); holder.txtDistrict.setTag(position); } @Override public int getItemCount() { return listLocation.size(); } public class ViewHolder extends RecyclerView.ViewHolder { private LinearLayout llDistrict; private ImageView imgDistrict; private TextView txtDistrict; public ViewHolder(View itemView) { super(itemView); llDistrict = itemView.findViewById(R.id.ll_district); imgDistrict = itemView.findViewById(R.id.img_district); txtDistrict = itemView.findViewById(R.id.txt_district); } } }
package be.axxes.bookrental.dao; import be.axxes.bookrental.domain.Author; import be.axxes.bookrental.domain.Book; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.rest.core.annotation.RepositoryRestResource; import java.util.List; @RepositoryRestResource public interface BookRepository extends JpaRepository<Book, String> { List<Book> findByBookdescription_Id(String descriptionId); }
package common.java.utils; public class ConstantTest { static final int CONSTANT_VALUE = 10; public static void main(String args[]) { System.out.println("CONSTANT_VALUE : " + CONSTANT_VALUE); // CONSTANT_VALUE=70; } }
package pages; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import com.aventstack.extentreports.ExtentTest; import com.aventstack.extentreports.Status; public class ProjectCreation extends Base { public ProjectCreation(WebDriver driver) { super(driver); } static ExtentTest currentTest; public void setExtentTest(ExtentTest test) { currentTest = test; } By newProjectWindowLocator = By.xpath("//h1[contains(text(),'New Project')]"); By usernameLocator = By.id("mat-input-0"); By passLocator = By.id("mat-input-1"); By loginLocator = By.xpath("//button[@class='mat-raised-button']"); By newProjectLocator = By.cssSelector("a[ng-reflect-message=\"Create a new project!\"]"); By nameLocator = By.xpath( "//body[1]/div[2]/div[2]/div[1]/mat-dialog-container[1]/app-newproject[1]/div[1]/form[1]/div[1]/div[1]/div[2]/mat-form-field[1]/div[1]/div[1]/div[1]/input[1]"); By descriptionLocator = By.id("mat-input-3"); By roleSelectLocator; By memberUsernameLocator = By.xpath( "/html[1]/body[1]/div[2]/div[2]/div[1]/mat-dialog-container[1]/app-newproject[1]/div[1]/form[1]/div[1]/div[1]/div[2]/mat-form-field[4]/div[1]/div[1]/div[1]/div[1]/input[1]"); By addMemberLocator = By.xpath("//span[contains(text(),'Add')]"); // TODO improve start date xpath By startDateButtonLocator = By.xpath( "//*[@id=\"fulldialog\"]/form/div[1]/div/div[2]/div/div[1]/mat-form-field/div/div[1]/div[2]/mat-datepicker-toggle/button"); By startDate; By endDateCheck = By.cssSelector("label[for=\"endbutt-input\"]"); // TODO improve end date xpath By endDateButton = By.xpath("//*[@id=\"picker2\"]/div/div[1]/div[2]/mat-datepicker-toggle/button"); By endDate; By createButtonLocator = By.id("createbutt"); By noNameError = By.id("mat-error-3"); By missingFieldLocator = By.xpath("//mat-error[@class='mat-error ng-star-inserted']"); By startDateInputLocator = By.xpath("//input[@name='inDate1']"); By endDateInputLocator = By.xpath("//input[@name='inDate2']"); By memberNameListLocator = By.xpath("//mat-panel-title[@class='mat-expansion-panel-header-title']"); By memberListLocator = By.xpath("//mat-expansion-panel-header"); public void fillLogin(String username, String password) { type(username, usernameLocator); if (getValue(usernameLocator).equals(username)) currentTest.log(Status.PASS, "Username introducido correctamente"); else currentTest.log(Status.FAIL, "Username no introducido"); type(password, passLocator); if (getValue(passLocator).equals(password)) currentTest.log(Status.PASS, "Password introducido correctamente"); else currentTest.log(Status.FAIL, "Password no introducido"); submit(loginLocator); currentTest.log(Status.PASS, "Botón de login presionado"); } public void nonUserTest(String name, String description, String SDate, String role, String member) { click(newProjectLocator); if (isDisplayed(newProjectWindowLocator)) currentTest.log(Status.PASS, "La ventana de New Project abrió"); else currentTest.log(Status.FAIL, "La ventana de New Project no se abrió"); type(name, nameLocator); if (getValue(nameLocator).equals(name)) currentTest.log(Status.PASS, "Nombre introducido correctamente"); else currentTest.log(Status.FAIL, "Nombre no introducido"); type(description, descriptionLocator); if (getValue(descriptionLocator).equals(description)) currentTest.log(Status.PASS, "Descripción introducida correctamente"); else currentTest.log(Status.FAIL, "Descripción no introducida"); roleSelectLocator = By.xpath("//option[@value='" + role + "']"); click(roleSelectLocator); type(member, memberUsernameLocator); if (getValue(memberUsernameLocator).equals(member)) currentTest.log(Status.PASS, "Nombre del miembro introducido correctamente"); else currentTest.log(Status.FAIL, "Nombre del miembro no introducido"); click(addMemberLocator); currentTest.log(Status.PASS, "Botón de añadir miembro presionado"); } public void memberUserTest(String name, String description, String SDate, String role, String member) { click(newProjectLocator); if (isDisplayed(newProjectWindowLocator)) currentTest.log(Status.PASS, "La ventana de New Project abrió"); else currentTest.log(Status.FAIL, "La ventana de New Project no se abrió"); type(name, nameLocator); if (getValue(nameLocator).equals(name)) currentTest.log(Status.PASS, "Nombre introducido correctamente"); else currentTest.log(Status.FAIL, "Nombre no introducido"); type(description, descriptionLocator); if (getValue(descriptionLocator).equals(description)) currentTest.log(Status.PASS, "Descripción introducida correctamente"); else currentTest.log(Status.FAIL, "Descripción no introducida"); roleSelectLocator = By.xpath("//option[@value='" + role + "']"); click(roleSelectLocator); type(member, memberUsernameLocator); if (getValue(memberUsernameLocator).equals(member)) currentTest.log(Status.PASS, "Nombre del miembro introducido correctamente"); else currentTest.log(Status.FAIL, "Nombre del miembro no introducido"); click(addMemberLocator); currentTest.log(Status.PASS, "Botón de añadir miembro presionado"); scrollElement(memberListLocator); click(memberListLocator); } public void newProjectDateTest(String name, String description, String sDate) { click(newProjectLocator); if (isDisplayed(newProjectWindowLocator)) currentTest.log(Status.PASS, "La ventana de New Project abrió"); else currentTest.log(Status.FAIL, "La ventana de New Project no se abrió"); type(name, nameLocator); if (getValue(nameLocator).equals(name)) currentTest.log(Status.PASS, "Nombre introducido correctamente"); else currentTest.log(Status.FAIL, "Nombre no introducido"); type(description, descriptionLocator); if (getValue(descriptionLocator).equals(description)) currentTest.log(Status.PASS, "Descripción introducida correctamente"); else currentTest.log(Status.FAIL, "Descripción no introducida"); if (!sDate.isEmpty()) { scrollElement(startDateButtonLocator); click(startDateButtonLocator); startDate = By.cssSelector("td[aria-label=\"" + sDate + "\"]"); click(startDate); currentTest.log(Status.PASS, "Fecha de inicio seleccionada"); } submit(createButtonLocator); currentTest.log(Status.PASS, "Botón de crear proyecto presionado"); } public void newProjectDateFormatTest(String name, String description, String sDate) { click(newProjectLocator); if (isDisplayed(newProjectWindowLocator)) currentTest.log(Status.PASS, "La ventana de New Project abrió"); else currentTest.log(Status.FAIL, "La ventana de New Project no se abrió"); type(name, nameLocator); if (getValue(nameLocator).equals(name)) currentTest.log(Status.PASS, "Nombre introducido correctamente"); else currentTest.log(Status.FAIL, "Nombre no introducido"); type(description, descriptionLocator); if (getValue(descriptionLocator).equals(description)) currentTest.log(Status.PASS, "Descripción introducida correctamente"); else currentTest.log(Status.FAIL, "Descripción no introducida"); if (!sDate.isEmpty()) { scrollElement(startDateButtonLocator); click(startDateButtonLocator); startDate = By.cssSelector("td[aria-label=\"" + sDate + "\"]"); click(startDate); currentTest.log(Status.PASS, "Fecha de inicio seleccionada"); } } public void newProject(String name, String description, String sDate, String eDate) { click(newProjectLocator); if (isDisplayed(newProjectWindowLocator)) currentTest.log(Status.PASS, "La ventana de New Project abrió"); else currentTest.log(Status.FAIL, "La ventana de New Project no se abrió"); type(name, nameLocator); if (getValue(nameLocator).equals(name)) currentTest.log(Status.PASS, "Nombre introducido correctamente"); else currentTest.log(Status.FAIL, "Nombre no introducido"); type(description, descriptionLocator); if (getValue(descriptionLocator).equals(description)) currentTest.log(Status.PASS, "Descripción introducida correctamente"); else currentTest.log(Status.FAIL, "Descripción no introducida"); scrollElement(startDateButtonLocator); click(startDateButtonLocator); startDate = By.cssSelector("td[aria-label=\"" + sDate + "\"]"); endDate = By.xpath( "//*[@id=\"mat-datepicker-1\"]/div/mat-month-view/table/tbody/tr/td[@aria-label='" + eDate + "']"); click(startDate); currentTest.log(Status.PASS, "Fecha de inicio seleccionada"); click(endDateCheck); currentTest.log(Status.PASS, "Checkbox de fecha de final marcado"); click(endDateButton); click(endDate); currentTest.log(Status.PASS, "Fecha de final seleccionada"); submit(createButtonLocator); currentTest.log(Status.PASS, "Botón de crear proyecto presionado"); } public void fillNewProject(String name, String description, String sDate, String eDate) { click(newProjectLocator); if (isDisplayed(newProjectWindowLocator)) currentTest.log(Status.PASS, "La ventana de New Project abrió"); else currentTest.log(Status.FAIL, "La ventana de New Project no se abrió"); type(name, nameLocator); if (getValue(nameLocator).equals(name)) currentTest.log(Status.PASS, "Nombre introducido correctamente"); else currentTest.log(Status.FAIL, "Nombre no introducido"); type(description, descriptionLocator); if (getValue(descriptionLocator).equals(description)) currentTest.log(Status.PASS, "Descripción introducida correctamente"); else currentTest.log(Status.FAIL, "Descripción no introducida"); scrollElement(startDateButtonLocator); click(startDateButtonLocator); startDate = By.cssSelector("td[aria-label=\"" + sDate + "\"]"); endDate = By.xpath( "//*[@id=\"mat-datepicker-1\"]/div/mat-month-view/table/tbody/tr/td[@aria-label='" + eDate + "']"); click(startDate); currentTest.log(Status.PASS, "Fecha de inicio seleccionada"); click(endDateCheck); currentTest.log(Status.PASS, "Checkbox de fecha de final marcado"); click(endDateButton); click(endDate); currentTest.log(Status.PASS, "Fecha de final seleccionada"); } public boolean isNameErrorDisplayed() { return isDisplayed(noNameError); } public String onProjectCreated() { try { waitAlert(); } catch (Exception e) { return "No message shown"; } return getMessage(); } public String memberValidation() { try { Thread.sleep(1000); return getText(memberNameListLocator); } catch (Exception e) { return ""; } } public String noStartDateValidation() { scrollElement(missingFieldLocator); try { return getText(missingFieldLocator); } catch (Exception e) { return "Line 273"; } } public String noDescriptionValidation() { scrollElement(missingFieldLocator); try { return getText(missingFieldLocator); } catch (Exception e) { return "Line 282"; } } public String descriptionValidation() { try { waitAlert(); return getMessage(); } catch (Exception e) { return ""; } } public String startDateValidation() { try { waitAlert(); return getMessage(); } catch (Exception e) { return ""; } } public String startDateFormatValidation() { return getValue(startDateInputLocator); } public String endDateFormatValidation() { return getValue(endDateInputLocator); } }
/* * LumaQQ - Java QQ Client * * Copyright (C) 2004 luma <stubma@163.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ package edu.tsinghua.lumaqq.ui.debug; import java.util.ArrayList; import java.util.List; import org.eclipse.jface.dialogs.Dialog; import org.eclipse.jface.dialogs.IDialogConstants; import org.eclipse.jface.viewers.ISelectionChangedListener; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.viewers.LabelProvider; import org.eclipse.jface.viewers.ListViewer; import org.eclipse.jface.viewers.SelectionChangedEvent; import org.eclipse.jface.viewers.Viewer; import org.eclipse.jface.viewers.ViewerFilter; import org.eclipse.swt.SWT; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Shell; import edu.tsinghua.lumaqq.qq.QQ; import edu.tsinghua.lumaqq.qq.QQClient; import edu.tsinghua.lumaqq.qq.Util; import edu.tsinghua.lumaqq.qq.net.IConnection; import edu.tsinghua.lumaqq.ui.provider.ListContentProvider; /** * 端口选择对话框 * * @author luma */ public class PortDialog extends Dialog { private QQClient client; private ListViewer connList; private List<Integer> family; private int supportedFamily; private ListViewer protocolList; private int selectedFamily; private String connectionId; private static final int CREATE_ID = 9999; protected PortDialog(Shell parentShell, QQClient client) { super(parentShell); this.client = client; family = new ArrayList<Integer>(); family.add(QQ.QQ_PROTOCOL_FAMILY_03); family.add(QQ.QQ_PROTOCOL_FAMILY_05); family.add(QQ.QQ_PROTOCOL_FAMILY_BASIC); supportedFamily = 0; selectedFamily = 0; } @Override protected void configureShell(Shell newShell) { super.configureShell(newShell); newShell.setText("Port Selection"); } @Override protected Control createDialogArea(Composite parent) { Composite control = (Composite)super.createDialogArea(parent); Composite container = new Composite(control, SWT.NONE); GridLayout layout = new GridLayout(); layout.marginHeight = layout.marginWidth = 0; container.setLayout(layout); container.setLayoutData(new GridData(GridData.FILL_BOTH)); // port list Label lblTemp = new Label(container, SWT.LEFT); lblTemp.setText("Existing Port List"); connList = new ListViewer(container, SWT.SINGLE | SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL); connList.getList().setLayoutData(new GridData(GridData.FILL_BOTH)); ListContentProvider<IConnection> provider = new ListContentProvider<IConnection>(new ArrayList<IConnection>()); if(client.getConnectionPool() != null) provider.setSource(client.getConnectionPool().getConnections()); connList.setContentProvider(provider); connList.setLabelProvider(new LabelProvider() { @Override public String getText(Object element) { return ((IConnection)element).getId(); } }); connList.addSelectionChangedListener(new ISelectionChangedListener() { public void selectionChanged(SelectionChangedEvent event) { IStructuredSelection s = (IStructuredSelection)event.getSelection(); if(s.isEmpty()) { supportedFamily = 0; connectionId = null; } else { IConnection port = (IConnection)s.getFirstElement(); supportedFamily = port.getPolicy().getSupportedFamily(); connectionId = port.getId(); } protocolList.refresh(); } }); // supported protocol lblTemp = new Label(container, SWT.LEFT); lblTemp.setText("Available Protocol Family"); protocolList = new ListViewer(container, SWT.SINGLE | SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL); protocolList.getList().setLayoutData(new GridData(GridData.FILL_BOTH)); protocolList.setContentProvider(new ListContentProvider<Integer>(family)); protocolList.setLabelProvider(new LabelProvider() { @Override public String getText(Object element) { return Util.getProtocolString((Integer)element); } }); protocolList.addFilter(new ViewerFilter() { @Override public boolean select(Viewer viewer, Object parentElement, Object element) { return (supportedFamily & (Integer)element) != 0; } }); protocolList.addSelectionChangedListener(new ISelectionChangedListener() { public void selectionChanged(SelectionChangedEvent event) { IStructuredSelection s = (IStructuredSelection)event.getSelection(); Integer i = (Integer)s.getFirstElement(); if(i == null) selectedFamily = 0; else selectedFamily = i; } }); initializeViewers(); return control; } @Override protected void createButtonsForButtonBar(Composite parent) { createButton(parent, CREATE_ID, "Create New Port", false); super.createButtonsForButtonBar(parent); } @Override protected void buttonPressed(int buttonId) { if(buttonId == CREATE_ID) createPressed(); else super.buttonPressed(buttonId); } private void createPressed() { CreatePortDialog dialog = new CreatePortDialog(getShell(), client); if(dialog.open() == IDialogConstants.OK_ID) { ListContentProvider<IConnection> provider = (ListContentProvider<IConnection>)connList.getContentProvider(); provider.setSource(client.getConnectionPool().getConnections()); connList.refresh(); } } private void initializeViewers() { connList.setInput(this); protocolList.setInput(this); } /** * @return the portName */ public String getConnectionId() { return connectionId; } /** * @return the selectedFamily */ public int getSelectedFamily() { return selectedFamily; } }
package lesson6; import java.util.*; import java.util.function.Function; import java.util.stream.Collectors; public class Main { public static void main(String[] args) { Book book1 = new Book("Power Of Positive Thinking", 400, "USA"); Book book2 = new Book("Man’s Search for Meaning", 300, "Germany"); Book book3 = new Book("The Way of the Superior Man", 550, "USA"); Book book4 = new Book("Rich Dad, Poor Dad", 200, "USA"); Book book5 = new Book("Way Of The Peaceful Warrior", 420, "USA"); List<Book> books = Arrays.asList(book1, book2, book3, book4, book5); List<Book> stream = books.stream() .filter(book -> book.getPageCount() < 400) .filter(book -> book.getCountry().equals("Germany")) .collect(Collectors.toList()); for (Book book : stream) { System.out.println("Stream: " + book); } List<String> stringStream = books.stream().map(Book::getTitle).collect(Collectors.toList()); stringStream.forEach((string) -> System.out.println("Collected Titles: " + string)); Set<String> collect = books.stream().map(Book::getCountry).collect(Collectors.toSet()); collect.forEach((string) -> System.out.println("Collected Countries: " + string)); Book.showBooksWithPagesMore400(books); books.forEach(System.out::println); Person person1 = new Person("Vadim", "Huk", 26, Arrays.asList(book3, book1, book5)); Person person2 = new Person("Maya", "Lubovska", 22, Arrays.asList(book4, book1, book5)); Person person3 = new Person("Dimon", "Sun", 36, Arrays.asList(book3, book1, book2)); Person person4 = new Person("Marko", "Aggres", 28, Arrays.asList(book3, book4, book5)); Person person5 = new Person("Koko", "Shkrapi", 15, Arrays.asList(book3, book1, book5, book2)); List<Person> persons = Arrays.asList(person1, person2, person3, person4, person5); // Task 1 Map<Person, Integer> task1 = persons.stream().collect(Collectors.toMap( Function.identity(), person -> (Integer) person.getBook() .stream() .map(Book::getPageCount).mapToInt(Integer::intValue).sum() )); task1.forEach((person, integer) -> System.out.println("Task1: " + person + " Integer " + integer)); // Task 2 Map<String, Integer> task2 = persons.stream() .collect(Collectors.toMap( Person::getName, person -> person.getBook() .stream().map(Book::getPageCount) .collect(Collectors.summarizingInt(Integer::intValue)).getMax() // // second way // .mapToInt(v -> v) // .max() // // third way // .map(Comparator.comparing(Book::getPageCount)) // .mapToInt(Integer::valueOf).sum() // .max(Integer::compare) )); System.out.println("Task2: " + task2); // Task3 List<Book> task3 = persons.stream() .filter(person -> person.getAge() > 25) .map(Person::getBook).flatMap(Collection::stream) .filter(book -> book.getPageCount() > 500).collect(Collectors.toList()); System.out.println("Task3: " + task3); // Task4 Map<Person, List<Book>> task4 = persons.stream() .filter(person -> person.getName().startsWith("M")) .collect(Collectors.toMap( Function.identity(), person -> person.getBook().stream() .filter(book -> book.getTitle().contains("Rich")) .collect(Collectors.toList()) )); task4.forEach((person, book) -> System.out.println("Task4: " + person + "\n" + "Task4: " + book)); } } // В плані домашнього: щоб не вигадувати всяке різне, // просто візьміть приклад з лекції і пройдіться по ВСІХ операціях стріма, бажано по декілька разів. // Придумайте щось з ускладнених завдань, працюючи з List<Person>, кожен з об'єктів якого має List<Book>, наприклад: // 1. згенерувати мапу <Person, Integer>, де Integer - кількість сторінок усіх книжок, які має людина // 2. згенерувати мапу <String, Book>, де String - ім'я людини, Book - книжка з найбільшою кількістю сторінок // 3. згенерувати List<Book> відфільтрувавши тільких тих людей, хто старше 25 років і // книжки які мають більше 500 сторінок // 4. згенерувати мапу <Person, Book> де Person - це ім'я людина, буква яка починається на М, // а Book, це книжка яка містить слово "Rich" // Чим більше таких завдань придумаєте, тим більше плюсиків вам у карму.
package modele; /** * Classe comportant le modèle de données de la classe Emplye * doit étendre la classe abstraite AbstractTableModel */ import java.util.ArrayList; import javax.swing.table.AbstractTableModel; public class ModeleArtiste extends AbstractTableModel { private static final long serialVersionUID = 1L; private ArrayList<Artiste> lesDonnees; private final String[] lesTitres = { "Numéro", "Nom", "Membre" }; public ModeleArtiste( ArrayList<Artiste> lesDonnees ) { this.lesDonnees = lesDonnees; } @Override public int getRowCount() { return lesDonnees.size(); } @Override public int getColumnCount() { return lesTitres.length; } @Override public Object getValueAt( int rowIndex, int columnIndex ) { switch ( columnIndex ) { case 0: return lesDonnees.get( rowIndex ).getNumero(); case 1: return lesDonnees.get( rowIndex ).getNom(); case 2: return lesDonnees.get( rowIndex ).estMembre(); case 3: return lesDonnees.get( rowIndex ).getPhoto(); case 4: return lesDonnees.get( rowIndex ).getDescription(); default: return null; } } @Override public String getColumnName( int columnIndex ) { return lesTitres[columnIndex]; } @Override public Class<?> getColumnClass( int columnIndex ) { switch ( columnIndex ) { case 0: return String.class; case 1: return String.class; case 2: return Boolean.class; case 3: return String.class; case 4: return String.class; default: throw new IllegalArgumentException( " index de colonne invalide: " + columnIndex ); } } public void ajouterArtiste( Artiste artiste ) { lesDonnees.add( artiste ); fireTableRowsInserted( lesDonnees.size() - 1, lesDonnees.size() - 1 ); } public void supprimerArtiste( int rowIndex ) { lesDonnees.remove( rowIndex ); fireTableRowsDeleted( rowIndex, rowIndex ); } public void modifierArtiste( int firstRow, Artiste artiste ) { lesDonnees.set( firstRow, artiste ); fireTableRowsUpdated( firstRow, firstRow ); } public void setDonnees( ArrayList<Artiste> nouvellesDonnees ) { lesDonnees = nouvellesDonnees; fireTableDataChanged(); } public Artiste getElement( int row ) { return lesDonnees.get( row ); } public int getLigne( int numArtiste ) { int ligne; for ( ligne = 0; ligne < lesDonnees.size(); ligne++ ) { if ( numArtiste == lesDonnees.get( ligne ).getNumero() ) { break; } } return ligne; } }
package project2; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.io.Serializable; public class ObjectSerialization { public static void main(String[] args) throws Exception { B obj=new B(); obj.i=7; obj.j="Jayant"; File f=new File("D:\\Programming\\JAVA\\Java Created Files\\Object.txt"); FileOutputStream fos=new FileOutputStream(f); ObjectOutputStream oos=new ObjectOutputStream(fos); oos.writeObject(obj); FileInputStream fis= new FileInputStream(f); ObjectInputStream ois=new ObjectInputStream(fis); B obj1=(B)ois.readObject(); System.out.println(obj1); } } class B implements Serializable { int i; String j; public String toString() { return "B{" + "i=" + i + ", j=" + j + '}'; } }
package org.kpu.ticketbox.payment; public class Receipt { String client; // 사용자 이름 + 결제 정보 String productName; // 영화 상품 이름 String payMethod; // 결제 수단 double subTotalAmount; // 커미션 제외한 금액 double totalAmount; // 커미션 포함한 금액 public double getTotalAmount() { return totalAmount; } public String getClient() { return client; } public String getProductName() { return productName; } public String getPayMethod() { return payMethod; } public double getSubTotalAmount() { return subTotalAmount; } @Override // 무슨 뜻일까요? public String toString() { return "client= " + client + ", productName=" + productName + ", payMethod=" + payMethod + ", subTotalAmount=" + subTotalAmount + ", totalAmount=" + totalAmount; } }
package com.SkyBlue.hr.circumstance.to; import com.SkyBlue.common.annotation.Dataset; import com.SkyBlue.common.to.BaseBean; import lombok.Getter; import lombok.Setter; @Dataset(name="dsHoliday") public class HolidayBean extends BaseBean{ @Setter @Getter private String basicDay,holidayName,note,holidayType; }
package net.sssanma.mc.utility; import com.sk89q.worldedit.bukkit.selections.Selection; import net.sssanma.mc.ECore; import net.sssanma.mc.utility.Utility.Is; import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.World; import org.bukkit.block.Block; import org.bukkit.configuration.ConfigurationSection; import org.json.simple.JSONObject; public final class BlockArea { private final World world; private final int width; private final int height; private final int depth; private final int sx; private final int ex; private final int sy; private final int ey; private final int sz; private final int ez; private final double length; public BlockArea(BlockPoint startPoint, BlockPoint endPoint) { Is.ParamNull(startPoint, "startPoint"); Is.ParamNull(endPoint, "endPoint"); Is.Null(startPoint.getWorld(), "startPointに設定されているワールドがnullです!"); Is.Null(endPoint.getWorld(), "endPointに設定されているワールドがnullです!"); Is.NotEquals(startPoint.getWorld(), endPoint.getWorld(), "startPointとendPointに設定されているワールドが異なります!"); this.world = startPoint.getWorld(); this.sx = startPoint.getX(); this.ex = endPoint.getX(); this.sy = startPoint.getY(); this.ey = endPoint.getY(); this.sz = startPoint.getZ(); this.ez = endPoint.getZ(); this.width = diff(sx, ex); this.height = diff(sy, ey); this.depth = diff(sz, ez); this.length = Math.pow(width ^ 2 + height ^ 2 + depth ^ 2, 0.5); } public BlockArea(Selection selection) { Is.ParamNull(selection, "selection"); Is.Null(selection.getWorld(), "selectionに設定されているワールドがnullです!"); this.world = selection.getWorld(); Location startLoc = selection.getMinimumPoint(); Location endLoc = selection.getMaximumPoint(); this.sx = startLoc.getBlockX(); this.ex = endLoc.getBlockX(); this.sy = startLoc.getBlockY(); this.ey = endLoc.getBlockY(); this.sz = startLoc.getBlockZ(); this.ez = endLoc.getBlockZ(); this.width = diff(sx, ex); this.height = diff(sy, ey); this.depth = diff(sz, ez); this.length = Math.pow(width ^ 2 + height ^ 2 + depth ^ 2, 0.5); } public BlockArea(Location startLoc, Location endLoc) { Is.ParamNull(startLoc, "startLoc"); Is.ParamNull(endLoc, "endLoc"); Is.Null(startLoc.getWorld(), "startLocに設定されているワールドがnullです!"); Is.Null(endLoc.getWorld(), "endLocに設定されているワールドがnullです!"); Is.NotEquals(startLoc.getWorld(), endLoc.getWorld(), "startLocとendLocに設定されているワールドが異なります!"); this.world = startLoc.getWorld(); this.sx = startLoc.getBlockX(); this.ex = endLoc.getBlockX(); this.sy = startLoc.getBlockY(); this.ey = endLoc.getBlockY(); this.sz = startLoc.getBlockZ(); this.ez = endLoc.getBlockZ(); this.width = diff(sx, ex); this.height = diff(sy, ey); this.depth = diff(sz, ez); this.length = Math.pow(width ^ 2 + height ^ 2 + depth ^ 2, 0.5); } public BlockArea(World world, int startX, int endX, int startY, int endY, int startZ, int endZ) { Is.ParamNull(world, "world"); this.world = world; this.sx = startX; this.ex = endX; this.sy = startY; this.ey = endY; this.sz = startZ; this.ez = endZ; this.width = diff(sx, ex); this.height = diff(sy, ey); this.depth = diff(sz, ez); this.length = Math.pow(width ^ 2 + height ^ 2 + depth ^ 2, 0.5); } public static BlockArea getBlockAreaFromYamlConfig(ConfigurationSection section) { Is.ParamNull(section, "section"); String worldName = section.getString("world"); if (worldName == null) return null; World world = Bukkit.getWorld(worldName); if (world == null) return null; int minX = section.getInt("minX"); int maxX = section.getInt("maxX"); int minY = section.getInt("minY"); int maxY = section.getInt("maxY"); int minZ = section.getInt("minZ"); int maxZ = section.getInt("maxZ"); BlockPoint startPoint = new BlockPoint(world, minX, minY, minZ); BlockPoint endPoint = new BlockPoint(world, maxX, maxY, maxZ); // BlockArea を作成して返す return new BlockArea(startPoint, endPoint); } public static void setBlockAreaToYamlConfig(ConfigurationSection section, Selection sel) { Is.ParamNull(section, "section"); Is.ParamNull(sel, "sel"); section.set("world", sel.getWorld().getName()); Location min = sel.getMinimumPoint(); Location max = sel.getMaximumPoint(); section.set("minX", min.getBlockX()); section.set("maxX", max.getBlockX()); section.set("minY", min.getBlockY()); section.set("maxY", max.getBlockY()); section.set("minZ", min.getBlockZ()); section.set("maxZ", max.getBlockZ()); } public static void setBlockAreaToYamlConfig(ConfigurationSection section, BlockArea area) { Is.ParamNull(section, "section"); Is.ParamNull(area, "area"); section.set("world", area.getWorld().getName()); section.set("minX", area.getStartX()); section.set("maxX", area.getEndX()); section.set("minY", area.getStartY()); section.set("maxY", area.getEndY()); section.set("minZ", area.getStartZ()); section.set("maxZ", area.getEndZ()); } public static BlockArea load(JSONObject jsonObject) throws WorldNotFoundException { Is.ParamNull(jsonObject, "jsonObject"); String worldName = (String) jsonObject.get("world"); Is.Null(worldName, "設定されているワールド名がnullです!"); World world = Bukkit.getWorld(worldName); if (world == null) throw new WorldNotFoundException("ワールド" + worldName + "は見つかりませんでした!"); int sx = Utility.getIntFromJSONObject(jsonObject, "startX"); int ex = Utility.getIntFromJSONObject(jsonObject, "endX"); int sy = Utility.getIntFromJSONObject(jsonObject, "startY"); int ey = Utility.getIntFromJSONObject(jsonObject, "endY"); int sz = Utility.getIntFromJSONObject(jsonObject, "startZ"); int ez = Utility.getIntFromJSONObject(jsonObject, "endZ"); return new BlockArea(world, sx, ex, sy, ey, sz, ez); } private int diff(int a, int b) { return Math.abs(a < b ? b - a : a - b); } public World getWorld() { return world; } public int getHeight() { return height; } public int getDepth() { return depth; } public int getWidth() { return width; } public double getLength() { return length; } public int getStartX() { return sx; } public int getEndX() { return ex; } public int getStartY() { return sy; } public int getEndY() { return ey; } public int getStartZ() { return sz; } public int getEndZ() { return ez; } public BlockPoint getStartBlockPoint() { return new BlockPoint(this.world, sx, sy, sz); } public BlockPoint getEndBlockPoint() { return new BlockPoint(this.world, ex, ey, ez); } public Location getStartLocation() { return new Location(this.world, sx, sy, sz); } public Location getEndLocation() { return new Location(this.world, ex, ey, ez); } public Location getCenterLocation3D() { return new Location(this.world, (sx + ex) / 2f + .5f, (sy + ey) / 2f, (sz + ez) / 2f + .5f); } public Location getCenterLocation2D() { return new Location(this.world, (sx + ex) / 2f + .5f, Math.min(sy, ey), (sz + ez) / 2f + .5f); } public boolean isIn(Location loc) { Is.ParamNull(loc, "loc"); if (loc.getWorld() != this.world) return false; int px = loc.getBlockX(); int py = loc.getBlockY(); int pz = loc.getBlockZ(); return (px >= sx && px <= ex) && (py >= sy && py <= ey) && (pz >= sz && pz <= ez); } @SuppressWarnings("deprecation") public void fill(int id, byte data) { for (int x = sx; x <= ex; x++) for (int y = sy; y <= ey; y++) for (int z = sz; z <= ez; z++) world.getBlockAt(x, y, z).setTypeIdAndData(id, data, true); } @SuppressWarnings("deprecation") public void fill(Material fillingMat, byte data) { Is.ParamNull(fillingMat, "fillingMat"); fill(fillingMat.getId(), data); } public void fill(Material fillingMat) { fill(fillingMat, (byte) 0); } public Block[] getBlocks() { Block[] blocks = new Block[countAll()]; int i = 0; for (int x = sx; x <= ex; x++) for (int y = sy; y <= ey; y++) for (int z = sz; z <= ez; z++) blocks[i++] = world.getBlockAt(x, y, z); return blocks; } public int count(Material blockMat) { Is.ParamNull(blockMat, "blockMat"); int i = 0; for (int x = sx; x <= ex; x++) for (int y = sy; y <= ey; y++) for (int z = sz; z <= ez; z++) if (world.getBlockAt(x, y, z).getType() == blockMat) i++; return i; } public int countAll() { return height * width * depth; } public Location randomLoc() { // 将来絶対読めない // 0.5 0.5 padding double rndx = ECore.rand.nextInt(width * 1000 - 1000) / 1000D + .5 + (sx < ex ? sx : ex); double rndy = ECore.rand.nextInt(height * 1000 - 1000) / 1000D + .5 + (sy < ey ? sy : ey); double rndz = ECore.rand.nextInt(depth * 1000 - 1000) / 1000D + .5 + (sz < ez ? sz : ez); return new Location(world, rndx, rndy, rndz); } public Location randomLocIgnoreY() { // 0.5 0.5 padding double rndx = ECore.rand.nextInt(width * 1000 - 1000) / 1000D + .5 + (sx < ex ? sx : ex); double rndz = ECore.rand.nextInt(depth * 1000 - 1000) / 1000D + .5 + (sz < ez ? sz : ez); return new Location(world, rndx, sy < ey ? sy : ey, rndz); } @SuppressWarnings("unchecked") public void save(JSONObject jsonObject) { Is.ParamNull(jsonObject, "jsonObject"); jsonObject.put("world", world.getName()); jsonObject.put("startX", sx); jsonObject.put("endX", ex); jsonObject.put("startY", sy); jsonObject.put("endY", ey); jsonObject.put("startZ", sz); jsonObject.put("endZ", ez); } }
/** * Project Name: Thread * File Name: Fourth.java * Package Name: oop * Date: 2016年4月27日下午3:39:02 * Copyright (c) 2016, Yunchuang All Rights Reserved. * * @author gehge * * 变更时间 Date:2016年4月27日下午3:39:02 变更原因 变更人员. * */ package oop; /** * ClassName:Fourth <br/> * * (TODO:添加处理说明) * */ public class Fourth extends Third { public static void main(String args[]) { Fourth f = new Fourth(); f.sayHello(); } }
import java.util.Random; public class MyRandom extends Random { public int[] numbers; public int consumed = 0; public MyRandom(int[] numbers) { this.numbers = numbers; } @Override public int nextInt(int upperBound) { int v = numbers[consumed++]; System.err.println(v); if (v < 0) return 0; if (v >= upperBound) return upperBound; return v; } }
package com.pangpang6.books.sort.heap; import org.junit.Test; import java.util.Arrays; public class SmallHeapSortTest { @Test public void smallHeapSortTest() { int[] arr = {9, 8, 11, 6, 5, 13, 3, 40, 1, 22}; for (int i = arr.length / 2 - 1; i >= 0; i--) { adjustSmall(arr, i, arr.length); } System.out.println(Arrays.toString(arr)); //2.调整堆结构+交换堆顶元素与末尾元素 for (int j = arr.length - 1; j > 0; j--) { //将堆顶元素与末尾元素进行交换 swap(arr, 0, j); //重新对堆进行调整 adjustSmall(arr, 0, j); } System.out.println(Arrays.toString(arr)); } public static void adjustSmall(int[] arr, int i, int len) { //先取出当前值 int temp = arr[i]; for (int k = 2 * i + 1; k < len; k = k * 2 + 1) { if (k + 1 < len && arr[k] > arr[k + 1]) { k++; } if (arr[k] < temp) { arr[i] = arr[k]; i = k; } else { break; } } arr[i] = temp; } public static void swap(int[] arr, int i, int j) { int t = arr[i]; arr[i] = arr[j]; arr[j] = t; } }
package project2_JavaToJSON.model; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import java.util.List; @Builder @Data @NoArgsConstructor @AllArgsConstructor public class QuizCategory { private String category; private List<QuestionMetadata> results; }
package com.lubarov.daniel.blog; import com.lubarov.daniel.data.collection.Collection; import com.lubarov.daniel.data.sequence.SinglyLinkedList; import com.lubarov.daniel.web.http.HttpRequest; import com.lubarov.daniel.web.http.MemorySessionData; public final class Notifications { private static final MemorySessionData<SinglyLinkedList<String>> messageData = new MemorySessionData<>(); private Notifications() {} public static void addMessage(HttpRequest request, String message) { messageData.set(request, getMessages(request).plusFront(message)); } public static Collection<String> getAndClearMessages(HttpRequest request) { Collection<String> messages = getMessages(request); clearMessages(request); return messages; } private static SinglyLinkedList<String> getMessages(HttpRequest request) { return messageData.tryGet(request).getOrDefault(SinglyLinkedList.create()); } private static void clearMessages(HttpRequest request) { messageData.tryClear(request); } }
package com.kaoqin.dao; import java.sql.ResultSet; import java.sql.SQLException; import com.kaoqin.db.Conn; import com.kaoqin.po.Admin; public class AdminDao { public static boolean login(Admin ad){ Conn db = new Conn(); String sqlstr = "select id,userName,userPass from admin where userName='" + ad.getUserName() + "'"; ResultSet rs = db.executeQuery(sqlstr); try { if (rs != null && rs.next()) { String pass = rs.getString("userPass"); if (ad.getUserPass().equals(pass)) { return true; } } } catch (SQLException ex) { } finally{ db.close(); } return false; } }
package com.tencent.mm.plugin.appbrand.jsapi.video; import com.tencent.mm.plugin.appbrand.jsapi.video.e.g; import com.tencent.mm.plugin.mmsight.segment.FFmpegMetadataRetriever; import com.tencent.mm.sdk.platformtools.al.a; import com.tencent.mm.sdk.platformtools.x; import java.math.BigDecimal; import org.json.JSONException; import org.json.JSONObject; class e$1 implements a { final /* synthetic */ e gbt; e$1(e eVar) { this.gbt = eVar; } public final boolean vD() { try { int currPosMs = this.gbt.gbp.getCurrPosMs(); if (Math.abs(currPosMs - this.gbt.gbs) >= 250) { JSONObject aka = this.gbt.aka(); this.gbt.gbs = currPosMs; aka.put("position", new BigDecimal((((double) currPosMs) * 1.0d) / 1000.0d).setScale(3, 4).doubleValue()); aka.put(FFmpegMetadataRetriever.METADATA_KEY_DURATION, this.gbt.gbp.getDuration()); this.gbt.a(new g((byte) 0), aka); } } catch (JSONException e) { x.e("MicroMsg.JsApiVideoCallback", "OnVideoTimeUpdate e=%s", new Object[]{e}); } return true; } }
package com.espendwise.manta.util; import com.espendwise.manta.model.data.CountryPropertyData; import com.espendwise.manta.model.data.ItemData; import com.espendwise.manta.model.data.OrderItemData; import com.espendwise.manta.model.data.OrderMetaData; import com.espendwise.manta.model.view.DistOptionsForShippingView; import com.espendwise.manta.model.view.FreightHandlerView; import java.util.ArrayList; import java.util.Collection; import java.util.Date; import java.util.HashSet; import java.util.List; import java.util.Set; /** * <code>OrderUtil</code> is a order and orderItem utility class with helper methods */ public class OrderUtil { private static ArrayList<String> goodOrderItemStatusCodes = new ArrayList<String>(); static { goodOrderItemStatusCodes.add(RefCodeNames.ORDER_ITEM_STATUS_CD.INVOICED); goodOrderItemStatusCodes.add(RefCodeNames.ORDER_ITEM_STATUS_CD.PENDING_ERP_PO); goodOrderItemStatusCodes.add(RefCodeNames.ORDER_ITEM_STATUS_CD.PENDING_FULFILLMENT); goodOrderItemStatusCodes.add(RefCodeNames.ORDER_ITEM_STATUS_CD.PENDING_FULFILLMENT_PROCESSING); goodOrderItemStatusCodes.add(RefCodeNames.ORDER_ITEM_STATUS_CD.SENT_TO_DISTRIBUTOR); goodOrderItemStatusCodes.add(RefCodeNames.ORDER_ITEM_STATUS_CD.SENT_TO_DISTRIBUTOR_FAILED); goodOrderItemStatusCodes.add(RefCodeNames.ORDER_ITEM_STATUS_CD.PO_ACK_SUCCESS); goodOrderItemStatusCodes.add(RefCodeNames.ORDER_ITEM_STATUS_CD.PO_ACK_ERROR); goodOrderItemStatusCodes.add(RefCodeNames.ORDER_ITEM_STATUS_CD.PO_ACK_REJECT); goodOrderItemStatusCodes.add(null); } public static boolean isGoodOrderItemStatus(String orderItemStatusCd) { if (orderItemStatusCd == null) { return true; } return goodOrderItemStatusCodes.contains(orderItemStatusCd); } public static boolean isSimpleServiceOrder(List<ItemData> items) { boolean isService = false; boolean isOther = false; if (Utility.isSet(items)) { for (ItemData item : items) { if (RefCodeNames.ITEM_TYPE_CD.SERVICE.equals(item.getItemTypeCd())) { isService = true; } else { isOther = true; } if (isService == isOther) return false; } } return isService; } public static FreightHandlerView getShipVia(List<FreightHandlerView> freightHandlers, Long freightHandlerId) { FreightHandlerView shipVia = null; if (Utility.isSet(freightHandlers)) { for (FreightHandlerView freightHandler : freightHandlers) { if (freightHandlerId == freightHandler.getBusEntityData().getBusEntityId()) { shipVia = freightHandler; break; } } } return shipVia; } public static String getShipViaName(List<FreightHandlerView> freightHandlers, Long freightHandlerId) { String shipViaName = ""; FreightHandlerView shipVia = getShipVia(freightHandlers, freightHandlerId); if (shipVia != null) { shipViaName = shipVia.getBusEntityData().getShortDesc(); } return shipViaName; } public static boolean getAllowShipingModifications(String orderStatus) { return (RefCodeNames.ORDER_STATUS_CD.PENDING_ORDER_REVIEW.equals(orderStatus) || RefCodeNames.ORDER_STATUS_CD.PENDING_REVIEW.equals(orderStatus)); } public static Collection<String> getDistERPNumsInItems(List<OrderItemData> orderItems) { Set<String> distErpNums = new HashSet<String>(); if (Utility.isSet(orderItems)) { for (OrderItemData orderItem : orderItems) { String erpNum = orderItem.getDistErpNum(); if (Utility.isSet(erpNum)) { distErpNums.add(erpNum); } } } return distErpNums; } public static boolean isOrderStatusValid( String orderStatus, boolean fullControl ) { if (null == orderStatus) { return false; } if (RefCodeNames.ORDER_STATUS_CD.PENDING_DATE.equals(orderStatus) || RefCodeNames.ORDER_STATUS_CD.PENDING_CONSOLIDATION.equals(orderStatus) || RefCodeNames.ORDER_STATUS_CD.PENDING_APPROVAL.equals(orderStatus) || RefCodeNames.ORDER_STATUS_CD.PENDING_ORDER_REVIEW.equals(orderStatus) || RefCodeNames.ORDER_STATUS_CD.ERP_REJECTED.equals(orderStatus) ) { return true; } if (fullControl && ( RefCodeNames.ORDER_STATUS_CD.CANCELLED.equals(orderStatus) || RefCodeNames.ORDER_STATUS_CD.DUPLICATED.equals(orderStatus) || RefCodeNames.ORDER_STATUS_CD.PENDING_REVIEW.equals(orderStatus) || RefCodeNames.ORDER_STATUS_CD.INVOICED.equals(orderStatus) || RefCodeNames.ORDER_STATUS_CD.ERP_RELEASED_PO_ERROR.equals(orderStatus) || RefCodeNames.ORDER_STATUS_CD.ERP_CANCELLED.equals(orderStatus) || RefCodeNames.ORDER_STATUS_CD.ERP_REJECTED.equals(orderStatus))) { return true; } return false; } public static OrderMetaData getMetaObject(List<OrderMetaData> metaList, String name, Date orderModDate) { OrderMetaData meta = null; if (Utility.isSet(metaList) && Utility.isSet(name)) { Date modDate = null; for (OrderMetaData metaObj : metaList) { String objName = metaObj.getName(); if (name.equals(objName)) { if (modDate == null) { modDate = orderModDate; meta = metaObj; } else { Date mD = orderModDate; if (mD == null) continue; if (modDate.before(mD)) { modDate = mD; meta = metaObj; } } } } } return meta; } public static DistOptionsForShippingView getDistShipOption(List<DistOptionsForShippingView> distShipOptions, String distErpNum) { DistOptionsForShippingView foundDistShipOption = null; if (Utility.isSet(distShipOptions) && Utility.isSet(distErpNum)) { for (DistOptionsForShippingView distShipOption : distShipOptions) { if (distErpNum.equals(distShipOption.getDistributor().getErpNum())) { foundDistShipOption = distShipOption; break; } } } return foundDistShipOption; } public static boolean isStateProvinceRequired(List<CountryPropertyData> countryProperties) { String strValue = null; if (Utility.isSet(countryProperties)) { for (CountryPropertyData countryProperty : countryProperties) { if (RefCodeNames.COUNTRY_PROPERTY.USES_STATE.equals(countryProperty.getCountryPropertyCd())) { strValue = countryProperty.getValue(); break; } } } return Utility.isTrue(strValue); } }