text
stringlengths
10
2.72M
package com.ireslab.sendx.electra.repository; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.PagingAndSortingRepository; import org.springframework.data.repository.query.Param; import com.ireslab.sendx.electra.entity.GstSacCode; public interface GstSacCodeRepository extends PagingAndSortingRepository<GstSacCode,Integer> { //TODO write query to search data from database @Query(value="select gsc from GstSacCode gsc where gsc.sacCode like %:searchData% OR gsc.description like %:searchData% OR gsc.alsoCheck like %:searchData% ") Page<GstSacCode> findAllCustom(@Param("searchData")String searchData,Pageable pageable); }
package com.komaxx.komaxx_gl.primitives; import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.FloatBuffer; import java.nio.ShortBuffer; import android.opengl.GLES20; import com.komaxx.komaxx_gl.RenderProgram; import com.komaxx.komaxx_gl.util.RenderUtil; /** * Static methods to define and manipulate a mesh used for rendering of * event backgrounds. * * It looks like this: <br> * <pre> * ____________________ * / | | \ * ------------------------ * | | | | * | | | | * ------------------------ * \ | | / * ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ * </pre> * * @author Matthias Schicker */ public class ColoredRimQuad { public static final int TRIANGLE_COUNT = 4 + 6 + 4; public static final int VERTEX_COUNT = 2 + 4 + 4 + 2; public static final int INDICES_COUNT = TRIANGLE_COUNT * 3; // vertex numeration is line-based: // 0 1 // 2 3 4 5 // 6 7 8 9 // 10 11 public static final int PATCH_FLOATS = VERTEX_COUNT * Vertex.COLOR_VERTEX_DATA_STRIDE_FLOATS; public static final int PATCH_BYTES = VERTEX_COUNT * Vertex.COLOR_VERTEX_DATA_STRIDE_BYTES; private static final float[] tmpX = new float[4]; private static final float[] tmpY = new float[4]; private static short[] basicIndices = new short[]{ 0,2,3, 0,3,1, 1,3,4, 1,4,5, 2,6,3, 3,6,7, 3,7,4, 4,7,8, 4,8,5, 5,8,9, 6,10,7, 7,10,8, 8,10,11, 8,11,9 }; private static short[] tmpIndices = new short[basicIndices.length]; public static ShortBuffer allocatePatchIndices(int count) { ShortBuffer ret = ByteBuffer.allocateDirect( INDICES_COUNT * count * RenderUtil.SHORT_SIZE_BYTES ).order(ByteOrder.nativeOrder()).asShortBuffer(); ret.position(0); int offset = 0; for (int i = 0; i < count; i++){ ret.put(getOffsetedIndices(tmpIndices, offset)); offset += VERTEX_COUNT; } return ret; } public static FloatBuffer allocateMeshes(int count) { return ByteBuffer.allocateDirect( count * VERTEX_COUNT * Vertex.COLOR_VERTEX_DATA_STRIDE_BYTES ).order(ByteOrder.nativeOrder()).asFloatBuffer(); } public static void putOffsetedIndices(ShortBuffer indexBuffer, int indexOffset) { indexBuffer.put(getOffsetedIndices(tmpIndices, indexOffset)); } public static short[] getOffsetedIndices(short[] ret, int offset) { for (int i = 0; i < INDICES_COUNT; i++){ ret[i] = (short) (offset + basicIndices[i]); } return ret; } public static final void position(FloatBuffer data, int offset, float ulX, float ulY, float lrX, float lrY, float z, float rimWidth ){ tmpX[0] = ulX; tmpX[1] = ulX + rimWidth; tmpX[2] = lrX - rimWidth; tmpX[3] = lrX; tmpY[0] = ulY; tmpY[1] = ulY - rimWidth; tmpY[2] = lrY + rimWidth; tmpY[3] = lrY; // top row (2 vertices) data.position(offset); data.put(tmpX[1]); data.put(ulY); data.put(z); offset += Vertex.COLOR_VERTEX_DATA_STRIDE_FLOATS; data.position(offset); data.put(tmpX[2]); data.put(ulY); data.put(z); offset += Vertex.COLOR_VERTEX_DATA_STRIDE_FLOATS; // two middle rows for (int yIndex = 1; yIndex < 3; yIndex++){ float y = tmpY[yIndex]; for (int xIndex = 0; xIndex < 4; xIndex++){ data.position(offset); data.put(tmpX[xIndex]); data.put(y); data.put(z); offset += Vertex.COLOR_VERTEX_DATA_STRIDE_FLOATS; } } // bottom row (2 vertices) data.position(offset); data.put(tmpX[1]); data.put(lrY); data.put(z); offset += Vertex.COLOR_VERTEX_DATA_STRIDE_FLOATS; data.position(offset); data.put(tmpX[2]); data.put(lrY); data.put(z); offset += Vertex.COLOR_VERTEX_DATA_STRIDE_FLOATS; } /** * expects a float[8] array containing first the rim, then the content color */ public static void setColor(FloatBuffer data, int offset, float[] rimContentColors, float topBottomAlphaFactor) { offset += Vertex.COLOR_VERTEX_DATA_COLOR_OFFSET; // top row data.position(offset); data.put(rimContentColors, 0, 4); offset += Vertex.COLOR_VERTEX_DATA_STRIDE_FLOATS; data.position(offset); data.put(rimContentColors, 0, 4); offset += Vertex.COLOR_VERTEX_DATA_STRIDE_FLOATS; // top middle row data.position(offset); data.put(rimContentColors, 0, 4); offset += Vertex.COLOR_VERTEX_DATA_STRIDE_FLOATS; data.position(offset); data.put(rimContentColors, 4, 4); offset += Vertex.COLOR_VERTEX_DATA_STRIDE_FLOATS; data.position(offset); data.put(rimContentColors, 4, 4); offset += Vertex.COLOR_VERTEX_DATA_STRIDE_FLOATS; data.position(offset); data.put(rimContentColors, 0, 4); offset += Vertex.COLOR_VERTEX_DATA_STRIDE_FLOATS; for (int i = 0; i < 8; i++) rimContentColors[i] *= topBottomAlphaFactor; // bottom middle row data.position(offset); data.put(rimContentColors, 0, 4); offset += Vertex.COLOR_VERTEX_DATA_STRIDE_FLOATS; data.position(offset); data.put(rimContentColors, 4, 4); offset += Vertex.COLOR_VERTEX_DATA_STRIDE_FLOATS; data.position(offset); data.put(rimContentColors, 4, 4); offset += Vertex.COLOR_VERTEX_DATA_STRIDE_FLOATS; data.position(offset); data.put(rimContentColors, 0, 4); offset += Vertex.COLOR_VERTEX_DATA_STRIDE_FLOATS; // bottom row data.position(offset); data.put(rimContentColors, 0, 4); offset += Vertex.COLOR_VERTEX_DATA_STRIDE_FLOATS; data.position(offset); data.put(rimContentColors, 0, 4); offset += Vertex.COLOR_VERTEX_DATA_STRIDE_FLOATS; } public static void setColor(FloatBuffer data, int offset, float rimR, float rimG, float rimB, float rimA, float contentR, float contentG, float contentB, float contentA) { offset += Vertex.COLOR_VERTEX_DATA_COLOR_OFFSET; // top row data.position(offset); data.put(rimR);data.put(rimG);data.put(rimB);data.put(rimA); offset += Vertex.COLOR_VERTEX_DATA_STRIDE_FLOATS; data.position(offset); data.put(rimR);data.put(rimG);data.put(rimB);data.put(rimA); offset += Vertex.COLOR_VERTEX_DATA_STRIDE_FLOATS; // middle rows for (int i = 0; i < 2; i++){ data.position(offset); data.put(rimR);data.put(rimG);data.put(rimB);data.put(rimA); offset += Vertex.COLOR_VERTEX_DATA_STRIDE_FLOATS; data.position(offset); data.put(contentR);data.put(contentG);data.put(contentB);data.put(contentA); offset += Vertex.COLOR_VERTEX_DATA_STRIDE_FLOATS; data.position(offset); data.put(contentR);data.put(contentG);data.put(contentB);data.put(contentA); offset += Vertex.COLOR_VERTEX_DATA_STRIDE_FLOATS; data.position(offset); data.put(rimR);data.put(rimG);data.put(rimB);data.put(rimA); offset += Vertex.COLOR_VERTEX_DATA_STRIDE_FLOATS; } // bottom row data.position(offset); data.put(rimR);data.put(rimG);data.put(rimB);data.put(rimA); offset += Vertex.COLOR_VERTEX_DATA_STRIDE_FLOATS; data.position(offset); data.put(rimR);data.put(rimG);data.put(rimB);data.put(rimA); offset += Vertex.COLOR_VERTEX_DATA_STRIDE_FLOATS; } public static void setColor(FloatBuffer data, int offset, float rimR, float rimG, float rimB, float contentR, float contentG, float contentB) { offset += Vertex.COLOR_VERTEX_DATA_COLOR_OFFSET; // top row data.position(offset); data.put(rimR);data.put(rimG);data.put(rimB); offset += Vertex.COLOR_VERTEX_DATA_STRIDE_FLOATS; data.position(offset); data.put(rimR);data.put(rimG);data.put(rimB); offset += Vertex.COLOR_VERTEX_DATA_STRIDE_FLOATS; // middle rows for (int i = 0; i < 2; i++){ data.position(offset); data.put(rimR);data.put(rimG);data.put(rimB); offset += Vertex.COLOR_VERTEX_DATA_STRIDE_FLOATS; data.position(offset); data.put(contentR);data.put(contentG);data.put(contentB); offset += Vertex.COLOR_VERTEX_DATA_STRIDE_FLOATS; data.position(offset); data.put(contentR);data.put(contentG);data.put(contentB); offset += Vertex.COLOR_VERTEX_DATA_STRIDE_FLOATS; data.position(offset); data.put(rimR);data.put(rimG);data.put(rimB); offset += Vertex.COLOR_VERTEX_DATA_STRIDE_FLOATS; } // bottom row data.position(offset); data.put(rimR);data.put(rimG);data.put(rimB); offset += Vertex.COLOR_VERTEX_DATA_STRIDE_FLOATS; data.position(offset); data.put(rimR);data.put(rimG);data.put(rimB); offset += Vertex.COLOR_VERTEX_DATA_STRIDE_FLOATS; } public static final void setAlpha(FloatBuffer data, int offset, float alpha){ offset += Vertex.COLOR_VERTEX_DATA_ALPHA_OFFSET; for (int i = 0; i < VERTEX_COUNT; i++){ data.position(offset); data.put(alpha); offset += Vertex.COLOR_VERTEX_DATA_STRIDE_FLOATS; } } public static final void setAlpha(FloatBuffer data, int offset, float topAlpha, float bottomAlpha){ offset += Vertex.COLOR_VERTEX_DATA_ALPHA_OFFSET; // upper two rows for (int i = 0; i < 6; i++){ data.position(offset); data.put(topAlpha); offset += Vertex.COLOR_VERTEX_DATA_STRIDE_FLOATS; } // lower two row for (int i = 0; i < 6; i++){ data.position(offset); data.put(bottomAlpha); offset += Vertex.COLOR_VERTEX_DATA_STRIDE_FLOATS; } } /** * Sets the attribute pointers for the current renderProgram (which should * be one of the texturing render programs!!) and paints it. The appropriate * texture should already be bound previously. */ public static boolean render(RenderProgram rp, int firstPatch, int patchCount, FloatBuffer patchData, ShortBuffer patchIndices) { // set the patch float buffer to be used as position source patchData.position(0); GLES20.glVertexAttribPointer( rp.vertexXyzHandle, 3, GLES20.GL_FLOAT, false, Vertex.COLOR_VERTEX_DATA_STRIDE_BYTES, patchData); GLES20.glEnableVertexAttribArray(rp.vertexXyzHandle); // set the patch float buffer to be used as colorSource patchData.position(Vertex.COLOR_VERTEX_DATA_COLOR_OFFSET); GLES20.glVertexAttribPointer( rp.vertexColorHandle, 4, GLES20.GL_FLOAT, false, Vertex.COLOR_VERTEX_DATA_STRIDE_BYTES, patchData); GLES20.glEnableVertexAttribArray(rp.vertexColorHandle); patchIndices.position(firstPatch * INDICES_COUNT); GLES20.glDrawElements(GLES20.GL_TRIANGLES, patchCount * INDICES_COUNT, GLES20.GL_UNSIGNED_SHORT, patchIndices); return true; } }
package kr.blogspot.ovsoce.allsearch.main.fragment; import android.graphics.Bitmap; import android.graphics.drawable.AnimationDrawable; import android.os.Bundle; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.webkit.WebChromeClient; import android.webkit.WebResourceError; import android.webkit.WebResourceRequest; import android.webkit.WebView; import android.webkit.WebViewClient; import android.widget.ImageView; import android.widget.ProgressBar; import kr.blogspot.ovsoce.allsearch.R; import kr.blogspot.ovsoce.allsearch.common.Log; public class PlaceholderFragment extends Fragment implements PlaceholderPresenter.View { /** * The fragment argument representing the section number for this * fragment. */ public static final String ARG_SECTION_NUMBER = "section_number"; public PlaceholderFragment() { } /** * Returns a new instance of this fragment for the given section * number. */ public static PlaceholderFragment newInstance(int sectionNumber) { PlaceholderFragment fragment = new PlaceholderFragment(); Bundle args = new Bundle(); args.putInt(ARG_SECTION_NUMBER, sectionNumber); fragment.setArguments(args); return fragment; } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { return inflater.inflate(R.layout.fragment_main, container, false); } private PlaceholderPresenter mPresenter; public PlaceholderPresenter getPresenter() { return mPresenter; } @Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); mPresenter = new PlaceholderPresenterImpl(this); mPresenter.onActivityCreate(getActivity(), getArguments()); } private WebView mWebview; //private ProgressBar mProgressBar; private ImageView mLoadingImg; @Override public void onInit() { //mProgressBar = (ProgressBar) getView().findViewById(R.id.webview_progressbar); mLoadingImg = (ImageView) getView().findViewById(R.id.img_loading); mWebview = (WebView) getView().findViewById(R.id.webview); mWebview.getSettings().setJavaScriptEnabled(true); mWebview.setWebChromeClient(new WebChromeClientCustom()); mWebview.setWebViewClient(new WebViewClientCustom()); } @Override public void replaceUrl(String url) { Log.d("url = " + url); if(getView() != null) { mWebview.loadUrl(url); } } private class WebChromeClientCustom extends WebChromeClient { @Override public void onProgressChanged(WebView view, int newProgress) { //mProgressBar.setProgress(newProgress); super.onProgressChanged(view, newProgress); } } private class WebViewClientCustom extends WebViewClient { @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { return super.shouldOverrideUrlLoading(view, url); } @Override public void onPageStarted(WebView view, String url, Bitmap favicon) { //mProgressBar.setVisibility(View.VISIBLE); mLoadingImg.setVisibility(View.VISIBLE); ((AnimationDrawable)mLoadingImg.getBackground()).start(); super.onPageStarted(view, url, favicon); } @Override public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) { view.loadUrl("file:///android_asset/network_off.html"); super.onReceivedError(view, request, error); } @Override public void onPageFinished(WebView view, String url) { //mProgressBar.setVisibility(View.GONE); //mProgressBar.setProgress(0); mLoadingImg.setVisibility(View.GONE); ((AnimationDrawable)mLoadingImg.getBackground()).stop(); super.onPageFinished(view, url); } } }
package com.example.billage.backend.api; import android.database.Cursor; import android.util.Log; import com.example.billage.backend.common.DbOpenHelper; import com.example.billage.backend.common.Utils; import java.text.ParseException; import java.util.ArrayList; import java.util.Arrays; public class StatisticTransaction { //오늘 날짜를 기준으로 일주일(월~금)의 수입,지출 통계 반환 //parameter: "입금", "츨금" public static ArrayList<Integer> daily_statistic(String inout) throws ParseException { Integer [] int_arr = new Integer[7]; Arrays.fill(int_arr,0); ArrayList<Integer> daily_data = new ArrayList<Integer>(Arrays.asList(int_arr)); String today = Utils.getDay(); String monday = String.valueOf(Integer.parseInt(today) - (Utils.getDayOfWeek() - 2)); String query = "SELECT date,sum(money) from 'transaction' where inout='" + inout +"' and date>=" + monday +" group by date order by date asc"; Cursor c = DbOpenHelper.mDB.rawQuery(query,null); if(c.moveToFirst()){ do{ int idx = Integer.parseInt(c.getString(0)) - Integer.parseInt(monday); daily_data.set(idx,Integer.parseInt(c.getString(1))); }while (c.moveToNext()); } //log찍기 위함 for(int i=0;i<7;i++){ Log.d("daily_data",i+" "+String.valueOf(daily_data.get(i))); } return daily_data; } //1년 수입, 지출 통계 반환 public static ArrayList<Integer> monthly_statistic(String inout){ Integer [] int_arr = new Integer[12]; Arrays.fill(int_arr,0); ArrayList<Integer> monthly_data = new ArrayList<Integer>(Arrays.asList(int_arr)); String year_start = Utils.getYear()+"0101"; String query = "SELECT date,sum(money) from 'transaction' where inout='" + inout +"' and date>=" + year_start +" group by date order by date asc"; Cursor c = DbOpenHelper.mDB.rawQuery(query,null); if(c.moveToFirst()){ do{ int idx = (Integer.parseInt(c.getString(0)) - Integer.parseInt(year_start))/100; monthly_data.set(idx, monthly_data.get(idx) + Integer.parseInt(c.getString(1))); }while (c.moveToNext()); } //log찍기 위함 for(int i=0;i<12;i++){ Log.d("monthly_data",i+" "+String.valueOf(monthly_data.get(i))); } return monthly_data; } }
package Tools; import com.badlogic.gdx.Game; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.graphics.g2d.SpriteBatch; import com.teamname.game.Actor.Player; import com.teamname.game.Main; import com.teamname.game.Screens.GameSc; import java.util.Timer; import java.util.TimerTask; public class Joystick { Texture CircleImg, StickImg; public Circle CircleBounds, StickBounds; public float Rcircle, Rstick; private int pointer = -1; float length; float dx; float dy; static float Speed; Point2D CirclePos; Point2D StickPos; Point2D direction; float joyX,joyY; boolean isDownTouch,fireJoy; public boolean oreOverlaps=false; Point2D joyDirection=new Point2D(0,0); private static final int logOutSec=5; private int counter=logOutSec; Timer timer; float realSpeed=0; boolean rspeedN; int case_; // Size общий размер джойстика public Joystick(Texture cimg, Texture simg, Point2D point, float Size, int case_) { CircleImg = cimg; StickImg = simg; Rcircle = Size / 2; Rstick = Rcircle / 2; CircleBounds = new Circle(point, Rcircle); StickBounds = new Circle(point, Rstick); direction = new Point2D(0, 0); CirclePos=new Point2D(point.getX(),point.getY()); StickPos=new Point2D(point.getX(),point.getY()); Speed=GameSc.player.Speed; joyX=point.getX(); joyY=point.getY(); this.case_=case_; //if(case_==0)timeCheck(); fireJoy=!(case_==0); } public void draw(SpriteBatch batch) { batch.draw(CircleImg, CircleBounds.pos.getX()-Rcircle, CircleBounds.pos.getY()-Rcircle, Rcircle * 2, Rcircle * 2); batch.draw(StickImg, StickBounds.pos.getX()-Rstick, StickBounds.pos.getY()-Rstick, Rstick * 2, Rstick * 2); } public int getPointer() { return pointer; } public void update(float x, float y, boolean isDownTouch, int pointer) { //при каких обстоятельствах вызываем atControl() Point2D touch = new Point2D(x, y); if(pointer==this.pointer) { dx = CircleBounds.pos.getX() - x; dy = CircleBounds.pos.getY() - y; } length = (float) Math.sqrt(dx * dx + dy * dy); //попали в окружность - ок if (CircleBounds.isContains(touch) && isDownTouch && this.pointer == -1) this.pointer = pointer; if (CircleBounds.Overlaps(StickBounds) && isDownTouch && pointer == this.pointer) atControl(new Point2D(x,y)); if ((!isDownTouch && pointer == this.pointer)){returnStick();GameSc.player.isMove=false; //Gdx.app.log("PLAYER_MOVE", "FALSE"); } //стик выходит за окружность // изменяется положение как стика, так и персонажа // полоучение позиции игрока, за исключением его поворота??? if(!CircleBounds.isContains(StickBounds.pos)){ StickBounds.pos.setX(-Rcircle/ length * dx +joyX);StickBounds.pos.setY(-Rcircle/ length * dy +joyY); } } //вызываем, когда палец попал в окружность джойстика //двигает стик по окружности, создает направление public void atControl(Point2D point) { StickBounds.pos.setPoint(point); GameSc.player.isMove=true; isDownTouch=true; counter=0; rspeedN=true; float coef = (float)Math.sqrt(Math.pow(StickBounds.pos.getX()-CircleBounds.pos.getX(),2)+Math.pow(StickBounds.pos.getY()-CircleBounds.pos.getY(),2)); //if(case_!=1)Gdx.app.error("JOYSTICK","coef: "+Rcircle); if(case_!=1&&(GameSc.player.Speed * coef) / Rcircle<=GameSc.player.Speed) { GameSc.player.setRealSpeed((GameSc.player.Speed * coef) / Rcircle); // Gdx.app.error("realSPeed",GameSc.player.getRealSpeed()+"");} } //Gdx.app.log("PLAYER_MOVE", "TRUE"); //узнаем разность x окружности и стика (дифферинциалы) float dx = CircleBounds.pos.getX() - point.getX(); float dy = CircleBounds.pos.getY() - point.getY(); float dist = (float) Math.sqrt(dx * dx + dy * dy); //Gdx.app.log("isDownTouch",isDownTouch+""); //ошибка division by zero (решено) if(dist!=0)direction.setPoint(-(dx / dist), -(dy / dist)); else{direction.setPoint(0,0);} joyDirection=direction; } public void returnStick() { // возвращает стик к центру StickBounds.pos.setPoint(CircleBounds.pos); // задать velocity для плавного возвращения // когда пользователь отпускает стик, камере не передается информация if(fireJoy||!fireJoy)direction.setPoint(0,0); GameSc.player.setRealSpeed(0); //direction.setPoint(0, 0); isDownTouch=false; rspeedN=false; //GameSc.player.setRealSpeed(0); //Gdx.app.error("REALspeed",GameSc.player.getRealSpeed()+""); pointer = -1; } public Point2D getDir() { return direction; } public void timeCheck(){ timer=new Timer(); TimerTask task = new TimerTask() { @Override public void run() { //Gdx.app.log("counter",counter+""); //if(counter==0)counter=logOutSec; if(isDownTouch&&GameSc.player.getRealSpeed()<Speed) GameSc.player.changeSpeed(0.1f); else if(!isDownTouch&&GameSc.player.getRealSpeed()>0.7f) GameSc.player.changeSpeed(-0.5f); else if(!isDownTouch&&GameSc.player.getRealSpeed()<=0.7f) GameSc.player.setRealSpeed(0); Gdx.app.error("Joystick","realSpeed: "+GameSc.player.getRealSpeed()); } }; timer.scheduleAtFixedRate(task,0,100); } }
package test.offten; /** * Copyright (c) by www.leya920.com * All right reserved. * Create Date: 2017-03-23 17:11 * Create Author: maguoqiang * File Name: Parent.java * Last version: 1.0 * Function: //TODO * Last Update Date: 2017-03-23 17:11 * Last Update Log: * Comment: //TODO **/ public class Parent { int a=Integer.MAX_VALUE; static final int b=Integer.MAX_VALUE; static int getInt(){ return b; } int getIntByStatic(){ return getInt(); } }
package dominio.test; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import dominio.Cuenta; import dominio.Debito; import java.util.Date; import org.junit.jupiter.api.Assertions; /** * JUnits para testear la clase Debito * @author Xabier * */ public class DebitoTester1 extends TestCase{ Debito debito; Cuenta cuenta; public DebitoTester1(String sTestName) { super(sTestName); } /** * Metodo para inicializar una cuenta y una tarjeta de debito para realizar los JUnit */ public void setUp() throws Exception { cuenta=new Cuenta("0001.0002.12.1234567890","Fulano de tal"); cuenta.ingresar(1000.0); Date hoy=new Date(); long tiempo=Long.parseLong("12096000000"); Date fecha=new Date(hoy.getTime()+tiempo); //Caduca en 4 aņos debito=new Debito("1234567890123456", "Fulano de Tal", fecha); debito.setCuenta(cuenta); } public void tearDown() throws Exception { } /** * Prueba de JUnit para testear el metodo Liquidar de la clase Credito * @throws Exception */ public void testRetirar700() throws Exception { debito.retirar(700); Assertions.assertEquals(debito.getSaldo(),300); } /** * Prueba de JUnit para testear el metodo Liquidar de la clase Credito * @throws Exception */ public void testIngresar200() throws Exception { debito.ingresar(200); Assertions.assertEquals(debito.getSaldo(),1200); } /** * Prueba de JUnit para testear el metodo Liquidar de la clase Credito * @throws Exception */ public void testPagoEnEstablecimiento100() throws Exception { debito.pagoEnEstablecimiento("Jamon", 200); Assertions.assertEquals(debito.getSaldo(),800); } public static void main(String[] args) { //junit.swingui.TestRunner.run(CuentaTester1.class); junit.textui.TestRunner.run(DebitoTester1.class); } }
package com.wb.netty.http.service; import io.netty.channel.ChannelHandlerContext; import io.netty.channel.SimpleChannelInboundHandler; import io.netty.handler.codec.http.DefaultFullHttpResponse; import io.netty.handler.codec.http.FullHttpResponse; import io.netty.handler.codec.http.HttpResponseStatus; import io.netty.handler.codec.http.HttpVersion; import io.netty.util.CharsetUtil; import static io.netty.handler.codec.http.HttpResponseStatus.*; import java.nio.ByteBuffer; import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled; public class ServerHandler extends SimpleChannelInboundHandler<Object> { public static final String HONGBO_API_PATH = "com.hongbo.api.impl."; public void messageReceived(ChannelHandlerContext arg0, Object request) { System.out.println("messageReceived"); } public void channelActive(ChannelHandlerContext ctx) throws Exception { System.out.println("channelActive"); } public void exceptionCaught(ChannelHandlerContext arg0, Throwable arg1) throws Exception { System.out.println("exceptionCaught"); arg1.printStackTrace(); } public void handlerAdded(ChannelHandlerContext arg0) throws Exception { System.out.println("handlerAdded sss"); } public void handlerRemoved(ChannelHandlerContext ctx) throws Exception { System.out.println("handlerRemoved"); } @Override protected void channelRead0(ChannelHandlerContext ctx, Object req) throws Exception { System.out.println("channelRead0"+req.getClass()); ByteBuf byteBuf = (ByteBuf)req; byte[] bytes = new byte[byteBuf.readableBytes()]; byteBuf.readBytes(bytes); String content = new String(bytes); System.out.println("接收到数据是:"+content); if("test".equals(content)){ responseMsg(METHOD_NOT_ALLOWED, "test ok",ctx); }else{ responseMsg(METHOD_NOT_ALLOWED, "哈哈哈。。。",ctx); } } public void responseMsg(HttpResponseStatus status,String msg,ChannelHandlerContext ctx) { System.out.println("向应数据"+msg); byte[] retMsg = msg.getBytes(); ByteBuf byteBuffer = Unpooled.buffer(retMsg.length); byteBuffer.writeBytes(retMsg); ctx.writeAndFlush(byteBuffer); } }
package modul3.getraenkeHandelMitEingabe; import java.util.Scanner; public class Getraenkeverwaltung { @SuppressWarnings("Duplicates") public static void main(String[] args) { // Erzeugen des ersten Objekts Getraenk getraenk1; getraenk1 = new Getraenk(); // Setzen der Attributswerte via Set-Methoden:: getraenk1.setName("Ale"); // Strings in Anführungszeichen getraenk1.setPreis(1.5); // Dezimaltrennzeichen ist der Punkt getraenk1.setBestand(1000); getraenk1.setHoechstbestand(2000); getraenk1.setMindestbestand(50); // Ausgabe der Attributswerte des ersten Getränke-Objekts auf der // Konsole: System.out.println("Name des Getränks: " + getraenk1.getName()); System.out.println("Preis: " + getraenk1.getPreis()); System.out.println("Bestand: " + getraenk1.getBestand()); System.out.println("Höchstbestand: " + getraenk1.getHoechstbestand()); System.out.println("Mindestbestand: " + getraenk1.getMindestbestand()); System.out.println(); // Erzeugen eines zweiten Objekts unter Benützung des ersten neuen // Kon-struktors: Getraenk getraenk2; getraenk2 = new Getraenk("Dorfbrunnen Mineralwasser"); // Setzen der restlichen Attributswerte via Set-Methoden: getraenk2.setPreis(0.5); getraenk2.setBestand(3000); getraenk2.setHoechstbestand(5000); getraenk2.setMindestbestand(1000); // Ausgabe der Attributswerte des zweiten Getränke-Objekts auf der // Konso-le: System.out.println("Name des Getränks: " + getraenk2.getName()); System.out.println("Preis: " + getraenk2.getPreis()); System.out.println("Bestand: " + getraenk2.getBestand()); System.out.println("Höchstbestand: " + getraenk2.getHoechstbestand()); System.out.println("Mindestbestand: " + getraenk2.getMindestbestand()); System.out.println(); // Erzeugen eines dritten Objekts unter Benützung des zweiten neuen // Konstruktors: Getraenk getraenk3; getraenk3 = new Getraenk("Orangenlimonade", 2000, 1800, 700, 0.8); // Ausgabe der Attributswerte des dritten Getränke-Objekts auf der // Konso-le: System.out.println("Name des Getränks: " + getraenk3.getName()); System.out.println("Preis: " + getraenk3.getPreis()); System.out.println("Bestand: " + getraenk3.getBestand()); System.out.println("Höchstbestand: " + getraenk3.getHoechstbestand()); System.out.println("Mindestbestand: " + getraenk3.getMindestbestand()); System.out.println(); // Eingabe der Verkaufsmenge von Getränk 2 über die Konsole: // Erzeugen eines Objekts der Klasse Scanner für das Einlesen von der // Tastatur: Scanner tastatur = new Scanner(System.in); // Deklarieren einer Hilfsvariable zur Abspeicherung der // Tastatureingabe: int menge; // Beginn des Eingabe-Dialogs auf der Konsole: System.out.println("Geben Sie die Verkaufsmenge " + "für das Getränk --Dorfbrunnen Mineralwasser-- ein:"); // Der Variablen "menge" wird die letzte Zeile aus dem // Tastaturpuffer zugewiesen: menge = tastatur.nextInt(); getraenk2.getraenkVerkaufen(menge); System.out.println("Von Getränk " + getraenk2.getName() + " sind " + getraenk2.bestellmengeBerechnen() + " Einheiten zu bestellen."); System.out.println("Programmende."); } }
/* * created 13.03.2005 * * $Id:DiagramEditPart.java 2 2005-11-02 03:04:20Z csell $ */ package com.byterefinery.rmbench.editparts; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import org.eclipse.draw2d.Figure; import org.eclipse.draw2d.FreeformLayer; import org.eclipse.draw2d.FreeformLayout; import org.eclipse.draw2d.IFigure; import org.eclipse.draw2d.LayoutManager; import org.eclipse.gef.EditPart; import org.eclipse.gef.EditPolicy; import org.eclipse.gef.LayerConstants; import org.eclipse.gef.SnapToGrid; import org.eclipse.gef.SnapToHelper; import org.eclipse.gef.editparts.AbstractGraphicalEditPart; import org.eclipse.gef.editparts.LayerManager; import org.eclipse.gef.editpolicies.RootComponentEditPolicy; import org.eclipse.gef.editpolicies.SnapFeedbackPolicy; import org.eclipse.ui.views.properties.IPropertySource; import com.byterefinery.rmbench.EventManager; import com.byterefinery.rmbench.RMBenchPlugin; import com.byterefinery.rmbench.EventManager.Event; import com.byterefinery.rmbench.editpolicies.DiagramContainerEditPolicy; import com.byterefinery.rmbench.editpolicies.DiagramXYLayoutEditPolicy; import com.byterefinery.rmbench.external.IExportable; import com.byterefinery.rmbench.model.diagram.AbstractDTable; import com.byterefinery.rmbench.model.diagram.DForeignKey; import com.byterefinery.rmbench.model.diagram.DTable; import com.byterefinery.rmbench.model.diagram.DTableStub; import com.byterefinery.rmbench.model.diagram.Diagram; import com.byterefinery.rmbench.model.schema.ForeignKey; import com.byterefinery.rmbench.model.schema.Table; import com.byterefinery.rmbench.views.property.DiagramPropertySource; /** * Edit part representing a schema diagram. A schema diagram can display any number * of tables from a schema. Note, however, that a schema can be spread across multiple * diagrams, and tables from one schema can appear in multiple diagrams. * * @author cse */ public class DiagramEditPart extends AbstractGraphicalEditPart implements IExportable, IExportable.DiagramExport { private class Listener extends EventManager.Listener implements PropertyChangeListener { public void propertyChange(PropertyChangeEvent evt) { if(evt.getPropertyName() == Diagram.PROPERTY_TABLE) { if(evt.getOldValue() == null) { DTable dtable = (DTable)evt.getNewValue(); if (dtable!=null) { addChild(dtable); getDiagram().updateTables(); refreshTablesStubs(); refreshReferences(dtable); refreshForeignKeys(dtable); } } else { DTable dtable = (DTable)evt.getOldValue(); removeChild(dtable); refreshReferences(dtable); refreshForeignKeys(dtable); refreshTablesStubs(); } } } public void eventOccurred(int eventType, Event event) { if(eventType == FOREIGNKEY_ADDED) { //pick up stubs for foreign keys w/o table import ForeignKey foreignKey = (ForeignKey)event.element; if(getDiagram().getDTable(foreignKey.getTargetTable()) == null || getDiagram().getDTable(foreignKey.getTable()) == null) { refreshTablesStubs(); } } else if(eventType == FOREIGNKEY_DELETED) { //undo op for former ForeignKey foreignKey = (ForeignKey)event.element; DTableStub stub = getDiagram().getTableStub(foreignKey); if(stub != null) { stub.invalidate(); refreshTablesStubs(); getTableEditPart(stub.getDTable().getTable()).refreshSourceConnections(); } } else if(event.owner == getDiagram()) { //table added/deleted ForeignKey[] foreignKeys = (ForeignKey[])event.info; if(foreignKeys != null) { Table table = (Table)event.element; refreshConnectedParts(table, foreignKeys); refreshTablesStubs(); } } } public void register() { getDiagram().addPropertyListener(this); RMBenchPlugin.getEventManager().addListener( TABLE_ADDED | TABLE_DELETED | FOREIGNKEY_ADDED | FOREIGNKEY_DELETED, this); } public void unregister() { getDiagram().removePropertyListener(this); super.unregister(); } } private LayoutManager layoutManager = new FreeformLayout(); private Listener listener = new Listener(); public void activate() { getDiagram().updateTables(); super.activate(); listener.register(); } public void deactivate() { listener.unregister(); } /** * @return the schema model object */ public Diagram getDiagram() { return (Diagram)getModel(); } protected List<?> getModelChildren() { getDiagram().updateTables(); List<AbstractDTable> list = new ArrayList<AbstractDTable>(); list.addAll(getDiagram().getDTables()); list.addAll(getDiagram().getTableStubs()); return list; } @SuppressWarnings("rawtypes") public Object getAdapter(Class adapter) { if (adapter == SnapToHelper.class) { Boolean val = (Boolean)getViewer().getProperty(SnapToGrid.PROPERTY_GRID_ENABLED); if (val != null && val.booleanValue()) return new SnapToGrid(this); } else if (adapter == IPropertySource.class) return new DiagramPropertySource(getDiagram()); return super.getAdapter(adapter); } //@see org.eclipse.gef.editparts.AbstractGraphicalEditPart#createFigure() protected IFigure createFigure() { Figure figure = new FreeformLayer(); figure.setLayoutManager(layoutManager ); figure.setOpaque(false); return figure; } //@see org.eclipse.gef.editparts.AbstractEditPart#createEditPolicies() protected void createEditPolicies() { installEditPolicy(EditPolicy.NODE_ROLE, null); installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, null); installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, null); installEditPolicy(EditPolicy.COMPONENT_ROLE, new RootComponentEditPolicy()); installEditPolicy(EditPolicy.CONTAINER_ROLE, new DiagramContainerEditPolicy()); installEditPolicy(EditPolicy.LAYOUT_ROLE, new DiagramXYLayoutEditPolicy()); installEditPolicy("Snap Feedback", new SnapFeedbackPolicy()); //$NON-NLS-1$ } /** * add a child edit part to represent the given table object * * @param dtable the table model object * @return the edit part representing the child */ public AbstractTableEditPart addChild(AbstractDTable dtable) { AbstractTableEditPart tablePart = (AbstractTableEditPart)createChild(dtable); int modelIndex = getModelChildren().indexOf(dtable); addChild(tablePart, modelIndex); return tablePart; } protected void addChild(EditPart childEditPart, int index) { super.addChild(childEditPart, index); if(childEditPart instanceof TableEditPart) { AbstractTableEditPart tablePart = (AbstractTableEditPart)childEditPart; tablePart.updateLocation(); } } /** * remove the child edit part representing the given table object * * @param dtable the table model object whose edit part is to be removed */ public void removeChild(DTable dtable) { EditPart part = (EditPart)getViewer().getEditPartRegistry().get(dtable.getTable()); if (part == null) throw new IllegalArgumentException("unknown table"); removeChild(part); } protected TableEditPart getTableEditPart(Table table) { return (TableEditPart) getViewer().getEditPartRegistry().get(table); } private void refreshReferences(DTable dtable) { //refeshing table stubs EditPart otherpart = (EditPart) getViewer().getEditPartRegistry().get( getDiagram().getTableStub(dtable)); if (otherpart != null) otherpart.refresh(); for (Iterator<DForeignKey> it = dtable.getReferences().iterator(); it.hasNext();) { ForeignKey foreignKey = it.next().getForeignKey(); otherpart = (EditPart) getViewer().getEditPartRegistry().get(foreignKey.getTable()); if (otherpart!=null) otherpart.refresh(); } } private void refreshForeignKeys(DTable dtable) { //refeshing table stubs EditPart otherpart = (EditPart) getViewer().getEditPartRegistry().get( getDiagram().getTableStub(dtable)); if (otherpart!=null) otherpart.refresh(); for (Iterator<DForeignKey> it = dtable.getForeignKeys().iterator(); it.hasNext();) { ForeignKey foreignKey = it.next().getForeignKey(); otherpart = (EditPart) getViewer().getEditPartRegistry().get( foreignKey.getTargetTable()); if (otherpart!=null) otherpart.refresh(); } } /** * refresh all parts representing tables that are connected with a given table through * given foreign keys */ private void refreshConnectedParts(Table table, ForeignKey[] foreignKeys) { for (int i = 0; i < foreignKeys.length; i++) { if(foreignKeys[i].getTable() == table) { TableEditPart connectedPart = (TableEditPart) getViewer().getEditPartRegistry().get(foreignKeys[i].getTargetTable()); if(connectedPart != null) connectedPart.refresh(); } else { AbstractTableEditPart connectedPart = (AbstractTableEditPart) getViewer().getEditPartRegistry().get(foreignKeys[i].getTable()); if(connectedPart != null) connectedPart.refresh(); } } } public void ignoreDiagramEvents() { getDiagram().removePropertyListener(listener); } public void watchDiagramEvents() { getDiagram().addPropertyListener(listener); } public void refreshTablesStubs() { ArrayList<EditPart> trash = new ArrayList<EditPart>(); Map<Object, EditPart> modelToEditPart = new HashMap<Object, EditPart>(); //fill HashMap with EditParts for faster checks for (Iterator<?> it=getChildren().iterator(); it.hasNext();) { EditPart tmpPart = (EditPart)it.next(); if (tmpPart instanceof TableStubEditPart) modelToEditPart.put(tmpPart.getModel(), tmpPart); } //adding new edit part if needed for (Iterator<?> it=getModelChildren().iterator(); it.hasNext();) { AbstractDTable dTable = (AbstractDTable) it.next(); if (dTable instanceof DTableStub) { EditPart tmpPart = (EditPart) modelToEditPart.get(dTable); if (tmpPart == null) addChild(dTable); } } //collecting trash StubEditparts for (Iterator<?> it=getChildren().iterator(); it.hasNext();) { EditPart part = (EditPart) it.next(); if (part instanceof TableStubEditPart) { DTableStub tableStub = (DTableStub) part.getModel(); if ((!tableStub.isValid()) || (getDiagram().getDTable(tableStub.getDTable().getTable()) == null)) { trash.add(part); } else { part.refresh(); } } } for(EditPart part : trash) { removeChild(part); } } public ModelExport getModelExport() { return null; } public DiagramExport getDiagramExport() { return this; } /** * @return the combined printale layers for this diagram */ public IFigure getExportFigure() { LayerManager layers = (LayerManager) getViewer().getEditPartRegistry().get(LayerManager.ID); return layers.getLayer(LayerConstants.PRINTABLE_LAYERS); } public IFigure getExportDiagramFigure() { return null; } }
package com.aaronguostudio.handler; import android.annotation.SuppressLint; import android.os.Bundle; import android.os.Handler; import android.os.Message; import android.os.SystemClock; import android.support.v7.app.AppCompatActivity; import android.util.Log; import android.view.View; import android.widget.Button; import android.widget.TextView; public class MainActivity extends AppCompatActivity { private static final String TAG = "MainActivity"; @Override protected void onCreate(Bundle savedInstanceState) { /* * UI Thread * */ super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); final TextView tx = (TextView) findViewById(R.id.textView2); final Button btn = (Button) findViewById(R.id.button2); /* * Create handler * */ @SuppressLint("HandlerLeak") final Handler handler = new Handler() { @Override public void handleMessage(Message msg) { super.handleMessage(msg); /* * Main thread receives msg from the child * */ Log.d(TAG, "handleMessage: " + msg.what); if (msg.what == 1001) { tx.setText("1001"); } if (msg.what == 1002) { tx.setText(msg.arg1 + " " + msg.arg2 + " " + msg.obj); } if (msg.what == 1003) { tx.setText("1003"); } } }; btn.setOnClickListener(new View.OnClickListener() { /* * Operate heavy computing jobs * */ @Override public void onClick(View v) { new Thread(new Runnable() { @Override public void run() { try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } handler.sendEmptyMessage(1001); Message message = Message.obtain(); message.what = 1002; message.arg1 = 1003; message.arg2 = 1004; message.obj = MainActivity.this; handler.sendMessage(message); Message message2 = Message.obtain(); message2.what = 1001; handler.sendMessageAtTime(message2, SystemClock.uptimeMillis() + 3000); handler.sendEmptyMessageDelayed(Message.obtain().what = 1003, 5000); // final Runnable runnable = new Runnable() { // @Override // public void run() { // // // } // }; // // handler.post(runnable); // runnable.run(); } }).start(); } }); // handler.sendEmptyMessage(1001); } }
package com.runningphotos.ui; import com.runningphotos.bom.User; import com.runningphotos.dao.UserDao; import com.runningphotos.service.MailSenderService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.ApplicationContext; import org.springframework.context.MessageSource; import org.springframework.context.support.ClassPathXmlApplicationContext; import org.springframework.stereotype.Controller; import org.springframework.validation.BindingResult; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.servlet.ModelAndView; import javax.servlet.http.HttpServletRequest; import java.util.List; import java.util.Locale; import java.util.Random; /** * Created by Tensa on 06.02.2016. */ @Controller public class ForgotPasswordController { @Autowired private MessageSource messageSource; @Autowired UserDao userDao; @Autowired private MailSenderService mailSenderService; @RequestMapping(value = "/forgotPassword",method = RequestMethod.GET) public ModelAndView getForgotPassword() { ModelAndView model = new ModelAndView("/forgotPassword"); model.addObject("user",new User()); return model; } @RequestMapping(value = "/forgotPassword", method = RequestMethod.POST) public ModelAndView passwordRecovery(User user, Locale locale) { ModelAndView model = new ModelAndView("/forgotPassword"); user=userDao.selectByMail(user); if(user==null) { model.addObject("notFoundMessage", messageSource.getMessage("forgotPassword.userNotFound", null, locale)); return model; } String password = generateNewPassword(); String mailHello =messageSource.getMessage("forgotPassword.hello", null, locale); String mailText =messageSource.getMessage("forgotPassword.mailText", null, locale); mailSenderService.sendMail("RunSnapShot", user.getMail(), mailHello+user.getLogin(), mailText+" "+password); user.setPassword(password); userDao.update(user); model.addObject("successfulMessage", messageSource.getMessage("forgotPassword.successful", null, locale)); return model; } private String generateNewPassword(){ char[] m = new char[26]; String password=""; for (int i=0; i< 26; i++) { m[i] = (char)('a' + i); } Random random = new Random(); for(int j=0;j<9;j++){ password+=m[random.nextInt(26)]; } return password; } }
/* * 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.anjar.random; import java.util.ArrayList; /** * * @author Anjar_Ibnu */ public class TestRandom { public static void main(String args[]) { Data data1 = new Data(15, 3, 5, (int)Math.pow(2, 4)); int [] hasil = getRandomSequence(data1); for(int ii=0; ii<hasil.length; ii++) { System.out.println(hasil[ii]); } } public static void cekCounterData(int [] countData) { for(int ii=0; ii<countData.length; ii++) { System.out.print(countData[ii] + ", "); } } public static void cekRandomOnCounter(Data data, int[] counter) { Random random = new Random(data); System.out.println("====HASIL_RANDOM===="); for(int ii=0; ii<counter.length; ii++) { counter[data.getSeed()]++; System.out.print(random.getRandom() + ", "); } System.out.println("=========="); } public static int [] getRandomSequence(Data data) { int [] result = new int[data.getBatas()]; Random rand = new Random(data); for(int ii=0; ii<result.length ; ii++) { result[ii] = rand.getRandom(); } return result; } }
package com.sfa.vo; public class ChartVo { private String month;// 달 private Long total_sale;// 매출합계 private Long total_mile;// 총 주행거리 private Long estimate_distance;//총 예상 주행거리 private Long estimate_sale;// 총 예상 매출액 private String id;//아이디 private String dept;//부서 public String getMonth() { return month; } public void setMonth(String month) { this.month = month; } public Long getTotal_sale() { return total_sale; } public void setTotal_sale(Long total_sale) { this.total_sale = total_sale; } public Long getTotal_mile() { return total_mile; } public void setTotal_mile(Long total_mile) { this.total_mile = total_mile; } public Long getEstimate_distance() { return estimate_distance; } public void setEstimate_distance(Long estimate_distance) { this.estimate_distance = estimate_distance; } public Long getEstimate_sale() { return estimate_sale; } public void setEstimate_sale(Long estimate_sale) { this.estimate_sale = estimate_sale; } public String getId() { return id; } public void setId(String id) { this.id = id; } public String getDept() { return dept; } public void setDept(String dept) { this.dept = dept; } @Override public String toString() { return "ChartVo [month=" + month + ", total_sale=" + total_sale + ", total_mile=" + total_mile + ", estimate_distance=" + estimate_distance + ", estimate_sale=" + estimate_sale + ", id=" + id + ", dept=" + dept + "]"; } }
package com.pkmnleague.game; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.graphics.OrthographicCamera; import com.badlogic.gdx.graphics.g2d.Batch; import com.badlogic.gdx.maps.tiled.TiledMapRenderer; import com.badlogic.gdx.math.GridPoint2; import com.badlogic.gdx.math.Vector2; import com.badlogic.gdx.math.Vector3; import com.badlogic.gdx.utils.OrderedSet; import java.util.ArrayList; import java.util.Set; public class LevelScreen implements BaseScreen{ private final Level level; private final Cursor cursor; private final MapCamera camera; private GridPoint2 screenTileDimensions; private final GridPoint2 levelTileDimensions; private final int maxCursCamDist = 7; private ActionMenuScreen menu; // TODO: Add player party once persistence is added public LevelScreen(String path){ //Load Map this.level = loadMap(path); this.levelTileDimensions = this.level.getDimensionsInTiles(); //Init Camera this.camera = new MapCamera(); this.screenTileDimensions = this.camera.getScreenTileDimensions(); //Set cursor and location int initialX = this.levelTileDimensions.x/2; int initialY = this.levelTileDimensions.y/2; this.cursor = new Cursor(initialX, initialY); this.placeCameraInLevel(); this.menu = null; } public void clearMenu(){ this.menu = null; } public void makeActionMenu(Pokemon p){ this.menu = new ActionMenuScreen(this, p); } @Override public void render(Batch batch) { camera.update(); this.level.render(batch, this.camera.getOrthoCam(), cursor); this.cursor.draw(batch, 1.0f, this.menu == null); if(this.menu != null){ this.menu.render(batch); } } private Level loadMap(String path){ return new Level(path); } public Level getLevel(){ return this.level; } private void placeCameraInLevel(){ int screenWidthTiles = this.camera.getScreenTileDimensions().x; int screenHeightTiles = this.camera.getScreenTileDimensions().y; int camX = screenWidthTiles/2; int camY = screenHeightTiles/2; //Place camera Vector2 targetCameraPos = new Vector2(16f*camX, 16f*camY); this.camera.moveCameraToPosition(targetCameraPos); } public void handleInput(Set<ControllerValues> input){ if (this.menu != null){ this.menu.handleInput(input); return; } if (input.contains(ControllerValues.UP)) up(); if (input.contains(ControllerValues.DOWN)) down(); if (input.contains(ControllerValues.LEFT)) left(); if (input.contains(ControllerValues.RIGHT)) right(); if (input.contains(ControllerValues.A)) A(); if (input.contains(ControllerValues.B)) B(); } public void A(){ this.mapClick(); } public void B(){ } public void up() { this.mapMove(0,1); } public void down() { this.mapMove(0,-1); } public void right() { this.mapMove(1,0); } public void left() { this.mapMove(-1,0); } /** * Responds to a *request* to change cursor position. If we can't * move the cursor, the request will be ignored * * @param dx - requested change in x axis * @param dy - requested change in y axis **/ public void mapMove(int dx, int dy) { int width = this.screenTileDimensions.x; int height = this.screenTileDimensions.y; // Cursor cant move outside of level if (!(0 <= cursor.X() + dx && cursor.X() + dx < this.levelTileDimensions.x)) return; if (!(0 <= cursor.Y() + dy && cursor.Y() + dy < this.levelTileDimensions.y)) return; GridPoint2 camPos = this.camera.getTargetCameraPositionInTiles(); GridPoint2 screenDim = this.camera.getScreenTileDimensions(); int w2 = screenDim.x/2; int h2 = screenDim.y/2; int cursorCamDistanceX = camPos.x - cursor.X(); // +'ve => cam is right of cursor int cursorCamDistanceY = camPos.y - cursor.Y(); // +'ve => cam is above cursor // "Global" cursor movement on the world map // Everything after cursor.move() is just visual cursor.move(dx, dy); // MOVE RIGHT if(dx > 0){ // Able to scroll if(camPos.x + w2 < this.levelTileDimensions.x && cursorCamDistanceX < -maxCursCamDist){ this.camera.moveCamera(dx,0); } } // MOVE LEFT if(dx < 0){ // Able to scroll if(camPos.x - w2 > 0 && cursorCamDistanceX > maxCursCamDist){ this.camera.moveCamera(dx,0); } } // MOVE UP if(dy > 0){ // Able to scroll if(camPos.y + h2 < this.levelTileDimensions.y && cursorCamDistanceY < -maxCursCamDist){ this.camera.moveCamera(0,dy); } } // MOVE DOWN if(dy < 0){ // Able to scroll if(camPos.y - h2 > 0 && cursorCamDistanceY > maxCursCamDist){ this.camera.moveCamera(0,dy); } } } public void mapClick() { int[] coords = cursor.getPos(); GridPoint2 pos = new GridPoint2(coords[0], coords[1]); int x = coords[0]; int y = coords[1]; MapObject mapObj = level.getObjectAtPosition(pos); if(mapObj != null) { if (cursor.hasSelectedObject()) { if(cursor.getSelectedObject() == mapObj) { Pokemon selPokemon = (Pokemon)cursor.getSelectedObject(); makeActionMenu(selPokemon); //GridPoint2 menuCoords = calcMenuCoords(); //menu = new Menu(this,menuCoords[0],menuCoords[1]); } } else { // Set selected object //Only a pokemon can be a slot 1 selected object if(mapObj instanceof Pokemon) { Pokemon mapPkmn = (Pokemon)mapObj; ArrayList<Tile> movable = level.getMoveableTiles(x,y,mapPkmn); OrderedSet<Tile> movableSet = new OrderedSet<Tile>(); for(Tile t:movable){ movableSet.add(t); } cursor.setSelectedObject(mapPkmn, movable, level.getAttackableTiles(movableSet,2)); } } }else { if(cursor.hasSelectedObject()) { // Nothing on map, but selected object // therefore, move to spot if possible MapObject cursMapObj = cursor.getSelectedObject(); if(cursMapObj instanceof Pokemon) { Tile targetTile = level.getTileAtPosition(pos); Pokemon mapPkmn = (Pokemon)cursMapObj; if(cursor.getMoveableTiles().contains(targetTile)) { makeActionMenu(mapPkmn); //GridPoint2 menuCoords = calcMenuCoords(); //menu = new Menu(this,menuCoords[0],menuCoords[1]); }else { cursor.cancel(); } //log("TOP TILE: Water(" +targetTile.water+"); Foreground("+targetTile.foreground+")" ); } }else { //Nothing on map and nothing selected. Do nothing. } } } public MapObject getCursorMapObj() { return cursor.getSelectedObject(); } public int[] getCursorPosition(){ return this.cursor.getPos(); } /* * Finalizes a move request of the selected pokemon to the * cursor's present position */ public void commitMovePokemon(){ Pokemon p = (Pokemon) cursor.getSelectedObject(); int[] start = p.getPosition(); int[] end = cursor.getPos(); this.level.moveMapObj(p,start[0], start[1], end[0], end[1]); cursor.clearSelectedObject(); } }
class IntegertoRoman { public String intToRoman(int num) { char[] symbols = { 'I', 'V', 'X', 'L', 'C', 'D', 'M' }; int[] values = { 1, 5, 10, 50, 100, 500, 1000 }; StringBuilder roman = new StringBuilder(); int t = num, i = 6, p, k; while (t > 0) { p = t / values[i]; t %= values[i]; while (p-- > 0) { // 当前位转换 roman.append(symbols[i]); } if (i > 1 && i % 2 == 0) { // 在10的倍数位进行特殊值处理 k = t / values[i - 2]; if (k == 4) { roman.append("" + symbols[i - 2] + symbols[i - 1]); t -= 4 * values[i - 2]; } else if (k == 9) { roman.append("" + symbols[i - 2] + symbols[i]); t -= 9 * values[i - 2]; } } i--; } return roman.toString(); } int[] values = {1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1}; String[] symbols = {"M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"}; public String intToRoman_offical(int num) { StringBuilder sb = new StringBuilder(); // Loop through each symbol, stopping if num becomes 0. for (int i = 0; i < values.length && num >= 0; i++) { // Repeat while the current symbol still fits into num. while (values[i] <= num) { num -= values[i]; sb.append(symbols[i]); } } return sb.toString(); } public static void main(String[] args) { IntegertoRoman s = new IntegertoRoman(); int[] nums = { 1, 2, 4, 5, 6, 9, 10, 11, 14, 19, 20, 40, 50, 58, 90, 100, 101, 109, 190, 1000, 1001, 1004, 1044, 1994 }; for (int i : nums) { System.out.println(i + ":" + s.intToRoman(i)); } } }
package models; import java.util.*; import javax.persistence.*; import play.db.jpa.*; @Entity public class Item extends Model { public String name; public String comment; public Item(String name, String comment) { this.name = name; this.comment = comment; } }
package com.example.thirdsdk; import com.iflytek.cloud.ErrorCode; import com.iflytek.cloud.InitListener; import com.iflytek.cloud.SpeechConstant; import com.iflytek.cloud.SpeechError; import com.iflytek.cloud.SpeechSynthesizer; import com.iflytek.cloud.SynthesizerListener; import android.app.AlertDialog; import android.content.DialogInterface; import android.content.Intent; import android.content.SharedPreferences; import android.os.Bundle; import android.os.Environment; import android.support.v7.app.AppCompatActivity; import android.util.Log; import android.view.View; import android.view.View.OnClickListener; import android.widget.EditText; import android.widget.TextView; import android.widget.Toast; /** * Created by ouyangshen on 2017/12/18. */ public class VoiceComposeActivity extends AppCompatActivity implements OnClickListener { private final static String TAG = VoiceComposeActivity.class.getSimpleName(); // 语音合成对象 private SpeechSynthesizer mCompose; // 默认发音人 private String voicer = "xiaoyan"; private String[] mCloudVoicersEntries; private String[] mCloudVoicersValue; private EditText et_compose_text; private TextView tv_spinner; private SharedPreferences mSharedPreferences; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_voice_compose); et_compose_text = findViewById(R.id.et_compose_text); tv_spinner = findViewById(R.id.tv_spinner); tv_spinner.setOnClickListener(this); findViewById(R.id.btn_compose_play).setOnClickListener(this); findViewById(R.id.btn_compose_cancel).setOnClickListener(this); findViewById(R.id.btn_compose_pause).setOnClickListener(this); findViewById(R.id.btn_compose_resume).setOnClickListener(this); findViewById(R.id.btn_compose_setting).setOnClickListener(this); mSharedPreferences = getSharedPreferences(VoiceSettingsActivity.PREFER_NAME, MODE_PRIVATE); // 初始化合成对象 mCompose = SpeechSynthesizer.createSynthesizer(this, mComposeInitListener); // 云端发音人名称列表 mCloudVoicersEntries = getResources().getStringArray(R.array.voicer_cloud_entries); mCloudVoicersValue = getResources().getStringArray(R.array.voicer_cloud_values); tv_spinner.setText(mCloudVoicersEntries[0]); } @Override protected void onDestroy() { super.onDestroy(); // 退出时释放连接 mCompose.stopSpeaking(); mCompose.destroy(); } @Override public void onClick(View v) { if (v.getId() == R.id.btn_compose_setting) { Intent intent = new Intent(this, VoiceSettingsActivity.class); intent.putExtra("type", VoiceSettingsActivity.XF_COMPOSE); startActivity(intent); } else if (v.getId() == R.id.btn_compose_play) { // 开始合成 // 收到onCompleted 回调时,合成结束、生成合成音频。合成的音频格式:只支持pcm格式 String text = et_compose_text.getText().toString(); // 设置参数 setParam(); int code = mCompose.startSpeaking(text, mComposeListener); if (code != ErrorCode.SUCCESS) { showTip("语音合成失败,错误码: " + code); } // 只保存音频不进行播放接口,调用此接口请注释startSpeaking接口 // text:要合成的文本,uri:需要保存的音频全路径,listener:回调接口 // String path = getExternalFilesDir(Environment.DIRECTORY_DOWNLOADS).toString()+"/compose.pcm"; // int code = mCompose.synthesizeToUri(text, path, mComposeListener); } else if (v.getId() == R.id.btn_compose_cancel) { // 取消合成 mCompose.stopSpeaking(); } else if (v.getId() == R.id.btn_compose_pause) { // 暂停播放 mCompose.pauseSpeaking(); } else if (v.getId() == R.id.btn_compose_resume) { // 继续播放 mCompose.resumeSpeaking(); } else if (v.getId() == R.id.tv_spinner) { // 选择发音人 showPresonSelectDialog(); } } private int selectedNum = 0; //发音人选择 private void showPresonSelectDialog() { new AlertDialog.Builder(this).setTitle("在线合成发音人选项") .setSingleChoiceItems(mCloudVoicersEntries, // 单选框有几项,各是什么名字 selectedNum, // 默认的选项 new DialogInterface.OnClickListener() { // 点击单选框后的处理 public void onClick(DialogInterface dialog, int which) { // 点击了哪一项 tv_spinner.setText(mCloudVoicersEntries[which]); voicer = mCloudVoicersValue[which]; if ("catherine".equals(voicer) || "henry".equals(voicer) || "vimary".equals(voicer) || "Mariane".equals(voicer) || "Allabent".equals(voicer) || "Gabriela".equals(voicer) || "Abha".equals(voicer) || "XiaoYun".equals(voicer)) { et_compose_text.setText(R.string.compose_source_en); } else { et_compose_text.setText(R.string.compose_source); } selectedNum = which; dialog.dismiss(); } }).show(); } //初始化监听 private InitListener mComposeInitListener = new InitListener() { @Override public void onInit(int code) { Log.d(TAG, "InitListener init() code = " + code); if (code != ErrorCode.SUCCESS) { showTip("初始化失败,错误码:" + code); } else { // 初始化成功,之后可以调用startSpeaking方法 // 注:有的开发者在onCreate方法中创建完合成对象之后马上就调用startSpeaking进行合成, // 正确的做法是将onCreate中的startSpeaking调用移至这里 } } }; //合成回调监听 private SynthesizerListener mComposeListener = new SynthesizerListener() { @Override public void onSpeakBegin() { showTip("开始播放"); } @Override public void onSpeakPaused() { showTip("暂停播放"); } @Override public void onSpeakResumed() { showTip("继续播放"); } @Override public void onBufferProgress(int percent, int beginPos, int endPos, String info) { // 合成进度 } @Override public void onSpeakProgress(int percent, int beginPos, int endPos) { // 播放进度 } @Override public void onCompleted(SpeechError error) { if (error == null) { showTip("播放完成"); } else { showTip(error.getPlainDescription(true)); } } @Override public void onEvent(int eventType, int arg1, int arg2, Bundle obj) { // 以下代码用于获取与云端的会话id,当业务出错时将会话id提供给技术支持人员,可用于查询会话日志,定位出错原因 // 若使用本地能力,会话id为null // if (SpeechEvent.EVENT_SESSION_ID == eventType) { // String sid = obj.getString(SpeechEvent.KEY_EVENT_SESSION_ID); // Log.d(TAG, "session id =" + sid); // } } }; private void showTip(String str) { Toast.makeText(this, str, Toast.LENGTH_LONG).show(); } // 参数设置 private void setParam() { // 清空参数 mCompose.setParameter(SpeechConstant.PARAMS, null); // 根据合成引擎设置相应参数 mCompose.setParameter(SpeechConstant.ENGINE_TYPE, SpeechConstant.TYPE_CLOUD); // 设置在线合成发音人 mCompose.setParameter(SpeechConstant.VOICE_NAME, voicer); // 设置合成语速 mCompose.setParameter(SpeechConstant.SPEED, mSharedPreferences.getString("speed_preference", "50")); // 设置合成音调 mCompose.setParameter(SpeechConstant.PITCH, mSharedPreferences.getString("pitch_preference", "50")); // 设置合成音量 mCompose.setParameter(SpeechConstant.VOLUME, mSharedPreferences.getString("volume_preference", "50")); // 设置播放器音频流类型 mCompose.setParameter(SpeechConstant.STREAM_TYPE, mSharedPreferences.getString("stream_preference", "3")); // 设置播放合成音频打断音乐播放,默认为true mCompose.setParameter(SpeechConstant.KEY_REQUEST_FOCUS, "true"); // 设置音频保存路径,保存音频格式支持pcm、wav,设置路径为sd卡请注意WRITE_EXTERNAL_STORAGE权限 // 注:AUDIO_FORMAT参数语记需要更新版本才能生效 mCompose.setParameter(SpeechConstant.AUDIO_FORMAT, "wav"); mCompose.setParameter(SpeechConstant.TTS_AUDIO_PATH, getExternalFilesDir(Environment.DIRECTORY_DOWNLOADS).toString() + "/msc/compose.wav"); } }
/* * Name: Đặng Huy Hoàng * Class: DH12DT */ public class TokenJava { private int count = -1; private String data; private String charc; private String[] array; public TokenJava(String data, String charc) { this.data = data; this.charc = charc; array = data.split(charc); } public boolean hasMoreToken() { return this.count < this.array.length-1; } public String nextToken() { if (this.hasMoreToken()) { this.count +=1; return this.array[this.count]; } return ""; } public static void main(String[] args) { String a = "Dai Hoc Nong Lam TP.HCM"; String b = "Hoc"; TokenJava token = new TokenJava(a, b); while(token.hasMoreToken()){ System.out.println(token.nextToken()); } } }
package com.szcinda.express.persistence; import com.szcinda.express.BaseEntity; import lombok.Data; import lombok.EqualsAndHashCode; import javax.persistence.Entity; @EqualsAndHashCode(callSuper = true) @Data @Entity public class Client extends BaseEntity { private String name; private String nickName; private String email; }
package it.unical.asd.group6.computerSparePartsCompany.data.dto; import java.io.Serializable; import java.time.LocalDate; public class JobRequestDTO implements Serializable { private Long ID; private String title; private String position; private String email; private String description; private String username; public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } private LocalDate localDate; public Long getID() { return ID; } public void setID(Long ID) { this.ID = ID; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getPosition() { return position; } public void setPosition(String position) { this.position = position; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public LocalDate getLocalDate() { return localDate; } public void setLocalDate(LocalDate localDate) { this.localDate = localDate; } public JobRequestDTO(Long ID, String title, String position, String email, String description, LocalDate localDate) { this.ID = ID; this.title = title; this.position = position; this.email = email; this.description = description; this.localDate = localDate; } public JobRequestDTO(){} }
package com.app.bowlingscorer.data.model.entity; /** * Created by a.hegazy on 18/4/2018. */ public class Scores { }
package com.kzw.leisure.widgets; import android.content.Context; import android.util.AttributeSet; import android.view.LayoutInflater; import android.view.View; import android.widget.FrameLayout; import android.widget.LinearLayout; import android.widget.TextView; import com.kzw.leisure.R; import com.kzw.leisure.utils.theme.ATH; import com.kzw.leisure.widgets.pageView.ReadBookControl; import androidx.annotation.NonNull; import androidx.appcompat.app.AlertDialog; import butterknife.BindView; import butterknife.ButterKnife; import butterknife.OnClick; /** * author: kang4 * Date: 2019/12/13 * Description: */ public class SettingMenu extends FrameLayout { @BindView(R.id.vw_bg) View vwBg; @BindView(R.id.tv_screen_direction) TextView tvScreenDirection; @BindView(R.id.ll_screen_direction) LinearLayout llScreenDirection; @BindView(R.id.tv_screen_time_out) TextView tvScreenTimeOut; @BindView(R.id.llScreenTimeOut) LinearLayout llScreenTimeOut; @BindView(R.id.tvJFConvert) TextView tvJFConvert; @BindView(R.id.llJFConvert) LinearLayout llJFConvert; private Context context; private ReadBookControl readBookControl = ReadBookControl.getInstance(); private Callback callback; public SettingMenu(Context context) { super(context); this.context = context; init(context); } public SettingMenu(Context context, AttributeSet attrs) { super(context, attrs); this.context = context; init(context); } public SettingMenu(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); this.context = context; init(context); } private void init(Context context) { View view = LayoutInflater.from(context).inflate(R.layout.setting_menu_layout, this); ButterKnife.bind(this, view); initData(); } public void setListener(@NonNull Callback callback) { this.callback = callback; } private void initData() { upScreenDirection(readBookControl.getScreenDirection()); upScreenTimeOut(readBookControl.getScreenTimeOut()); upFConvert(readBookControl.getTextConvert()); } private void upScreenDirection(int screenDirection) { String[] screenDirectionListTitle = context.getResources().getStringArray(R.array.screen_direction_list_title); if (screenDirection >= screenDirectionListTitle.length) { tvScreenDirection.setText(screenDirectionListTitle[0]); } else { tvScreenDirection.setText(screenDirectionListTitle[screenDirection]); } } private void upScreenTimeOut(int screenTimeOut) { tvScreenTimeOut.setText(context.getResources().getStringArray(R.array.screen_time_out)[screenTimeOut]); } private void upFConvert(int fConvert) { tvJFConvert.setText(context.getResources().getStringArray(R.array.convert_s)[fConvert]); } @OnClick({R.id.ll_screen_direction, R.id.llScreenTimeOut, R.id.llJFConvert}) public void onViewClicked(View view) { switch (view.getId()) { case R.id.ll_screen_direction: AlertDialog dialog = new AlertDialog.Builder(context) .setTitle(context.getString(R.string.screen_direction)) .setSingleChoiceItems(context.getResources().getStringArray(R.array.screen_direction_list_title), readBookControl.getScreenDirection(), (dialogInterface, i) -> { readBookControl.setScreenDirection(i); upScreenDirection(i); dialogInterface.dismiss(); callback.recreate(); }) .create(); dialog.show(); ATH.setAlertDialogTint(dialog); break; case R.id.llScreenTimeOut: AlertDialog screenDialog = new AlertDialog.Builder(context) .setTitle(context.getString(R.string.keep_light)) .setSingleChoiceItems(context.getResources().getStringArray(R.array.screen_time_out), readBookControl.getScreenTimeOut(), (dialogInterface, i) -> { readBookControl.setScreenTimeOut(i); upScreenTimeOut(i); callback.keepScreenOnChange(i); dialogInterface.dismiss(); }) .create(); screenDialog.show(); ATH.setAlertDialogTint(screenDialog); break; case R.id.llJFConvert: AlertDialog simToTranDialog = new AlertDialog.Builder(context) .setTitle(context.getString(R.string.jf_convert)) .setSingleChoiceItems(context.getResources().getStringArray(R.array.convert_s), readBookControl.getTextConvert(), (dialogInterface, i) -> { readBookControl.setTextConvert(i); upFConvert(i); dialogInterface.dismiss(); callback.refreshPage(); }) .create(); simToTranDialog.show(); ATH.setAlertDialogTint(simToTranDialog); break; } } public interface Callback { void upBar(); void keepScreenOnChange(int keepScreenOn); void recreate(); void refreshPage(); } }
package cn.uway.pool; import java.util.HashMap; import java.util.List; import java.util.Map; import org.apache.commons.net.ftp.FTPClient; import cn.uway.framework.connection.Device; import cn.uway.framework.connection.FTPConnectionInfo; import cn.uway.framework.connection.pool.ftp.FTPClientPool; import cn.uway.framework.connection.pool.ftp.BasicFTPClientPool; import cn.uway.task.FtpInfo; public class FTPPoolManager implements PoolManager{ private Map<String,FTPClientPool> ftpPoolMap = new HashMap<String,FTPClientPool>(); public FTPPoolManager(){} public FTPPoolManager(List<FtpInfo> ftpList) throws Exception{ for(FtpInfo info : ftpList){ addPool(info); } } public synchronized FTPClient getFTPClient(String ftpId) throws Exception{ FTPClientPool ftpClientPool = ftpPoolMap.get(ftpId); if(ftpClientPool == null){ return null; } return ftpClientPool.getFTPClient(); } public void addPool(FtpInfo ftpInfo) throws Exception{ if(ftpPoolMap.get(ftpInfo.getId()) != null){ return; } FTPConnectionInfo info = convertInfo(ftpInfo); FTPClientPool pool = new BasicFTPClientPool(info); ftpPoolMap.put(ftpInfo.getId(), pool); } private FTPConnectionInfo convertInfo(FtpInfo ftpInfo){ FTPConnectionInfo info = new FTPConnectionInfo(); info.setCharset(ftpInfo.getCharset()); Device device = new Device(); device.setIp(ftpInfo.getIp()); info.setDevice(device); info.setUserName(ftpInfo.getUsername()); info.setUserPwd(ftpInfo.getPassword()); info.setPort(ftpInfo.getPort()); info.setMaxActive(ftpInfo.getMaxConnections()); info.setMaxWait(ftpInfo.getMaxWaitSecond()); info.setPassiveFlag(ftpInfo.getPassiveFlag()); info.setValidateCommand(ftpInfo.getValidateCmd()); return info; } // public static void main(String [] args) throws Exception{ // LogMgr.getInstance(); // FtpInfo ftpInfo = new FtpInfo(); // ftpInfo.setPort(21); // ftpInfo.setId("hw"); // ftpInfo.setIp("192.168.15.223"); // ftpInfo.setUsername("rd"); // ftpInfo.setPassword("uway_rd_good"); // // ftpInfo.setUsername("anonymous"); // // ftpInfo.setPassword(""); // ftpInfo.setValidateCmd("pwd"); // ftpInfo.setMaxConnections(4); // ftpInfo.setMaxWaitSecond(15); // ftpInfo.setPassiveFlag(true); // FTPPoolManager pools = new FTPPoolManager(); // pools.addPool(ftpInfo); // // FTPClient ftp = pools.getFTPClient("hw"); // String charset = FTPUtil.autoSetCharset(ftp); // System.out.println("auto set Charset:" + charset); // FTPFile [] listFiles = ftp // .listFiles(StringUtil // .encodeFTPPath( // "/ftp/lte/unicome/华为/北京-性能/neexport_20140526/FBJ900001/A20140526.0215+0800-0230+0800_FBJ900001.xml.gz", // charset)); // for(int i = 0; i < listFiles.length; i++){ // System.out.println(StringUtil.decodeFTPPath(listFiles[i].getName(), charset)); // } //// InputStream in = ftp.retrieveFileStream(StringUtil.encodeFTPPath("/ftp/lte/unicome/华为/北京-性能/neexport_20140526/FBJ900001/A20140526.0215+0800-0230+0800_FBJ900001.xml.gz", charset)); // InputStream in = ftp.retrieveFileStream("/ftp/lte/unicome/华为/北京-性能/neexport_20140526/FBJ900001/A20140526.0215+0800-0230+0800_FBJ900001.xml.gz"); // ftp.disconnect(); // } }
package prova; import java.util.logging.Logger; public class Main { public static void main(String[] args) { Logger logger = Logger.getLogger(Main.class.getName()); logger.log("Hello World"); } }
package com.samyotech.laundry.ui.activity; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.util.Log; import android.view.View; import android.view.Window; import android.view.WindowManager; import androidx.appcompat.app.AppCompatActivity; import androidx.core.content.ContextCompat; import androidx.databinding.DataBindingUtil; import com.google.android.material.snackbar.Snackbar; import com.samyotech.laundry.R; import com.samyotech.laundry.databinding.ActivityForgotPasswordBinding; import com.samyotech.laundry.https.HttpsRequest; import com.samyotech.laundry.interfaces.Consts; import com.samyotech.laundry.interfaces.Helper; import com.samyotech.laundry.network.NetworkManager; import com.samyotech.laundry.utils.ProjectUtils; import org.json.JSONObject; import java.util.HashMap; public class ForgotPassword extends AppCompatActivity implements View.OnClickListener { private final String TAG = ForgotPassword.class.getSimpleName(); Context mContext; ActivityForgotPasswordBinding binding; boolean doubleClick = true; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Window w = getWindow(); w.setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS); mContext = ForgotPassword.this; binding = DataBindingUtil.setContentView(this, R.layout.activity_forgot_password); setUiAction(); } public void setUiAction() { binding.resetBtn.setOnClickListener(this); binding.registerNow.setOnClickListener(this); } @Override public void onClick(View v) { switch (v.getId()) { case R.id.reset_btn: if (doubleClick) clickForSubmit(); break; case R.id.register_now: if (doubleClick) { Intent intent_register_now = new Intent(mContext, Register.class); startActivity(intent_register_now); doubleClick = false; } break; } } public void clickForSubmit() { if (!ProjectUtils.isEmailValid(binding.cetEmailADD.getText().toString().trim())) { showSickbar(getResources().getString(R.string.val_email)); } else { if (NetworkManager.isConnectToInternet(mContext)) { forgetpassword(); } else { ProjectUtils.showToast(mContext, getResources().getString(R.string.internet_concation)); } } } private void forgetpassword() { ProjectUtils.showProgressDialog(mContext, true, getResources().getString(R.string.please_wait)); new HttpsRequest(Consts.FORGOTPASSWORD, getparm(), mContext).stringPost(TAG, new Helper() { @Override public void backResponse(boolean flag, String msg, JSONObject response) { ProjectUtils.pauseProgressDialog(); if (flag) { try { doubleClick = false; ProjectUtils.showToast(mContext, msg); /* Intent in = new Intent(mContext, CheckEmail.class); startActivity(in);*/ finish(); overridePendingTransition(R.anim.anim_slide_in_left, R.anim.anim_slide_out_left); } catch (Exception e) { e.printStackTrace(); } } else { doubleClick = true; ProjectUtils.showToast(mContext, msg); } } }); } public HashMap<String, String> getparm() { HashMap<String, String> parms = new HashMap<>(); parms.put(Consts.EMAIL, ProjectUtils.getEditTextValue(binding.cetEmailADD)); Log.e(TAG + " Forget", parms.toString()); return parms; } public void showSickbar(String msg) { Snackbar snackbar = Snackbar.make(binding.RRsncbarF, msg, Snackbar.LENGTH_LONG); View snackbarView = snackbar.getView(); snackbar.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.black)); snackbarView.setBackgroundColor(ContextCompat.getColor(getApplicationContext(), R.color.white)); snackbar.show(); } }
package com.example.demo.controller; import java.util.Date; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.CrossOrigin; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import com.example.demo.entities.Publication; import com.example.demo.service.IPublicationService; @RestController public class PublicationRestController { @Autowired IPublicationService publicationService; @RequestMapping(value = "/publications", method = RequestMethod.GET) public List<Publication> findPublications() { return publicationService.findAll(); } @GetMapping(value = "/publications/{id}") public Publication findOnePublicationById(@PathVariable Long id) { return publicationService.findPublication(id); } @GetMapping(value = "/publications/search/titre") public List<Publication> findPublicationsByTitre(@RequestParam String titre) { return publicationService.findByTitreStartingWith(titre); } @GetMapping(value = "/publications/search/date") public List<Publication> findPublicationsByDate(@RequestParam Date date) { return publicationService.findByDate(date); } @GetMapping(value = "/publications/search/type") public List<Publication> findPublicationsByType(@RequestParam String type) { return publicationService.findByType(type); } @PostMapping(value = "/publications") public Publication addPublication(@RequestBody Publication publication) { return publicationService.addPublication(publication); } @DeleteMapping(value = "/publications/{id}") public void deletePublication(@PathVariable Long id) { publicationService.deletePublication(id); } @PutMapping(value = "/publications/{id}") public Publication updatePublication(@PathVariable Long id, @RequestBody Publication publication) { publication.setId(id); return publicationService.updatePublication(publication); } }
package com.spark.sqlitedemo_android; /** * @author Spark * @package com.spark.sqlitedemo_android * @fileName StatBean * @date 2018/9/6 * @describe */ public class StatBean { private String name; private String phone; public String getName() { return name; } public void setName(String name) { this.name = name; } public String getPhone() { return phone; } public void setPhone(String phone) { this.phone = phone; } }
package net.iz44kpvp.kitpvp.Comandos; import java.util.ArrayList; import org.bukkit.Bukkit; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; 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.PlayerCommandPreprocessEvent; import org.bukkit.event.player.PlayerInteractEvent; import net.iz44kpvp.kitpvp.Main; import net.iz44kpvp.kitpvp.Sistemas.API; public class ClickTest implements CommandExecutor, Listener { public static ArrayList<String> emclicktest; public static ArrayList<String> fazendoclicktest; static { ClickTest.emclicktest = new ArrayList<String>(); ClickTest.fazendoclicktest = new ArrayList<String>(); } public boolean onCommand(final CommandSender sender, final Command cmd, final String label, final String[] args) { final Player p = (Player) sender; if (!(sender instanceof Player)) { p.sendMessage(API.semconsole); return true; } if (cmd.getName().equalsIgnoreCase("clicktest")) { if (ClickTest.fazendoclicktest.contains(p.getName())) { p.sendMessage(String.valueOf(String.valueOf(API.preffix)) + "§cVoc\u00ea j\u00e1 esta em clicktest"); return true; } ClickTest.fazendoclicktest.add(p.getName()); Bukkit.getScheduler().scheduleSyncDelayedTask(Main.plugin, (Runnable) new Runnable() { @Override public void run() { p.sendMessage(String.valueOf(String.valueOf(API.preffix)) + "§7ClickTest iniciando em §b5§7s"); } }, 0L); Bukkit.getScheduler().scheduleSyncDelayedTask(Main.plugin, (Runnable) new Runnable() { @Override public void run() { p.sendMessage(String.valueOf(String.valueOf(API.preffix)) + "§7ClickTest iniciando em §b4§7s"); } }, 20L); Bukkit.getScheduler().scheduleSyncDelayedTask(Main.plugin, (Runnable) new Runnable() { @Override public void run() { p.sendMessage(String.valueOf(String.valueOf(API.preffix)) + "§7ClickTest iniciando em §b3§7s"); } }, 40L); Bukkit.getScheduler().scheduleSyncDelayedTask(Main.plugin, (Runnable) new Runnable() { @Override public void run() { p.sendMessage(String.valueOf(String.valueOf(API.preffix)) + "§7ClickTest iniciando em §b2§7s"); } }, 60L); Bukkit.getScheduler().scheduleSyncDelayedTask(Main.plugin, (Runnable) new Runnable() { @Override public void run() { p.sendMessage(String.valueOf(String.valueOf(API.preffix)) + "§7ClickTest iniciando em §b1§7s"); } }, 80L); Bukkit.getScheduler().scheduleSyncDelayedTask(Main.plugin, (Runnable) new Runnable() { @Override public void run() { p.sendMessage(String.valueOf(String.valueOf(API.preffix)) + "§7ClickTest iniciado"); ClickTest.emclicktest.add(p.getName()); } }, 100L); Bukkit.getScheduler().scheduleSyncDelayedTask(Main.plugin, (Runnable) new Runnable() { @Override public void run() { if (p.getLevel() >= 200) { Bukkit.broadcast( "§b" + p.getDisplayName() + " §7Pode estar de macro quantidade de clicks no clicktest: §b" + p.getLevel(), "flame.staff"); ClickTest.emclicktest.remove(p.getName()); ClickTest.fazendoclicktest.remove(p.getName()); } p.sendMessage(String.valueOf(String.valueOf(API.preffix)) + "§7ClickTest acabado quantidade de clicks §bABAIXO"); p.sendMessage(String.valueOf(String.valueOf(API.preffix)) + "§7Quantidade de click(s) dado: §b" + p.getLevel()); ClickTest.emclicktest.remove(p.getName()); ClickTest.fazendoclicktest.remove(p.getName()); p.setLevel(0); } }, 250L); } return false; } @EventHandler public void comandos(final PlayerCommandPreprocessEvent e) { final Player p = e.getPlayer(); if (ClickTest.emclicktest.contains(p.getName()) && e.getMessage().startsWith("/")) { e.setCancelled(true); p.sendMessage(String.valueOf(String.valueOf(API.preffix)) + "§7Voc\u00ea n\u00e3o pode digitar comandos quando estiver fazendo clicktest"); } } @EventHandler public void click(final PlayerInteractEvent e) { final Player p = e.getPlayer(); if (ClickTest.emclicktest.contains(p.getName()) && e.getAction() == Action.LEFT_CLICK_AIR) { p.setLevel(p.getLevel() + 1); } } }
package rain.test.study2020.m01.d30; public class MulArray { public static void main(String[] args) { int[][] arr = {{1, 2}, {4, 5}, {6, 3}}; for (int i = 0; i < arr.length; i++) { System.out.println(arr[i][0] + " " + arr[i][1]); } } }
package com.pxene; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import java.io.File; import java.util.List; import java.util.concurrent.BlockingQueue; import java.util.concurrent.Callable; //public class AmaxFileProducer implements Runnable { public class AmaxFileProducer implements Callable<Integer> { private static final Logger loggerProducer = LogManager.getLogger(AmaxFileProducer.class); private BlockingQueue<File> queue; private List<File> files; public AmaxFileProducer(List<File> files, BlockingQueue<File> queue) { this.queue = queue; this.files = files; } // @Override // public void run() { // // try { // for (File file : files) { // queue.put(file); // loggerProducer.info("queue put file is " + file.getName()); // } // // } catch (InterruptedException e) { // loggerProducer.error("producer error is " + e.getMessage()); // } // } @Override public Integer call() throws Exception { try { for (File file : files) { queue.put(file); loggerProducer.info("queue put file is " + file.getName()); } return 1; } catch (InterruptedException e) { loggerProducer.error("producer error is " + e.fillInStackTrace().getMessage()); } return 0; } }
package org.motechproject.server.model; public class SupportCase implements ExtractedMessage{ private String sender ; private String phoneNumber ; private String dateRaisedOn ; private String description; public SupportCase(){ } public SupportCase(String sender, String phoneNumber, String dateRaisedOn, String description) { this.sender = sender; this.phoneNumber = phoneNumber; this.dateRaisedOn = dateRaisedOn; this.description = description; } public String getRaisedBy() { return sender; } public String getPhoneNumber() { return phoneNumber; } public String getDateRaisedOn() { return dateRaisedOn; } public String getDescription() { return description; } public void setSender(String sender) { this.sender = sender; } public void setPhoneNumber(String phoneNumber) { this.phoneNumber = phoneNumber; } public void setDateRaisedOn(String dateRaisedOn) { this.dateRaisedOn = dateRaisedOn; } public void setDescription(String description) { this.description = description; } }
package com.kraken.lightmeup; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.player.PlayerJoinEvent; import org.bukkit.event.player.PlayerMoveEvent; public class LMUListener implements Listener { Main plugin; LightProcessing lp = new LightProcessing(plugin); //Constructor public LMUListener(Main plugin, LightProcessing lp ) { this.plugin = plugin; this.lp = lp; } @EventHandler public void onPlayerJoin(PlayerJoinEvent e) { Player player = e.getPlayer(); String UUIDString = player.getUniqueId().toString(); boolean allowed = plugin.getConfig().getBoolean(UUIDString + ".allowed"); if (allowed) { plugin.playerAllowed(UUIDString, true); } else { plugin.playerAllowed(UUIDString, false); } } @EventHandler public void onPlayerMove(PlayerMoveEvent e) { Player player = e.getPlayer(); Location underfoot = player.getLocation().add(0, -1, 0); if (!underfoot.getBlock().getType().equals(Material.SEA_LANTERN)) { lp.checkBlock(player, underfoot); } } }
package com.kunsoftware.page; import java.util.Enumeration; import java.util.Map; import javax.servlet.http.HttpServletRequest; import org.springframework.ui.ModelMap; import com.kunsoftware.util.WebUtil; public class PageUtil { public static void pageInfo(ModelMap model,PageInfo pageInfo) { model.addAttribute("pageInfo",pageToString(pageInfo)); model.addAttribute("pageParam",getPageParam(pageInfo)); } public static void dialogPageInfo(ModelMap model,PageInfo pageInfo) { model.addAttribute("pageInfo",dialogPageToString(pageInfo)); model.addAttribute("pageParam",getDialogPageParam(pageInfo)); } public static void frontPageInfo(Map model,PageInfo pageInfo) { model.put("pageInfo",frontPageToString(pageInfo)); model.put("pageParam",getPageParam(pageInfo)); } public static void frontPageInfo(ModelMap model,PageInfo pageInfo) { model.addAttribute("pageInfo",frontPageToString(pageInfo)); model.addAttribute("pageParam",getPageParam(pageInfo)); } public static void frontPageInfo2(ModelMap model,PageInfo pageInfo) { model.addAttribute("pageInfo",frontPageToString2(pageInfo)); model.addAttribute("pageParam",getPageParam(pageInfo)); } public static String dialogPageToString(PageInfo pageInfo) { if(pageInfo == null || pageInfo.getTotalPages() <= 1) return "&nbsp;"; String retStr = "<table border=\"0\" cellpadding=\"0\" style=\"padding-left:3px;\" cellspacing=\"0\">\n"; retStr +=" <tr>\n"; retStr +=" <td width=\"12\">\n"; if(pageInfo.getPageNo() == 1) { retStr +="<img src=\""+WebUtil.getContextPath()+"/images/pagination-arrow-first-disabled.gif\" width=\"12\" height=\"12\"/></td>\n"; retStr +=" <td width=\"10\"></td>\n"; retStr +=" <td width=\"8\">\n"; retStr +="<img src=\""+WebUtil.getContextPath()+"/images/pagination-arrow-prev-disabled.gif\" width=\"8\" height=\"12\" /></td>\n"; } else { retStr +="<img class=\"dialogPage\" page=\"1\" type=\"1\" src=\""+WebUtil.getContextPath()+"/images/pagination-arrow-first.gif\" width=\"12\" height=\"12\"/></td>\n"; retStr +=" <td width=\"10\"></td>\n"; retStr +=" <td width=\"8\">\n"; retStr +="<img class=\"dialogPage\" page=\""+(pageInfo.getPageNo() -1)+"\" type=\"2\" src=\""+WebUtil.getContextPath()+"/images/pagination-arrow-prev.gif\" width=\"8\" height=\"12\" /></td>\n"; } retStr +=" <td width=\"10\"></td>\n"; retStr +=" <td class=\"page_span\">共</td>\n"; retStr +=" <td width=\"10\">&nbsp;</td>\n"; retStr +=" <td class=\"page_span\"><a href=\"###\" class=\"dialogPage\" page=\""+pageInfo.getTotalPages()+"\">"+pageInfo.getTotalPages()+"</a></td>\n"; retStr +=" <td width=\"10\">&nbsp;</td>\n"; retStr +=" <td align=\"center\">\n"; if(pageInfo.getPageNo() == pageInfo.getTotalPages()) retStr +="<img src=\""+WebUtil.getContextPath()+"/images/pagination-arrow-next-disabled.gif\" width=\"8\" height=\"12\" /></td>\n"; else { retStr +="<img class=\"dialogPage\" title=\"下一页\" page=\""+(pageInfo.getPageNo() + 1)+"\" type=\"3\" src=\""+WebUtil.getContextPath()+"/images/pagination-arrow-next.gif\" width=\"8\" height=\"12\" /></td>\n"; } retStr +=" </tr>\n"; retStr +="</table>\n"; return retStr; } /** 分页参数 */ @SuppressWarnings("rawtypes") public static String getDialogPageParam(PageInfo pageInfo) { if(pageInfo == null) return ""; HttpServletRequest request = WebUtil.getRequest(); Enumeration paramNames = request.getParameterNames(); String retStr = "<form name=\"dialogPageFrm\" id=\"dialogPageFrm\" method=\"post\" action=\""+request.getContextPath()+"/manager/dialog/list\">"; retStr += "<input type=\"hidden\" id=\"pageNo\" name=\"pageNo\" value=\"" + pageInfo.getPageNo() + "\">"; retStr += "<input type=\"hidden\" id=\"pagesize\" name=\"pagesize\" value=\"" + pageInfo.getPageSize() + "\">"; while(paramNames.hasMoreElements()) { String paramName = (String)paramNames.nextElement(); if(!("pageNo".equals(paramName)||"pagesize".equals(paramName))) { String[] paramValues = request.getParameterValues(paramName); for(int i = 0; i < paramValues.length; i++) { String paramValue = paramValues[i]; retStr += "<input type=\"hidden\" name=\"" + paramName + "\" id=\"" + paramName + "\" value=\"" + paramValue + "\">"; } } } retStr += "</form>"; return retStr; } public static String pageToString(PageInfo pageInfo) { if(pageInfo == null || pageInfo.getTotalPages() <= 1) return "&nbsp;"; String retStr = "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n"; retStr +=" <tr>\n"; retStr +=" <td width=\"12\">\n"; if(pageInfo.getPageNo() == 1) { retStr +="<img src=\""+WebUtil.getContextPath()+"/images/pagination-arrow-first-disabled.gif\" width=\"12\" height=\"12\"/></td>\n"; retStr +=" <td width=\"10\"></td>\n"; retStr +=" <td width=\"8\">\n"; retStr +="<img src=\""+WebUtil.getContextPath()+"/images/pagination-arrow-prev-disabled.gif\" width=\"8\" height=\"12\" /></td>\n"; } else { retStr +="<img class=\"defaultPage\" page=\"1\" type=\"1\" src=\""+WebUtil.getContextPath()+"/images/pagination-arrow-first.gif\" width=\"12\" height=\"12\"/></td>\n"; retStr +=" <td width=\"10\"></td>\n"; retStr +=" <td width=\"8\">\n"; retStr +="<img class=\"defaultPage\" page=\""+(pageInfo.getPageNo() -1)+"\" type=\"2\" src=\""+WebUtil.getContextPath()+"/images/pagination-arrow-prev.gif\" width=\"8\" height=\"12\" /></td>\n"; } retStr +=" <td width=\"10\"></td>\n"; retStr +=" <td><input type=\"text\" class=\"form-control input-sm\" style=\"width:50px\" name=\"cli_page\" value=\""+pageInfo.getPageNo()+"\" id=\"cli_page\"/></td>\n"; retStr +=" <td width=\"10\"></td>\n"; retStr +=" <td class=\"page_span\">共</td>\n"; retStr +=" <td width=\"10\">&nbsp;</td>\n"; retStr +=" <td><a href=\"###\" class=\"defaultPage\" page=\""+pageInfo.getTotalPages()+"\">"+pageInfo.getTotalPages()+"</a></td>\n"; retStr +=" <td width=\"10\">&nbsp;</td>\n"; retStr +=" <td align=\"center\">\n"; if(pageInfo.getPageNo() == pageInfo.getTotalPages()) retStr +="<img src=\""+WebUtil.getContextPath()+"/images/pagination-arrow-next-disabled.gif\" width=\"8\" height=\"12\" /></td>\n"; else { retStr +="<img title=\"下一页\" class=\"defaultPage\" page=\""+(pageInfo.getPageNo() + 1)+"\" src=\""+WebUtil.getContextPath()+"/images/pagination-arrow-next.gif\" width=\"8\" height=\"12\" /></td>\n"; } retStr +=" </tr>\n"; retStr +="</table>\n"; return retStr; } public static String frontPageToString(PageInfo pageInfo) { if(pageInfo == null || pageInfo.getTotalPages() <= 1) return "&nbsp;"; String retStr = ""; retStr +="<ul>"; retStr +="<li class=\"page\" value=\""+pageInfo.getPreviousPageNo()+"\">《</li>"; int currentPage = pageInfo.getPageNo(); int startPage = currentPage - 1; int endPage = currentPage + 1; if(startPage <= 0) { startPage = 1; endPage += 1; } if(endPage >= pageInfo.getTotalPages()) { endPage = pageInfo.getTotalPages(); } if(endPage - startPage == 1) { startPage -=1; if(startPage <= 0) { startPage = 1; } } for(int i = startPage;i <=endPage;i++) { if(i == currentPage) { retStr += "<li class=\"page active\" value=\""+i+"\">"+i+"</li>"; } else { retStr += "<li class=\"page\" value=\""+i+"\">"+i+"</li>"; } } if(pageInfo.getTotalPages() > endPage) { retStr += "<li class=\"end\">.</li>"; } retStr += "<li class=\"page\" value=\""+pageInfo.getNextPageNo()+"\">》</li>"; return retStr; } public static String frontPageToString2(PageInfo pageInfo) { if(pageInfo == null || pageInfo.getTotalPages() <= 1) return "&nbsp;"; String retStr = ""; retStr +="<ul>"; retStr +="<li class=\"page\" value=\""+pageInfo.getPreviousPageNo()+"\">《</li>"; int currentPage = pageInfo.getPageNo(); int startPage = currentPage - 3; int endPage = currentPage + 3; if(startPage <= 0) startPage = 1; if(endPage >= pageInfo.getTotalPages()) endPage = pageInfo.getTotalPages(); for(int i = startPage;i <=endPage;i++) { if(i == currentPage) { retStr += "<li class=\"page active\" value=\""+i+"\">"+i+"</li>"; } else { retStr += "<li class=\"page\" value=\""+i+"\">"+i+"</li>"; } } retStr += "<li class=\"page\" value=\""+pageInfo.getNextPageNo()+"\">》</li>"; return retStr; } /** 分页参数 */ @SuppressWarnings("rawtypes") public static String getPageParam(PageInfo pageInfo) { if(pageInfo == null) return ""; HttpServletRequest request = WebUtil.getRequest(); Enumeration paramNames = request.getParameterNames(); String retStr = "<form name=\"pageFrm\" method=\"post\" action=\""+request.getRequestURI()+"\">"; retStr += "<input type=\"hidden\" name=\"pageNo\" value=\"" + pageInfo.getPageNo() + "\">"; retStr += "<input type=\"hidden\" name=\"pagesize\" value=\"" + pageInfo.getPageSize() + "\">"; while(paramNames.hasMoreElements()) { String paramName = (String)paramNames.nextElement(); if(!("pageNo".equals(paramName)||"pagesize".equals(paramName))) { String[] paramValues = request.getParameterValues(paramName); for(int i = 0; i < paramValues.length; i++) { String paramValue = paramValues[i]; retStr += "<input type=\"hidden\" name=\"" + paramName + "\" value=\"" + paramValue + "\">"; } } } retStr += "</form>"; return retStr; } }
package com.tencent.mm.plugin.appbrand.jsapi.c; import android.content.BroadcastReceiver; import android.content.IntentFilter; import com.tencent.mm.sdk.platformtools.ad; import com.tencent.mm.sdk.platformtools.x; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; public final class a { public static BroadcastReceiver fKZ; public static boolean fLa; public static Map<String, a> map = new ConcurrentHashMap(); public static void a(String str, a aVar) { map.put(str, aVar); if (fKZ == null) { x.i("MicroMsg.BeaconManager", "bluetoothStateListener init"); fKZ = new 1(); ad.getContext().registerReceiver(fKZ, new IntentFilter("android.bluetooth.adapter.action.STATE_CHANGED")); } } public static a tz(String str) { return (a) map.get(str); } public static void remove(String str) { map.remove(str); x.i("MicroMsg.BeaconManager", "remove Beacon appid:%s", new Object[]{str}); if (map.size() == 0 && fKZ != null) { x.i("MicroMsg.BeaconManager", "bluetoothStateListener uninit"); ad.getContext().unregisterReceiver(fKZ); fKZ = null; } } }
package com.huawei.esdk.csdemo.view.panel; import java.awt.Rectangle; import java.util.Vector; import javax.swing.BorderFactory; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JTable; import javax.swing.table.DefaultTableModel; import com.huawei.esdk.csdemo.common.LabelText; import com.huawei.esdk.csdemo.memorydb.DataBase; import com.huawei.esdk.csdemo.view.ScheduleConfFrame; public class SelectSiteListPan extends JPanel { private static final long serialVersionUID = 1L; private Rectangle rectangle; private int xx = 8; private int yy = 20; private JTable siteList = new JTable() { /** * */ private static final long serialVersionUID = 1L; public boolean isCellEditable(int row, int column) { return false; } }; private DefaultTableModel tableMode = new DefaultTableModel(); private JScrollPane jscroll = new JScrollPane(); public SelectSiteListPan(Rectangle rectangle) { this.rectangle = rectangle; this.setLayout(null); } public void repaintCompomentName() { this.setBorder(BorderFactory.createTitledBorder( BorderFactory.createEtchedBorder(), LabelText.site_list[DataBase.getInstance().getLanguageFlag()])); this.setBounds(rectangle); // TPSDKResponseEx<List<SiteInfoEx>> sites = confService.querySitesEx(); // List<SiteInfoEx> siteList = sites.getResult(); // String[] tableTitle = new String[3]; // String[][] tableData = new String[siteList.size()][3]; // tableTitle[0] = "会场URI"; // tableTitle[1] = "会场名称"; // tableTitle[2] = "会场类型"; } public void freshTable(Vector<Vector<String>> vector) { Vector<String> titles = new Vector<String>(); titles.add("URI"); titles.add(LabelText.site_name[DataBase.getInstance().getLanguageFlag()]); titles.add(LabelText.site_type[DataBase.getInstance().getLanguageFlag()]); tableMode.setDataVector(vector, titles); tableMode.fireTableDataChanged(); } public void initCompomentBouds() { jscroll.setBounds(xx, yy, this.rectangle.width - 2 * xx, this.rectangle.height - 2 * yy); } public void addCompomentToPanel() { siteList.setModel(tableMode); tableMode.fireTableDataChanged(); jscroll.add(siteList); jscroll.setViewportView(siteList); this.add(jscroll); } public void repaintComponentVal() { } public void createPanel() { repaintCompomentName(); initCompomentBouds(); addCompomentToPanel(); repaintComponentVal(); } @SuppressWarnings("unchecked") public Vector<Vector<String>> getSelectedData() { int[] rows = siteList.getSelectedRows(); ScheduleConfFrame.selectedSiteIndex = rows; Vector<Vector<String>> vector = tableMode.getDataVector(); Vector<Vector<String>> selectedSites = new Vector<Vector<String>>(); for (int i = 0; i < rows.length; i++) { selectedSites.add(vector.get(rows[i])); } return selectedSites; // scheduleConfFrame.refreshSitesList(selectedSites); } public JTable getSiteList() { return siteList; } }
package com.chuxin.family.gallery; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map.Entry; import java.util.Set; import android.content.Intent; import android.database.Cursor; import android.net.Uri; import android.os.AsyncTask; import android.os.Bundle; import android.provider.MediaStore; import android.text.TextUtils; import android.view.KeyEvent; import android.view.View; import android.view.View.OnClickListener; import android.view.ViewGroup; import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.BaseAdapter; import android.widget.Button; import android.widget.GridView; import android.widget.ImageView; import android.widget.Toast; import com.chuxin.family.app.CxRootActivity; import com.chuxin.family.global.CxGlobalConst; import com.chuxin.family.libs.gpuimage.activity.ActivitySelectPhoto; import com.chuxin.family.neighbour.CxNeighbourAddInvitation; import com.chuxin.family.utils.CxLog; import com.chuxin.family.utils.ToastUtil; import com.chuxin.family.widgets.CxImageView; import com.chuxin.family.zone.CxZoneAddFeed; import com.chuxin.family.R; /** * 系统相册点选多图界面:此界面只负责点选多图,这个界面返回到ActivitySelectPhoto界面 * @author shichao.wang * */ public class CxGalleryGridActivity extends CxRootActivity implements OnItemClickListener, OnClickListener{ GridView mFileGridView; ImageSpecialFolder mFolderImageAdapter; List<String> mImagePath; String mTargetPath; ArrayList<String> mSelected = new ArrayList<String>(); Button mBackBtn, mSubmitBtn; HashMap<String, String> mSelectedImage = new HashMap<String, String>(); int mSelectedNums = 0; @Override protected void onCreate(Bundle arg0) { super.onCreate(arg0); setContentView(R.layout.cx_fa_activity_gallery_images); mFileGridView = (GridView)findViewById(R.id.cx_fa_gallery_image_view); mBackBtn = (Button)findViewById(R.id.cx_fa_activity_title_back); mSubmitBtn = (Button)findViewById(R.id.cx_fa_activity_title_more); mBackBtn.setText(getString(R.string.cx_fa_back_text)); mSubmitBtn.setText(getString(R.string.cx_fa_finish_text)); mSubmitBtn.setVisibility(View.VISIBLE); mBackBtn.setOnClickListener(CxGalleryGridActivity.this); mSubmitBtn.setOnClickListener(CxGalleryGridActivity.this); mTargetPath = getIntent().getStringExtra("dir"); if (TextUtils.isEmpty(mTargetPath)) { CxGalleryGridActivity.this.finish(); return; } // mTargetPath = "file://"+ mTargetPath; mFolderImageAdapter = new ImageSpecialFolder(); mFileGridView.setAdapter(mFolderImageAdapter); new LoadSpeFolderImg().execute(); } @Override public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) { } class LoadSpeFolderImg extends AsyncTask<Object, Integer, Integer>{ @Override protected void onPostExecute(Integer result) { mFolderImageAdapter.notifyDataSetChanged(); super.onPostExecute(result); } @Override protected void onPreExecute() { super.onPreExecute(); } @Override protected Integer doInBackground(Object... params) { // Uri uri = MediaStore.Images.Media.EXTERNAL_CONTENT_URI; String[] projection = { MediaStore.Images.ImageColumns.DATA, }; String selectStr = MediaStore.Images.ImageColumns.BUCKET_DISPLAY_NAME + "='"+mTargetPath+"'"; Cursor cursor = MediaStore.Images.Media.query( CxGalleryGridActivity.this.getContentResolver(), MediaStore.Images.Media.EXTERNAL_CONTENT_URI, projection, selectStr, null, MediaStore.Images.ImageColumns._ID); if (null == cursor) { return null; } mImagePath = new ArrayList<String>(); while(cursor.moveToNext()) { mImagePath.add("file://"+cursor.getString(cursor.getColumnIndex( MediaStore.Images.ImageColumns.DATA))); } try { cursor.close(); } catch (Exception e) { e.printStackTrace(); } //暂时不考虑加载大图的问题了,后续是个优化点 return null; } } class ImageSpecialFolder extends BaseAdapter{ @Override public int getCount() { if (null == mImagePath) { return 0; } return mImagePath.size(); } @Override public Object getItem(int position) { return null; } @Override public long getItemId(int position) { return 0; } @Override public View getView(int position, View convertView, ViewGroup parent) { FolderImageHolder holder = null; if (null == convertView) { convertView = CxGalleryGridActivity.this.getLayoutInflater() .inflate(R.layout.cx_fa_activity_gallery_image_item, null); holder = new FolderImageHolder(); holder.folderImage = (CxImageView)convertView.findViewById(R.id.image_src); holder.selectView = (ImageView)convertView.findViewById(R.id.image_selected); convertView.setTag(holder); }else{ holder = (FolderImageHolder)convertView.getTag(); } final ImageView selectView = holder.selectView; if (mSelected.contains(""+position)) { selectView.setVisibility(View.VISIBLE); }else{ selectView.setVisibility(View.INVISIBLE); } final String positionStr = ""+position; final String positionImag = mImagePath.get(position); CxImageView folderImage = holder.folderImage; folderImage.displayImage(imageLoader, mImagePath.get(position), R.drawable.chatview_imageloading, false, 0); folderImage.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (mSelected.contains(positionStr)) { try { mSelected.remove(positionStr); mSelectedImage.remove(positionStr); mSelectedNums--; if (mSelectedNums < 0) { mSelectedNums = 0; } } catch (Exception e) { e.printStackTrace(); } selectView.setVisibility(View.INVISIBLE); }else{ if (mSelectedNums < 9) { //没有超过9张是正常的 mSelectedNums++; try { mSelected.add(positionStr); mSelectedImage.put(positionStr, positionImag); } catch (Exception e) { e.printStackTrace(); } selectView.setVisibility(View.VISIBLE); }else{ //超过9张就无反应了 // } } } }); return convertView; } } class FolderImageHolder{ ImageView selectView; CxImageView folderImage; } @Override public void onClick(View v) { switch (v.getId()) { case R.id.cx_fa_activity_title_back: Intent backIntent = new Intent(CxGalleryGridActivity.this, CxGalleryActivity.class); startActivity(backIntent); CxGalleryGridActivity.this.finish(); break; case R.id.cx_fa_activity_title_more: // if ((null == mSelected) || (mSelected.size() < 1)){ ToastUtil.getSimpleToast(CxGalleryGridActivity.this, -1, getString(R.string.cx_fa_no_image), Toast.LENGTH_LONG); return; } // ActivitySelectPhoto.multImages = mSelected; //直接跳到目标界面 if (TextUtils.isEmpty(ActivitySelectPhoto.kFrom)) { //程序出问题 CxLog.i("gallery ", " has no target to call"); CxGalleryGridActivity.this.finish(); return; } //需要分添加feed界面与非添加feed界面调用,如果是添加feed界面就以forresult // RkGalleryGridActivity.this.setResult(resultCode, data) //取出已经选中的图片路径 ArrayList<String> selectedImgs = new ArrayList<String>(); try { Iterator<Entry<String, String>> iter = mSelectedImage.entrySet().iterator(); while (iter.hasNext()) { selectedImgs.add(iter.next().getValue()); } } catch (Exception e) { e.printStackTrace(); } String kFrom = ActivitySelectPhoto.kFrom; if (kFrom.equals("RkNeighbourFrament") || kFrom.equals("RkNbOurHome")) { Intent addInvitation = new Intent(CxGalleryGridActivity.this, CxNeighbourAddInvitation.class); addInvitation.putExtra(CxGlobalConst.S_NEIGHBOUR_SHARED_TYPE, 1); addInvitation.putStringArrayListExtra(CxGlobalConst.S_NEIGHBOUR_SHARED_IMAGE, selectedImgs); startActivity(addInvitation); overridePendingTransition(R.anim.tran_next_in, R.anim.tran_next_out); ActivitySelectPhoto.kFrom=""; CxGalleryGridActivity.this.finish(); return; } if(kFrom.equals("RkUserPairZone")){ Intent toAddFeed = new Intent(CxGalleryGridActivity.this, CxZoneAddFeed.class); toAddFeed.putExtra(CxGlobalConst.S_ZONE_SHARED_TYPE, 1); toAddFeed.putStringArrayListExtra(CxGlobalConst.S_ZONE_SHARED_IMAGE, selectedImgs); startActivity(toAddFeed); overridePendingTransition(R.anim.tran_next_in, R.anim.tran_next_out); ActivitySelectPhoto.kFrom=""; CxGalleryGridActivity.this.finish(); return; } break; default: break; } } @Override public boolean onKeyDown(int keyCode, KeyEvent event) { /*if (KeyEvent.KEYCODE_BACK == keyCode) { Intent backIntent = new Intent(RkGalleryGridActivity.this, CxGalleryActivity.class); startActivity(backIntent); return true; }*/ return super.onKeyDown(keyCode, event); } }
package kr.co.sist.mgr.faq.dao; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.util.ArrayList; import java.util.List; import javax.naming.Context; import javax.naming.InitialContext; import javax.naming.NamingException; import javax.sql.DataSource; import kr.co.sist.mgr.faq.vo.MgrReqDetailVO; import kr.co.sist.mgr.faq.vo.MgrReqListVO; import kr.co.sist.mgr.faq.vo.MgrReqReplyVO; import kr.co.sist.mgr.faq.vo.MgrReqVO; /** * 문의사항 목록 조회, 개별 문의사항 디테일 조회, 문의사항 답변 추가, 문의사항 답변 수정, Pagination * @author JU */ public class MgrReqDAO { private static MgrReqDAO mrq_dao; private MgrReqDAO() { } public static MgrReqDAO getInstance() { if(mrq_dao == null) { mrq_dao = new MgrReqDAO(); }//end if return mrq_dao; }//getInstance private Connection getConn() throws SQLException { Connection con = null; try { Context ctx = new InitialContext(); DataSource ds = (DataSource) ctx.lookup("java:comp/env/jdbc/luna_dbcp"); con = ds.getConnection(); } catch (NamingException e) { e.printStackTrace(); }//end catch return con; }//getConn /** * 전체 문의목록 조회 * @return * @throws SQLException */ public List<MgrReqVO> selectSearchReq(MgrReqListVO mrlVO) throws SQLException{ List<MgrReqVO> reqList = new ArrayList<MgrReqVO>(); Connection con = null; PreparedStatement pstmt = null; ResultSet rs = null; try { con = getConn(); StringBuilder selectSearch = new StringBuilder(); selectSearch .append(" select req_num, req_type, req_title, id, req_flag ") .append(" from(select row_number() over(order by req_num desc) r_num, req_num, req_type, req_title, id, req_flag ") .append(" from faq) ") .append(" where r_num between ? and ? "); pstmt = con.prepareStatement(selectSearch.toString()); pstmt.setInt(1, mrlVO.getStartNum()); pstmt.setInt(2, mrlVO.getEndNum()); rs = pstmt.executeQuery(); MgrReqVO mrVO = null; while(rs.next()) { mrVO = new MgrReqVO(rs.getInt("req_num"), rs.getString("req_type"), rs.getString("req_title"), rs.getString("id"), rs.getString("req_flag")); reqList.add(mrVO); }//end while }finally { if( rs != null ) {rs.close();} //end if if( pstmt != null ) {pstmt.close();} //end if if( con != null ) {con.close();} //end if }//end finally return reqList; }//selectSearchReq /** * 개별 문의내역 디테일 조회 * @param reqNum 문의번호 * @return * @throws SQLException */ public MgrReqDetailVO selectReq(int reqNum) throws SQLException { MgrReqDetailVO mrdVO = null; Connection con = null; PreparedStatement pstmt = null; ResultSet rs = null; try { con = getConn(); StringBuilder selectOneReq = new StringBuilder(); selectOneReq .append(" select f.req_type, hm.id, hm.email, hm.phone, f.req_title, f.req_content, fr.reply ") .append(" from faq f, hotel_member hm, faq_reply fr") .append(" where (f.id = hm.id and fr.req_num (+)= f.req_num) and f.req_num=? "); pstmt = con.prepareStatement(selectOneReq.toString()); pstmt.setInt(1, reqNum); rs = pstmt.executeQuery(); if(rs.next()) { mrdVO = new MgrReqDetailVO(rs.getString("req_type"), rs.getString("req_title"), rs.getString("req_content"), rs.getString("id"), rs.getString("email"), rs.getString("phone"), rs.getString("reply")); }//end if }finally { if( rs != null ) {rs.close();} //end if if( pstmt != null ) {pstmt.close();} //end if if( con != null ) {con.close();} //end if }//end finally return mrdVO; }//selectReq /** * 개별 문의내역 답변추가 * @param mrrVO * @throws SQLException */ public void insertReply(MgrReqReplyVO mrrVO) throws SQLException { Connection con = null; PreparedStatement pstmt = null; try { con = getConn(); StringBuilder insertReply = new StringBuilder(); insertReply .append(" insert into faq_reply ") .append(" (req_num, reply) ") .append(" values(?,?) "); pstmt = con.prepareStatement(insertReply.toString()); pstmt.setInt(1, mrrVO.getReqNum()); pstmt.setString(2, mrrVO.getReply()); pstmt.executeUpdate(); pstmt.close(); StringBuilder updateReplyFlag = new StringBuilder(); updateReplyFlag .append(" update faq ") .append(" set req_flag='T' ") .append(" where req_num=? "); pstmt=con.prepareStatement(updateReplyFlag.toString()); pstmt.setInt(1, mrrVO.getReqNum()); pstmt.executeUpdate(); }finally { if( pstmt != null ) {pstmt.close();} //end if if( con != null ) {con.close();} //end if }//end finally }//insertReply /** * 개별 문의내역 답변추가 * @param mrrVO * @throws SQLException */ public void updateReply(MgrReqReplyVO mrrVO) throws SQLException { Connection con = null; PreparedStatement pstmt = null; try { con = getConn(); StringBuilder updateReply = new StringBuilder(); updateReply .append(" update faq_reply ") .append(" set reply=? ") .append(" where req_num=? "); pstmt = con.prepareStatement(updateReply.toString()); pstmt.setString(1, mrrVO.getReply()); pstmt.setInt(2, mrrVO.getReqNum()); pstmt.executeUpdate(); }finally { if( pstmt != null ) {pstmt.close();} //end if if( con != null ) {con.close();} //end if }//end finally }//updateReply /** * 게시물 개수 조회 * @return * @throws SQLException */ public int selectTotalCnt() throws SQLException { int totalCnt = 0; Connection con = null; PreparedStatement pstmt = null; ResultSet rs = null; try { con = getConn(); String selectCnt = "select count(*) cnt from faq"; pstmt = con.prepareStatement(selectCnt); rs = pstmt.executeQuery(); if(rs.next()) { totalCnt = rs.getInt("cnt"); }//end if }finally { if( rs != null ) {rs.close();} //end if if( pstmt != null ) {pstmt.close();} //end if if( con != null ) {con.close();} //end if }//end finally return totalCnt; }//selectTotalCnt }//class
package workstarter.service; import java.util.List; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import workstarter.domain.Company; import workstarter.domain.Jobadvertisment; import workstarter.domain.School; import workstarter.domain.Student; import workstarter.repository.CompanyRepository; import workstarter.repository.JobadvertismentRepository; import workstarter.repository.search.CompanySearchRepository; @Service @Transactional public class CompanyService { private final Logger log = LoggerFactory.getLogger(CompanyService.class); private final CompanyRepository companyRepository; private final JobadvertismentRepository jobadvertismentRepository; private final CompanySearchRepository companySearchRepository; public CompanyService(CompanyRepository companyRepository, JobadvertismentRepository jobadvertismentRepository, CompanySearchRepository companySearchRepository) { this.companyRepository = companyRepository; this.jobadvertismentRepository = jobadvertismentRepository; this.companySearchRepository = companySearchRepository; } public List<Jobadvertisment> getJobs(Long id) { Company company = companyRepository.getOne(id); return company.getJobs(); } public Company addJob(Long id, Jobadvertisment job) { Company company = companyRepository.getOne(id); jobadvertismentRepository.save(job); company.addJob(job); companyRepository.save(company); log.debug("Added jobad for Company: {}", company); return company; } public Company deleteJob(Long id, Long jobid){ Jobadvertisment jobadvertisment = jobadvertismentRepository.getOne(jobid); Company company = companyRepository.getOne(id); company.removeJob(jobadvertisment); companyRepository.save(company); return company; } public Company updateJob(Long companyID, Long jobID, Jobadvertisment jobadvertisment) { Company company = companyRepository.getOne(companyID); Jobadvertisment oldJobadvertisment = jobadvertismentRepository.getOne(jobID); // company.updateJob(oldJobadvertisment, jobadvertisment); oldJobadvertisment.jobname(jobadvertisment.getJobname()); oldJobadvertisment.description(jobadvertisment.getDescription()); oldJobadvertisment.title(jobadvertisment.getTitle()); oldJobadvertisment.exercises(jobadvertisment.getExercises()); oldJobadvertisment.contact(jobadvertisment.getContact()); oldJobadvertisment.location(jobadvertisment.getLocation()); oldJobadvertisment.tasks(jobadvertisment.getTasks()); companyRepository.save(company); log.debug("Updated job for Company: {}", company); return company; } }
package com.example.firebasemessaging.Activity; import android.Manifest; import android.content.Intent; import android.content.pm.PackageManager; import android.net.Uri; import android.os.Bundle; import android.util.Log; import android.view.View; import android.widget.Toast; import androidx.activity.result.ActivityResult; import androidx.activity.result.ActivityResultCallback; import androidx.activity.result.ActivityResultLauncher; import androidx.activity.result.contract.ActivityResultContracts; import androidx.annotation.NonNull; import androidx.appcompat.app.AppCompatActivity; import com.bumptech.glide.Glide; import com.example.firebasemessaging.R; import com.google.android.material.button.MaterialButton; import com.google.android.material.textfield.TextInputEditText; import com.google.firebase.auth.FirebaseAuth; import com.google.firebase.auth.FirebaseUser; import com.google.firebase.auth.UserProfileChangeRequest; import java.util.Objects; import de.hdodenhof.circleimageview.CircleImageView; public class UpdateUserActivity extends AppCompatActivity { private static final int REQUEST_CODE = 12345; TextInputEditText edtUserName; MaterialButton btnUpdate; CircleImageView imgUser; FirebaseAuth firebaseAuth; FirebaseUser user; Uri photoUri; ActivityResultLauncher<Intent> ImageSelectResult = registerForActivityResult(new ActivityResultContracts.StartActivityForResult(), result -> { if (result.getResultCode() == RESULT_OK) { Intent intent = result.getData(); if(intent != null && intent.getData() != null){ photoUri = intent.getData(); Glide.with(UpdateUserActivity.this).load(photoUri).into(imgUser); } } }); @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_update_user); InitComponents(); GetUser(); SetInfoUser(); HandlerEvent(); } private void GetUser() { firebaseAuth = FirebaseAuth.getInstance(); user = firebaseAuth.getCurrentUser(); } private void InitComponents() { edtUserName = findViewById(R.id.edt_username_update); imgUser = findViewById(R.id.img_user_info_update); btnUpdate = findViewById(R.id.btn_confirm_update); } private void SetInfoUser() { if (user == null) { return; } edtUserName.setText(user.getDisplayName()); photoUri = user.getPhotoUrl(); Glide.with(this).load(photoUri).error(R.drawable.ic_launcher_background).into(imgUser); } private void HandlerEvent() { imgUser.setOnClickListener(v -> { if(CheckPermissions()){ OpenGallery(); }else{ RequestPermissions(); } }); btnUpdate.setOnClickListener(v -> HandlerUpdateInfo()); } private void HandlerUpdateInfo() { String username = Objects.requireNonNull(edtUserName.getText()).toString().trim(); if(username.isEmpty()){ Toast.makeText(UpdateUserActivity.this, "Vui lòng nhập đầy đủ thông tin", Toast.LENGTH_SHORT).show(); return; } UserProfileChangeRequest profileUpdates = new UserProfileChangeRequest.Builder() .setDisplayName(username) .setPhotoUri(photoUri) .build(); user.updateProfile(profileUpdates) .addOnCompleteListener(task -> { if(task.isSuccessful()){ Toast.makeText(UpdateUserActivity.this, "Cập nhật thành công", Toast.LENGTH_SHORT).show(); finish(); } else{ Toast.makeText(UpdateUserActivity.this, "Cập nhật thất bại", Toast.LENGTH_SHORT).show(); Log.e("EEE", "Update Failed: " + Objects.requireNonNull(task.getException()).getMessage()); } }); } private boolean CheckPermissions(){ return checkSelfPermission(Manifest.permission.READ_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED; } private void RequestPermissions(){ String[] permissions = {Manifest.permission.READ_EXTERNAL_STORAGE}; requestPermissions(permissions, REQUEST_CODE); } @Override public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { super.onRequestPermissionsResult(requestCode, permissions, grantResults); if(requestCode == REQUEST_CODE && grantResults.length > 0){ if(grantResults[0] == PackageManager.PERMISSION_GRANTED){ OpenGallery(); } } } private void OpenGallery(){ Intent intent = new Intent(); intent.setType("image/*"); intent.setAction(Intent.ACTION_GET_CONTENT); ImageSelectResult.launch(Intent.createChooser(intent, "SELECT A PICTURE")); } }
/* * 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.arpablue.database; import java.util.ArrayList; /** * It class contains all method to execute SQL sentences over the database, * @author Augusto Flores */ public abstract class DbConnector extends DbConnectorBase{ /** * It execute an SQL sentences and return the response. * @param sql */ public abstract ArrayList<String> executeQuery(String sql); /** * It return the columns ofthe last query. * @return */ public abstract ArrayList<String> getColums(); /** * It reurn the description of table. * @param table It is the name of the table to get the description. * @return */ public abstract String getTableDescription(String table); /** * It return the tables of the database. * @return It is the list of the tables in the database. */ public ArrayList<String> getTables(){ ArrayList<String> res = new ArrayList<String>(); executeQuery("SHOW TABLES"); return res; } }
package com.tencent.mm.plugin.account.ui; import android.content.Intent; import android.view.View; import android.view.View.OnClickListener; class i$1 implements OnClickListener { final /* synthetic */ MobileInputUI eSB; final /* synthetic */ i eSC; i$1(i iVar, MobileInputUI mobileInputUI) { this.eSC = iVar; this.eSB = mobileInputUI; } public final void onClick(View view) { this.eSB.eRw[0] = 1; Intent intent = new Intent(); intent.putExtra("from_switch_account", this.eSB.eSf); intent.setClass(this.eSB, LoginUI.class); this.eSB.startActivity(intent); this.eSB.finish(); } }
package test; import org.junit.Test; import util.Key; /** * Created by MarioJ on 08/04/15. */ public class KeyTest { public void generateKeyHashed() { String encoded = Key.encode("55", "3491162895"); String decoded = Key.decode(encoded.getBytes()); String hashed = Key.generate("55", "3491162895"); System.out.println("Original: " + "553491162895"); System.out.println("Encoded: " + encoded); System.out.println("Decoded: " + decoded); System.out.println("Crypt 128 bits: " + hashed); System.out.println("Length " + hashed.length()); } @Test public void generateConfirmCode() { System.out.println(Key.generateConfirmCode()); } }
package com.ybh.front.model; import java.util.Date; public class Admuser { /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.id * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private Integer id; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.superuser * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String superuser; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.password * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String password; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.type1 * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String type1; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.regtime * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private Date regtime; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.lastuse * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private Date lastuse; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.regip * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String regip; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.Mailfrom * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String mailfrom; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.haveupdate * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String haveupdate; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.canmodifyhtml * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String canmodifyhtml; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.canaddmoney * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String canaddmoney; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.candelmoney * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String candelmoney; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.cancheckmoney * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String cancheckmoney; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.cansetserver * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String cansetserver; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.canrebuild * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String canrebuild; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.canmodpass * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String canmodpass; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.canadmuser * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String canadmuser; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.canshowuser * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String canshowuser; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.canuserpass * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String canuserpass; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.candeluser * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String candeluser; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.canmailuser * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String canmailuser; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.canshowpro * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String canshowpro; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.cansetpro * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String cansetpro; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.canadmhost * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String canadmhost; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.canadmhostadd * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String canadmhostadd; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.canadmhostset * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String canadmhostset; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.canadmdomain * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String canadmdomain; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.candomainpay * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String candomainpay; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.candomaindel * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String candomaindel; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.canadmemail * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String canadmemail; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.canadmemailadd * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String canadmemailadd; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.canadmemailset * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String canadmemailset; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.canadmsql * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String canadmsql; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.canadmsqladd * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String canadmsqladd; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.canadmsqlset * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String canadmsqlset; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.cansetnews * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String cansetnews; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.canadmlog * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String canadmlog; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.canagnper * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String canagnper; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.canadmagn * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String canadmagn; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.canshowagn * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String canshowagn; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.canagnpass * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String canagnpass; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.cansetagn * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String cansetagn; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.cansuperuser * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String cansuperuser; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.canadmOther * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String canadmother; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.cansysteminfo * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String cansysteminfo; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.canaws * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String canaws; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.MailfromName * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String mailfromname; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.MailfromPass * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String mailfrompass; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.MailfromServer * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String mailfromserver; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.canmoneyA * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String canmoneya; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.canmoneyB * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String canmoneyb; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.canmoneyC * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String canmoneyc; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.canmoneyD * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String canmoneyd; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.canmoneyE * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String canmoneye; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.canmoneyF * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String canmoneyf; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.canmoneyG * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String canmoneyg; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.canmoneyH * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String canmoneyh; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.canmoneyI * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String canmoneyi; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.canmoneyJ * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String canmoneyj; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.canmoneyK * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String canmoneyk; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.ver * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String ver; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.vertime * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private Date vertime; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.beianfilelen * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private Integer beianfilelen; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.canadmidc * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String canadmidc; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.canadmidcadd * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String canadmidcadd; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.canadmidcset * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String canadmidcset; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.canadmkefu * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String canadmkefu; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.canmodkefu * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String canmodkefu; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.candelkefu * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String candelkefu; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.canchnkefu * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String canchnkefu; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.onlypasusesite * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String onlypasusesite; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.canadmhostch * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String canadmhostch; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.canadmhostmidsub * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String canadmhostmidsub; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.canadmhostmiddomain * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String canadmhostmiddomain; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.canadmhostmidcpu * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String canadmhostmidcpu; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.canadmhostmidrepay * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String canadmhostmidrepay; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.canadmhostdel * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String canadmhostdel; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.canadmhostoth * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String canadmhostoth; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.canadmemailreapy * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String canadmemailreapy; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.canadmemaildel * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String canadmemaildel; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.canadmemailch * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String canadmemailch; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.canadmemailrenow * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String canadmemailrenow; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.canadmemailupdate * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String canadmemailupdate; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.canadmsqlrepay * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String canadmsqlrepay; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.canadmsqldel * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String canadmsqldel; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.canadmsqlch * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String canadmsqlch; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.canadmsqlrenow * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String canadmsqlrenow; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.canadmsqlupdate * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String canadmsqlupdate; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.canadmsqlpau * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String canadmsqlpau; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.canadmhostaddtest * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String canadmhostaddtest; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.canadmvps * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String canadmvps; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.canadmvpsadd * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String canadmvpsadd; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.canadmvpsaddtest * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String canadmvpsaddtest; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.canadmvpsset * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String canadmvpsset; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.canadmvpsch * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String canadmvpsch; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.canadmvpsmidcpu * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String canadmvpsmidcpu; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.canadmvpsmidrepay * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String canadmvpsmidrepay; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.canadmvpsdel * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String canadmvpsdel; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.canadmvpsoth * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String canadmvpsoth; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.upgiflen * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private Integer upgiflen; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.canadmispbeian * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String canadmispbeian; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.canmoneyNew * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String canmoneynew; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.canadmCDN * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String canadmcdn; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.canadmCDNadd * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String canadmcdnadd; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.canadmCDNaddtest * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String canadmcdnaddtest; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.canadmCDNset * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String canadmcdnset; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.canadmCDNch * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String canadmcdnch; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.canadmCDNmidcpu * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String canadmcdnmidcpu; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.canadmCDNmidrepay * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String canadmcdnmidrepay; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.canadmCDNdel * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String canadmcdndel; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.canadmCDNoth * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private String canadmcdnoth; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.emailport * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private Integer emailport; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column FreeHost_Admuser.EnableSsl * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ private Boolean enablessl; /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.id * * @return the value of FreeHost_Admuser.id * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public Integer getId() { return id; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.id * * @param id the value for FreeHost_Admuser.id * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setId(Integer id) { this.id = id; } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.superuser * * @return the value of FreeHost_Admuser.superuser * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getSuperuser() { return superuser; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.superuser * * @param superuser the value for FreeHost_Admuser.superuser * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setSuperuser(String superuser) { this.superuser = superuser == null ? null : superuser.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.password * * @return the value of FreeHost_Admuser.password * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getPassword() { return password; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.password * * @param password the value for FreeHost_Admuser.password * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setPassword(String password) { this.password = password == null ? null : password.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.type1 * * @return the value of FreeHost_Admuser.type1 * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getType1() { return type1; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.type1 * * @param type1 the value for FreeHost_Admuser.type1 * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setType1(String type1) { this.type1 = type1 == null ? null : type1.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.regtime * * @return the value of FreeHost_Admuser.regtime * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public Date getRegtime() { return regtime; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.regtime * * @param regtime the value for FreeHost_Admuser.regtime * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setRegtime(Date regtime) { this.regtime = regtime; } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.lastuse * * @return the value of FreeHost_Admuser.lastuse * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public Date getLastuse() { return lastuse; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.lastuse * * @param lastuse the value for FreeHost_Admuser.lastuse * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setLastuse(Date lastuse) { this.lastuse = lastuse; } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.regip * * @return the value of FreeHost_Admuser.regip * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getRegip() { return regip; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.regip * * @param regip the value for FreeHost_Admuser.regip * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setRegip(String regip) { this.regip = regip == null ? null : regip.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.Mailfrom * * @return the value of FreeHost_Admuser.Mailfrom * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getMailfrom() { return mailfrom; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.Mailfrom * * @param mailfrom the value for FreeHost_Admuser.Mailfrom * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setMailfrom(String mailfrom) { this.mailfrom = mailfrom == null ? null : mailfrom.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.haveupdate * * @return the value of FreeHost_Admuser.haveupdate * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getHaveupdate() { return haveupdate; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.haveupdate * * @param haveupdate the value for FreeHost_Admuser.haveupdate * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setHaveupdate(String haveupdate) { this.haveupdate = haveupdate == null ? null : haveupdate.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.canmodifyhtml * * @return the value of FreeHost_Admuser.canmodifyhtml * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCanmodifyhtml() { return canmodifyhtml; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.canmodifyhtml * * @param canmodifyhtml the value for FreeHost_Admuser.canmodifyhtml * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCanmodifyhtml(String canmodifyhtml) { this.canmodifyhtml = canmodifyhtml == null ? null : canmodifyhtml.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.canaddmoney * * @return the value of FreeHost_Admuser.canaddmoney * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCanaddmoney() { return canaddmoney; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.canaddmoney * * @param canaddmoney the value for FreeHost_Admuser.canaddmoney * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCanaddmoney(String canaddmoney) { this.canaddmoney = canaddmoney == null ? null : canaddmoney.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.candelmoney * * @return the value of FreeHost_Admuser.candelmoney * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCandelmoney() { return candelmoney; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.candelmoney * * @param candelmoney the value for FreeHost_Admuser.candelmoney * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCandelmoney(String candelmoney) { this.candelmoney = candelmoney == null ? null : candelmoney.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.cancheckmoney * * @return the value of FreeHost_Admuser.cancheckmoney * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCancheckmoney() { return cancheckmoney; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.cancheckmoney * * @param cancheckmoney the value for FreeHost_Admuser.cancheckmoney * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCancheckmoney(String cancheckmoney) { this.cancheckmoney = cancheckmoney == null ? null : cancheckmoney.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.cansetserver * * @return the value of FreeHost_Admuser.cansetserver * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCansetserver() { return cansetserver; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.cansetserver * * @param cansetserver the value for FreeHost_Admuser.cansetserver * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCansetserver(String cansetserver) { this.cansetserver = cansetserver == null ? null : cansetserver.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.canrebuild * * @return the value of FreeHost_Admuser.canrebuild * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCanrebuild() { return canrebuild; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.canrebuild * * @param canrebuild the value for FreeHost_Admuser.canrebuild * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCanrebuild(String canrebuild) { this.canrebuild = canrebuild == null ? null : canrebuild.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.canmodpass * * @return the value of FreeHost_Admuser.canmodpass * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCanmodpass() { return canmodpass; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.canmodpass * * @param canmodpass the value for FreeHost_Admuser.canmodpass * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCanmodpass(String canmodpass) { this.canmodpass = canmodpass == null ? null : canmodpass.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.canadmuser * * @return the value of FreeHost_Admuser.canadmuser * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCanadmuser() { return canadmuser; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.canadmuser * * @param canadmuser the value for FreeHost_Admuser.canadmuser * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCanadmuser(String canadmuser) { this.canadmuser = canadmuser == null ? null : canadmuser.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.canshowuser * * @return the value of FreeHost_Admuser.canshowuser * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCanshowuser() { return canshowuser; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.canshowuser * * @param canshowuser the value for FreeHost_Admuser.canshowuser * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCanshowuser(String canshowuser) { this.canshowuser = canshowuser == null ? null : canshowuser.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.canuserpass * * @return the value of FreeHost_Admuser.canuserpass * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCanuserpass() { return canuserpass; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.canuserpass * * @param canuserpass the value for FreeHost_Admuser.canuserpass * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCanuserpass(String canuserpass) { this.canuserpass = canuserpass == null ? null : canuserpass.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.candeluser * * @return the value of FreeHost_Admuser.candeluser * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCandeluser() { return candeluser; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.candeluser * * @param candeluser the value for FreeHost_Admuser.candeluser * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCandeluser(String candeluser) { this.candeluser = candeluser == null ? null : candeluser.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.canmailuser * * @return the value of FreeHost_Admuser.canmailuser * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCanmailuser() { return canmailuser; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.canmailuser * * @param canmailuser the value for FreeHost_Admuser.canmailuser * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCanmailuser(String canmailuser) { this.canmailuser = canmailuser == null ? null : canmailuser.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.canshowpro * * @return the value of FreeHost_Admuser.canshowpro * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCanshowpro() { return canshowpro; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.canshowpro * * @param canshowpro the value for FreeHost_Admuser.canshowpro * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCanshowpro(String canshowpro) { this.canshowpro = canshowpro == null ? null : canshowpro.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.cansetpro * * @return the value of FreeHost_Admuser.cansetpro * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCansetpro() { return cansetpro; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.cansetpro * * @param cansetpro the value for FreeHost_Admuser.cansetpro * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCansetpro(String cansetpro) { this.cansetpro = cansetpro == null ? null : cansetpro.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.canadmhost * * @return the value of FreeHost_Admuser.canadmhost * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCanadmhost() { return canadmhost; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.canadmhost * * @param canadmhost the value for FreeHost_Admuser.canadmhost * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCanadmhost(String canadmhost) { this.canadmhost = canadmhost == null ? null : canadmhost.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.canadmhostadd * * @return the value of FreeHost_Admuser.canadmhostadd * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCanadmhostadd() { return canadmhostadd; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.canadmhostadd * * @param canadmhostadd the value for FreeHost_Admuser.canadmhostadd * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCanadmhostadd(String canadmhostadd) { this.canadmhostadd = canadmhostadd == null ? null : canadmhostadd.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.canadmhostset * * @return the value of FreeHost_Admuser.canadmhostset * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCanadmhostset() { return canadmhostset; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.canadmhostset * * @param canadmhostset the value for FreeHost_Admuser.canadmhostset * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCanadmhostset(String canadmhostset) { this.canadmhostset = canadmhostset == null ? null : canadmhostset.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.canadmdomain * * @return the value of FreeHost_Admuser.canadmdomain * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCanadmdomain() { return canadmdomain; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.canadmdomain * * @param canadmdomain the value for FreeHost_Admuser.canadmdomain * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCanadmdomain(String canadmdomain) { this.canadmdomain = canadmdomain == null ? null : canadmdomain.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.candomainpay * * @return the value of FreeHost_Admuser.candomainpay * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCandomainpay() { return candomainpay; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.candomainpay * * @param candomainpay the value for FreeHost_Admuser.candomainpay * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCandomainpay(String candomainpay) { this.candomainpay = candomainpay == null ? null : candomainpay.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.candomaindel * * @return the value of FreeHost_Admuser.candomaindel * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCandomaindel() { return candomaindel; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.candomaindel * * @param candomaindel the value for FreeHost_Admuser.candomaindel * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCandomaindel(String candomaindel) { this.candomaindel = candomaindel == null ? null : candomaindel.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.canadmemail * * @return the value of FreeHost_Admuser.canadmemail * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCanadmemail() { return canadmemail; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.canadmemail * * @param canadmemail the value for FreeHost_Admuser.canadmemail * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCanadmemail(String canadmemail) { this.canadmemail = canadmemail == null ? null : canadmemail.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.canadmemailadd * * @return the value of FreeHost_Admuser.canadmemailadd * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCanadmemailadd() { return canadmemailadd; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.canadmemailadd * * @param canadmemailadd the value for FreeHost_Admuser.canadmemailadd * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCanadmemailadd(String canadmemailadd) { this.canadmemailadd = canadmemailadd == null ? null : canadmemailadd.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.canadmemailset * * @return the value of FreeHost_Admuser.canadmemailset * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCanadmemailset() { return canadmemailset; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.canadmemailset * * @param canadmemailset the value for FreeHost_Admuser.canadmemailset * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCanadmemailset(String canadmemailset) { this.canadmemailset = canadmemailset == null ? null : canadmemailset.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.canadmsql * * @return the value of FreeHost_Admuser.canadmsql * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCanadmsql() { return canadmsql; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.canadmsql * * @param canadmsql the value for FreeHost_Admuser.canadmsql * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCanadmsql(String canadmsql) { this.canadmsql = canadmsql == null ? null : canadmsql.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.canadmsqladd * * @return the value of FreeHost_Admuser.canadmsqladd * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCanadmsqladd() { return canadmsqladd; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.canadmsqladd * * @param canadmsqladd the value for FreeHost_Admuser.canadmsqladd * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCanadmsqladd(String canadmsqladd) { this.canadmsqladd = canadmsqladd == null ? null : canadmsqladd.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.canadmsqlset * * @return the value of FreeHost_Admuser.canadmsqlset * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCanadmsqlset() { return canadmsqlset; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.canadmsqlset * * @param canadmsqlset the value for FreeHost_Admuser.canadmsqlset * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCanadmsqlset(String canadmsqlset) { this.canadmsqlset = canadmsqlset == null ? null : canadmsqlset.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.cansetnews * * @return the value of FreeHost_Admuser.cansetnews * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCansetnews() { return cansetnews; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.cansetnews * * @param cansetnews the value for FreeHost_Admuser.cansetnews * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCansetnews(String cansetnews) { this.cansetnews = cansetnews == null ? null : cansetnews.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.canadmlog * * @return the value of FreeHost_Admuser.canadmlog * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCanadmlog() { return canadmlog; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.canadmlog * * @param canadmlog the value for FreeHost_Admuser.canadmlog * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCanadmlog(String canadmlog) { this.canadmlog = canadmlog == null ? null : canadmlog.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.canagnper * * @return the value of FreeHost_Admuser.canagnper * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCanagnper() { return canagnper; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.canagnper * * @param canagnper the value for FreeHost_Admuser.canagnper * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCanagnper(String canagnper) { this.canagnper = canagnper == null ? null : canagnper.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.canadmagn * * @return the value of FreeHost_Admuser.canadmagn * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCanadmagn() { return canadmagn; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.canadmagn * * @param canadmagn the value for FreeHost_Admuser.canadmagn * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCanadmagn(String canadmagn) { this.canadmagn = canadmagn == null ? null : canadmagn.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.canshowagn * * @return the value of FreeHost_Admuser.canshowagn * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCanshowagn() { return canshowagn; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.canshowagn * * @param canshowagn the value for FreeHost_Admuser.canshowagn * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCanshowagn(String canshowagn) { this.canshowagn = canshowagn == null ? null : canshowagn.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.canagnpass * * @return the value of FreeHost_Admuser.canagnpass * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCanagnpass() { return canagnpass; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.canagnpass * * @param canagnpass the value for FreeHost_Admuser.canagnpass * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCanagnpass(String canagnpass) { this.canagnpass = canagnpass == null ? null : canagnpass.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.cansetagn * * @return the value of FreeHost_Admuser.cansetagn * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCansetagn() { return cansetagn; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.cansetagn * * @param cansetagn the value for FreeHost_Admuser.cansetagn * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCansetagn(String cansetagn) { this.cansetagn = cansetagn == null ? null : cansetagn.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.cansuperuser * * @return the value of FreeHost_Admuser.cansuperuser * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCansuperuser() { return cansuperuser; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.cansuperuser * * @param cansuperuser the value for FreeHost_Admuser.cansuperuser * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCansuperuser(String cansuperuser) { this.cansuperuser = cansuperuser == null ? null : cansuperuser.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.canadmOther * * @return the value of FreeHost_Admuser.canadmOther * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCanadmother() { return canadmother; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.canadmOther * * @param canadmother the value for FreeHost_Admuser.canadmOther * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCanadmother(String canadmother) { this.canadmother = canadmother == null ? null : canadmother.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.cansysteminfo * * @return the value of FreeHost_Admuser.cansysteminfo * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCansysteminfo() { return cansysteminfo; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.cansysteminfo * * @param cansysteminfo the value for FreeHost_Admuser.cansysteminfo * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCansysteminfo(String cansysteminfo) { this.cansysteminfo = cansysteminfo == null ? null : cansysteminfo.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.canaws * * @return the value of FreeHost_Admuser.canaws * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCanaws() { return canaws; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.canaws * * @param canaws the value for FreeHost_Admuser.canaws * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCanaws(String canaws) { this.canaws = canaws == null ? null : canaws.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.MailfromName * * @return the value of FreeHost_Admuser.MailfromName * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getMailfromname() { return mailfromname; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.MailfromName * * @param mailfromname the value for FreeHost_Admuser.MailfromName * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setMailfromname(String mailfromname) { this.mailfromname = mailfromname == null ? null : mailfromname.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.MailfromPass * * @return the value of FreeHost_Admuser.MailfromPass * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getMailfrompass() { return mailfrompass; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.MailfromPass * * @param mailfrompass the value for FreeHost_Admuser.MailfromPass * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setMailfrompass(String mailfrompass) { this.mailfrompass = mailfrompass == null ? null : mailfrompass.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.MailfromServer * * @return the value of FreeHost_Admuser.MailfromServer * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getMailfromserver() { return mailfromserver; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.MailfromServer * * @param mailfromserver the value for FreeHost_Admuser.MailfromServer * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setMailfromserver(String mailfromserver) { this.mailfromserver = mailfromserver == null ? null : mailfromserver.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.canmoneyA * * @return the value of FreeHost_Admuser.canmoneyA * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCanmoneya() { return canmoneya; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.canmoneyA * * @param canmoneya the value for FreeHost_Admuser.canmoneyA * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCanmoneya(String canmoneya) { this.canmoneya = canmoneya == null ? null : canmoneya.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.canmoneyB * * @return the value of FreeHost_Admuser.canmoneyB * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCanmoneyb() { return canmoneyb; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.canmoneyB * * @param canmoneyb the value for FreeHost_Admuser.canmoneyB * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCanmoneyb(String canmoneyb) { this.canmoneyb = canmoneyb == null ? null : canmoneyb.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.canmoneyC * * @return the value of FreeHost_Admuser.canmoneyC * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCanmoneyc() { return canmoneyc; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.canmoneyC * * @param canmoneyc the value for FreeHost_Admuser.canmoneyC * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCanmoneyc(String canmoneyc) { this.canmoneyc = canmoneyc == null ? null : canmoneyc.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.canmoneyD * * @return the value of FreeHost_Admuser.canmoneyD * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCanmoneyd() { return canmoneyd; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.canmoneyD * * @param canmoneyd the value for FreeHost_Admuser.canmoneyD * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCanmoneyd(String canmoneyd) { this.canmoneyd = canmoneyd == null ? null : canmoneyd.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.canmoneyE * * @return the value of FreeHost_Admuser.canmoneyE * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCanmoneye() { return canmoneye; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.canmoneyE * * @param canmoneye the value for FreeHost_Admuser.canmoneyE * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCanmoneye(String canmoneye) { this.canmoneye = canmoneye == null ? null : canmoneye.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.canmoneyF * * @return the value of FreeHost_Admuser.canmoneyF * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCanmoneyf() { return canmoneyf; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.canmoneyF * * @param canmoneyf the value for FreeHost_Admuser.canmoneyF * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCanmoneyf(String canmoneyf) { this.canmoneyf = canmoneyf == null ? null : canmoneyf.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.canmoneyG * * @return the value of FreeHost_Admuser.canmoneyG * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCanmoneyg() { return canmoneyg; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.canmoneyG * * @param canmoneyg the value for FreeHost_Admuser.canmoneyG * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCanmoneyg(String canmoneyg) { this.canmoneyg = canmoneyg == null ? null : canmoneyg.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.canmoneyH * * @return the value of FreeHost_Admuser.canmoneyH * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCanmoneyh() { return canmoneyh; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.canmoneyH * * @param canmoneyh the value for FreeHost_Admuser.canmoneyH * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCanmoneyh(String canmoneyh) { this.canmoneyh = canmoneyh == null ? null : canmoneyh.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.canmoneyI * * @return the value of FreeHost_Admuser.canmoneyI * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCanmoneyi() { return canmoneyi; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.canmoneyI * * @param canmoneyi the value for FreeHost_Admuser.canmoneyI * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCanmoneyi(String canmoneyi) { this.canmoneyi = canmoneyi == null ? null : canmoneyi.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.canmoneyJ * * @return the value of FreeHost_Admuser.canmoneyJ * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCanmoneyj() { return canmoneyj; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.canmoneyJ * * @param canmoneyj the value for FreeHost_Admuser.canmoneyJ * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCanmoneyj(String canmoneyj) { this.canmoneyj = canmoneyj == null ? null : canmoneyj.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.canmoneyK * * @return the value of FreeHost_Admuser.canmoneyK * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCanmoneyk() { return canmoneyk; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.canmoneyK * * @param canmoneyk the value for FreeHost_Admuser.canmoneyK * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCanmoneyk(String canmoneyk) { this.canmoneyk = canmoneyk == null ? null : canmoneyk.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.ver * * @return the value of FreeHost_Admuser.ver * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getVer() { return ver; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.ver * * @param ver the value for FreeHost_Admuser.ver * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setVer(String ver) { this.ver = ver == null ? null : ver.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.vertime * * @return the value of FreeHost_Admuser.vertime * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public Date getVertime() { return vertime; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.vertime * * @param vertime the value for FreeHost_Admuser.vertime * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setVertime(Date vertime) { this.vertime = vertime; } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.beianfilelen * * @return the value of FreeHost_Admuser.beianfilelen * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public Integer getBeianfilelen() { return beianfilelen; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.beianfilelen * * @param beianfilelen the value for FreeHost_Admuser.beianfilelen * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setBeianfilelen(Integer beianfilelen) { this.beianfilelen = beianfilelen; } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.canadmidc * * @return the value of FreeHost_Admuser.canadmidc * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCanadmidc() { return canadmidc; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.canadmidc * * @param canadmidc the value for FreeHost_Admuser.canadmidc * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCanadmidc(String canadmidc) { this.canadmidc = canadmidc == null ? null : canadmidc.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.canadmidcadd * * @return the value of FreeHost_Admuser.canadmidcadd * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCanadmidcadd() { return canadmidcadd; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.canadmidcadd * * @param canadmidcadd the value for FreeHost_Admuser.canadmidcadd * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCanadmidcadd(String canadmidcadd) { this.canadmidcadd = canadmidcadd == null ? null : canadmidcadd.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.canadmidcset * * @return the value of FreeHost_Admuser.canadmidcset * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCanadmidcset() { return canadmidcset; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.canadmidcset * * @param canadmidcset the value for FreeHost_Admuser.canadmidcset * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCanadmidcset(String canadmidcset) { this.canadmidcset = canadmidcset == null ? null : canadmidcset.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.canadmkefu * * @return the value of FreeHost_Admuser.canadmkefu * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCanadmkefu() { return canadmkefu; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.canadmkefu * * @param canadmkefu the value for FreeHost_Admuser.canadmkefu * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCanadmkefu(String canadmkefu) { this.canadmkefu = canadmkefu == null ? null : canadmkefu.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.canmodkefu * * @return the value of FreeHost_Admuser.canmodkefu * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCanmodkefu() { return canmodkefu; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.canmodkefu * * @param canmodkefu the value for FreeHost_Admuser.canmodkefu * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCanmodkefu(String canmodkefu) { this.canmodkefu = canmodkefu == null ? null : canmodkefu.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.candelkefu * * @return the value of FreeHost_Admuser.candelkefu * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCandelkefu() { return candelkefu; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.candelkefu * * @param candelkefu the value for FreeHost_Admuser.candelkefu * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCandelkefu(String candelkefu) { this.candelkefu = candelkefu == null ? null : candelkefu.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.canchnkefu * * @return the value of FreeHost_Admuser.canchnkefu * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCanchnkefu() { return canchnkefu; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.canchnkefu * * @param canchnkefu the value for FreeHost_Admuser.canchnkefu * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCanchnkefu(String canchnkefu) { this.canchnkefu = canchnkefu == null ? null : canchnkefu.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.onlypasusesite * * @return the value of FreeHost_Admuser.onlypasusesite * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getOnlypasusesite() { return onlypasusesite; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.onlypasusesite * * @param onlypasusesite the value for FreeHost_Admuser.onlypasusesite * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setOnlypasusesite(String onlypasusesite) { this.onlypasusesite = onlypasusesite == null ? null : onlypasusesite.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.canadmhostch * * @return the value of FreeHost_Admuser.canadmhostch * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCanadmhostch() { return canadmhostch; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.canadmhostch * * @param canadmhostch the value for FreeHost_Admuser.canadmhostch * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCanadmhostch(String canadmhostch) { this.canadmhostch = canadmhostch == null ? null : canadmhostch.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.canadmhostmidsub * * @return the value of FreeHost_Admuser.canadmhostmidsub * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCanadmhostmidsub() { return canadmhostmidsub; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.canadmhostmidsub * * @param canadmhostmidsub the value for FreeHost_Admuser.canadmhostmidsub * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCanadmhostmidsub(String canadmhostmidsub) { this.canadmhostmidsub = canadmhostmidsub == null ? null : canadmhostmidsub.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.canadmhostmiddomain * * @return the value of FreeHost_Admuser.canadmhostmiddomain * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCanadmhostmiddomain() { return canadmhostmiddomain; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.canadmhostmiddomain * * @param canadmhostmiddomain the value for FreeHost_Admuser.canadmhostmiddomain * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCanadmhostmiddomain(String canadmhostmiddomain) { this.canadmhostmiddomain = canadmhostmiddomain == null ? null : canadmhostmiddomain.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.canadmhostmidcpu * * @return the value of FreeHost_Admuser.canadmhostmidcpu * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCanadmhostmidcpu() { return canadmhostmidcpu; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.canadmhostmidcpu * * @param canadmhostmidcpu the value for FreeHost_Admuser.canadmhostmidcpu * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCanadmhostmidcpu(String canadmhostmidcpu) { this.canadmhostmidcpu = canadmhostmidcpu == null ? null : canadmhostmidcpu.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.canadmhostmidrepay * * @return the value of FreeHost_Admuser.canadmhostmidrepay * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCanadmhostmidrepay() { return canadmhostmidrepay; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.canadmhostmidrepay * * @param canadmhostmidrepay the value for FreeHost_Admuser.canadmhostmidrepay * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCanadmhostmidrepay(String canadmhostmidrepay) { this.canadmhostmidrepay = canadmhostmidrepay == null ? null : canadmhostmidrepay.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.canadmhostdel * * @return the value of FreeHost_Admuser.canadmhostdel * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCanadmhostdel() { return canadmhostdel; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.canadmhostdel * * @param canadmhostdel the value for FreeHost_Admuser.canadmhostdel * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCanadmhostdel(String canadmhostdel) { this.canadmhostdel = canadmhostdel == null ? null : canadmhostdel.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.canadmhostoth * * @return the value of FreeHost_Admuser.canadmhostoth * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCanadmhostoth() { return canadmhostoth; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.canadmhostoth * * @param canadmhostoth the value for FreeHost_Admuser.canadmhostoth * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCanadmhostoth(String canadmhostoth) { this.canadmhostoth = canadmhostoth == null ? null : canadmhostoth.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.canadmemailreapy * * @return the value of FreeHost_Admuser.canadmemailreapy * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCanadmemailreapy() { return canadmemailreapy; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.canadmemailreapy * * @param canadmemailreapy the value for FreeHost_Admuser.canadmemailreapy * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCanadmemailreapy(String canadmemailreapy) { this.canadmemailreapy = canadmemailreapy == null ? null : canadmemailreapy.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.canadmemaildel * * @return the value of FreeHost_Admuser.canadmemaildel * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCanadmemaildel() { return canadmemaildel; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.canadmemaildel * * @param canadmemaildel the value for FreeHost_Admuser.canadmemaildel * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCanadmemaildel(String canadmemaildel) { this.canadmemaildel = canadmemaildel == null ? null : canadmemaildel.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.canadmemailch * * @return the value of FreeHost_Admuser.canadmemailch * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCanadmemailch() { return canadmemailch; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.canadmemailch * * @param canadmemailch the value for FreeHost_Admuser.canadmemailch * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCanadmemailch(String canadmemailch) { this.canadmemailch = canadmemailch == null ? null : canadmemailch.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.canadmemailrenow * * @return the value of FreeHost_Admuser.canadmemailrenow * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCanadmemailrenow() { return canadmemailrenow; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.canadmemailrenow * * @param canadmemailrenow the value for FreeHost_Admuser.canadmemailrenow * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCanadmemailrenow(String canadmemailrenow) { this.canadmemailrenow = canadmemailrenow == null ? null : canadmemailrenow.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.canadmemailupdate * * @return the value of FreeHost_Admuser.canadmemailupdate * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCanadmemailupdate() { return canadmemailupdate; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.canadmemailupdate * * @param canadmemailupdate the value for FreeHost_Admuser.canadmemailupdate * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCanadmemailupdate(String canadmemailupdate) { this.canadmemailupdate = canadmemailupdate == null ? null : canadmemailupdate.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.canadmsqlrepay * * @return the value of FreeHost_Admuser.canadmsqlrepay * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCanadmsqlrepay() { return canadmsqlrepay; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.canadmsqlrepay * * @param canadmsqlrepay the value for FreeHost_Admuser.canadmsqlrepay * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCanadmsqlrepay(String canadmsqlrepay) { this.canadmsqlrepay = canadmsqlrepay == null ? null : canadmsqlrepay.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.canadmsqldel * * @return the value of FreeHost_Admuser.canadmsqldel * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCanadmsqldel() { return canadmsqldel; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.canadmsqldel * * @param canadmsqldel the value for FreeHost_Admuser.canadmsqldel * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCanadmsqldel(String canadmsqldel) { this.canadmsqldel = canadmsqldel == null ? null : canadmsqldel.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.canadmsqlch * * @return the value of FreeHost_Admuser.canadmsqlch * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCanadmsqlch() { return canadmsqlch; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.canadmsqlch * * @param canadmsqlch the value for FreeHost_Admuser.canadmsqlch * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCanadmsqlch(String canadmsqlch) { this.canadmsqlch = canadmsqlch == null ? null : canadmsqlch.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.canadmsqlrenow * * @return the value of FreeHost_Admuser.canadmsqlrenow * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCanadmsqlrenow() { return canadmsqlrenow; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.canadmsqlrenow * * @param canadmsqlrenow the value for FreeHost_Admuser.canadmsqlrenow * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCanadmsqlrenow(String canadmsqlrenow) { this.canadmsqlrenow = canadmsqlrenow == null ? null : canadmsqlrenow.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.canadmsqlupdate * * @return the value of FreeHost_Admuser.canadmsqlupdate * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCanadmsqlupdate() { return canadmsqlupdate; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.canadmsqlupdate * * @param canadmsqlupdate the value for FreeHost_Admuser.canadmsqlupdate * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCanadmsqlupdate(String canadmsqlupdate) { this.canadmsqlupdate = canadmsqlupdate == null ? null : canadmsqlupdate.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.canadmsqlpau * * @return the value of FreeHost_Admuser.canadmsqlpau * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCanadmsqlpau() { return canadmsqlpau; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.canadmsqlpau * * @param canadmsqlpau the value for FreeHost_Admuser.canadmsqlpau * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCanadmsqlpau(String canadmsqlpau) { this.canadmsqlpau = canadmsqlpau == null ? null : canadmsqlpau.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.canadmhostaddtest * * @return the value of FreeHost_Admuser.canadmhostaddtest * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCanadmhostaddtest() { return canadmhostaddtest; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.canadmhostaddtest * * @param canadmhostaddtest the value for FreeHost_Admuser.canadmhostaddtest * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCanadmhostaddtest(String canadmhostaddtest) { this.canadmhostaddtest = canadmhostaddtest == null ? null : canadmhostaddtest.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.canadmvps * * @return the value of FreeHost_Admuser.canadmvps * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCanadmvps() { return canadmvps; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.canadmvps * * @param canadmvps the value for FreeHost_Admuser.canadmvps * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCanadmvps(String canadmvps) { this.canadmvps = canadmvps == null ? null : canadmvps.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.canadmvpsadd * * @return the value of FreeHost_Admuser.canadmvpsadd * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCanadmvpsadd() { return canadmvpsadd; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.canadmvpsadd * * @param canadmvpsadd the value for FreeHost_Admuser.canadmvpsadd * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCanadmvpsadd(String canadmvpsadd) { this.canadmvpsadd = canadmvpsadd == null ? null : canadmvpsadd.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.canadmvpsaddtest * * @return the value of FreeHost_Admuser.canadmvpsaddtest * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCanadmvpsaddtest() { return canadmvpsaddtest; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.canadmvpsaddtest * * @param canadmvpsaddtest the value for FreeHost_Admuser.canadmvpsaddtest * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCanadmvpsaddtest(String canadmvpsaddtest) { this.canadmvpsaddtest = canadmvpsaddtest == null ? null : canadmvpsaddtest.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.canadmvpsset * * @return the value of FreeHost_Admuser.canadmvpsset * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCanadmvpsset() { return canadmvpsset; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.canadmvpsset * * @param canadmvpsset the value for FreeHost_Admuser.canadmvpsset * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCanadmvpsset(String canadmvpsset) { this.canadmvpsset = canadmvpsset == null ? null : canadmvpsset.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.canadmvpsch * * @return the value of FreeHost_Admuser.canadmvpsch * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCanadmvpsch() { return canadmvpsch; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.canadmvpsch * * @param canadmvpsch the value for FreeHost_Admuser.canadmvpsch * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCanadmvpsch(String canadmvpsch) { this.canadmvpsch = canadmvpsch == null ? null : canadmvpsch.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.canadmvpsmidcpu * * @return the value of FreeHost_Admuser.canadmvpsmidcpu * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCanadmvpsmidcpu() { return canadmvpsmidcpu; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.canadmvpsmidcpu * * @param canadmvpsmidcpu the value for FreeHost_Admuser.canadmvpsmidcpu * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCanadmvpsmidcpu(String canadmvpsmidcpu) { this.canadmvpsmidcpu = canadmvpsmidcpu == null ? null : canadmvpsmidcpu.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.canadmvpsmidrepay * * @return the value of FreeHost_Admuser.canadmvpsmidrepay * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCanadmvpsmidrepay() { return canadmvpsmidrepay; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.canadmvpsmidrepay * * @param canadmvpsmidrepay the value for FreeHost_Admuser.canadmvpsmidrepay * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCanadmvpsmidrepay(String canadmvpsmidrepay) { this.canadmvpsmidrepay = canadmvpsmidrepay == null ? null : canadmvpsmidrepay.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.canadmvpsdel * * @return the value of FreeHost_Admuser.canadmvpsdel * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCanadmvpsdel() { return canadmvpsdel; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.canadmvpsdel * * @param canadmvpsdel the value for FreeHost_Admuser.canadmvpsdel * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCanadmvpsdel(String canadmvpsdel) { this.canadmvpsdel = canadmvpsdel == null ? null : canadmvpsdel.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.canadmvpsoth * * @return the value of FreeHost_Admuser.canadmvpsoth * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCanadmvpsoth() { return canadmvpsoth; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.canadmvpsoth * * @param canadmvpsoth the value for FreeHost_Admuser.canadmvpsoth * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCanadmvpsoth(String canadmvpsoth) { this.canadmvpsoth = canadmvpsoth == null ? null : canadmvpsoth.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.upgiflen * * @return the value of FreeHost_Admuser.upgiflen * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public Integer getUpgiflen() { return upgiflen; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.upgiflen * * @param upgiflen the value for FreeHost_Admuser.upgiflen * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setUpgiflen(Integer upgiflen) { this.upgiflen = upgiflen; } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.canadmispbeian * * @return the value of FreeHost_Admuser.canadmispbeian * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCanadmispbeian() { return canadmispbeian; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.canadmispbeian * * @param canadmispbeian the value for FreeHost_Admuser.canadmispbeian * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCanadmispbeian(String canadmispbeian) { this.canadmispbeian = canadmispbeian == null ? null : canadmispbeian.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.canmoneyNew * * @return the value of FreeHost_Admuser.canmoneyNew * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCanmoneynew() { return canmoneynew; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.canmoneyNew * * @param canmoneynew the value for FreeHost_Admuser.canmoneyNew * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCanmoneynew(String canmoneynew) { this.canmoneynew = canmoneynew == null ? null : canmoneynew.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.canadmCDN * * @return the value of FreeHost_Admuser.canadmCDN * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCanadmcdn() { return canadmcdn; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.canadmCDN * * @param canadmcdn the value for FreeHost_Admuser.canadmCDN * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCanadmcdn(String canadmcdn) { this.canadmcdn = canadmcdn == null ? null : canadmcdn.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.canadmCDNadd * * @return the value of FreeHost_Admuser.canadmCDNadd * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCanadmcdnadd() { return canadmcdnadd; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.canadmCDNadd * * @param canadmcdnadd the value for FreeHost_Admuser.canadmCDNadd * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCanadmcdnadd(String canadmcdnadd) { this.canadmcdnadd = canadmcdnadd == null ? null : canadmcdnadd.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.canadmCDNaddtest * * @return the value of FreeHost_Admuser.canadmCDNaddtest * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCanadmcdnaddtest() { return canadmcdnaddtest; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.canadmCDNaddtest * * @param canadmcdnaddtest the value for FreeHost_Admuser.canadmCDNaddtest * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCanadmcdnaddtest(String canadmcdnaddtest) { this.canadmcdnaddtest = canadmcdnaddtest == null ? null : canadmcdnaddtest.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.canadmCDNset * * @return the value of FreeHost_Admuser.canadmCDNset * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCanadmcdnset() { return canadmcdnset; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.canadmCDNset * * @param canadmcdnset the value for FreeHost_Admuser.canadmCDNset * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCanadmcdnset(String canadmcdnset) { this.canadmcdnset = canadmcdnset == null ? null : canadmcdnset.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.canadmCDNch * * @return the value of FreeHost_Admuser.canadmCDNch * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCanadmcdnch() { return canadmcdnch; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.canadmCDNch * * @param canadmcdnch the value for FreeHost_Admuser.canadmCDNch * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCanadmcdnch(String canadmcdnch) { this.canadmcdnch = canadmcdnch == null ? null : canadmcdnch.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.canadmCDNmidcpu * * @return the value of FreeHost_Admuser.canadmCDNmidcpu * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCanadmcdnmidcpu() { return canadmcdnmidcpu; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.canadmCDNmidcpu * * @param canadmcdnmidcpu the value for FreeHost_Admuser.canadmCDNmidcpu * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCanadmcdnmidcpu(String canadmcdnmidcpu) { this.canadmcdnmidcpu = canadmcdnmidcpu == null ? null : canadmcdnmidcpu.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.canadmCDNmidrepay * * @return the value of FreeHost_Admuser.canadmCDNmidrepay * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCanadmcdnmidrepay() { return canadmcdnmidrepay; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.canadmCDNmidrepay * * @param canadmcdnmidrepay the value for FreeHost_Admuser.canadmCDNmidrepay * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCanadmcdnmidrepay(String canadmcdnmidrepay) { this.canadmcdnmidrepay = canadmcdnmidrepay == null ? null : canadmcdnmidrepay.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.canadmCDNdel * * @return the value of FreeHost_Admuser.canadmCDNdel * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCanadmcdndel() { return canadmcdndel; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.canadmCDNdel * * @param canadmcdndel the value for FreeHost_Admuser.canadmCDNdel * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCanadmcdndel(String canadmcdndel) { this.canadmcdndel = canadmcdndel == null ? null : canadmcdndel.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.canadmCDNoth * * @return the value of FreeHost_Admuser.canadmCDNoth * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public String getCanadmcdnoth() { return canadmcdnoth; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.canadmCDNoth * * @param canadmcdnoth the value for FreeHost_Admuser.canadmCDNoth * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setCanadmcdnoth(String canadmcdnoth) { this.canadmcdnoth = canadmcdnoth == null ? null : canadmcdnoth.trim(); } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.emailport * * @return the value of FreeHost_Admuser.emailport * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public Integer getEmailport() { return emailport; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.emailport * * @param emailport the value for FreeHost_Admuser.emailport * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setEmailport(Integer emailport) { this.emailport = emailport; } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column FreeHost_Admuser.EnableSsl * * @return the value of FreeHost_Admuser.EnableSsl * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public Boolean getEnablessl() { return enablessl; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column FreeHost_Admuser.EnableSsl * * @param enablessl the value for FreeHost_Admuser.EnableSsl * * @mbg.generated Fri May 11 11:16:07 CST 2018 */ public void setEnablessl(Boolean enablessl) { this.enablessl = enablessl; } }
package day06_arithmetic_operators; public class moreMathOperators { public static void main (String [] args ){ int toyotas = 431; int hondas = 233; int vw = 2; int tesla = 20; int nissan = 1; int bmw = 155; int total = toyotas+ hondas+vw+tesla+nissan+ bmw; System.out.println(total); System.out.println("There are " +total +" cars in the parking."); String pizza = "hawaiian"; int slices = 8; int people = 4; int slicePerPerson = slices/people; System.out.println(slices / people); System.out.println("There are " + slicePerPerson + " slices for per person."); System.out.println("We ordered " + pizza + " pizza with " +slices+ " slices, " + people + " people ate " + slicePerPerson + " slices each."); } }
package com.heartmarket.model.dto.response; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; @Getter @Setter @AllArgsConstructor @NoArgsConstructor public class MailTradeImg { int imgNo; String orgImg; }
package com.etar.purifier.modules.verificationCode.controller; import com.etar.purifier.common.annotation.LogOperate; import com.etar.purifier.modules.common.entity.DataResult; import com.etar.purifier.modules.common.entity.PageBean; import com.etar.purifier.modules.common.entity.Result; import com.etar.purifier.modules.verificationCode.entity.QueryVerificationCode; import com.etar.purifier.modules.verificationCode.entity.VerificationCode; import com.etar.purifier.modules.verificationCode.service.VerificationCodeService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Page; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import java.util.ArrayList; /** * 手机验证码 VerificationCodeController层 * * @author gmq * @since 2019-01-11 */ @RestController @RequestMapping(value = "/verificationCodes") public class VerificationCodeController { private static Logger log = LoggerFactory.getLogger(VerificationCodeController.class); private final VerificationCodeService verificationCodeService; @Autowired public VerificationCodeController(VerificationCodeService verificationCodeService) { this.verificationCodeService = verificationCodeService; } /** * 保存对象<br/> * * @param verificationCode 对象 */ @PostMapping @LogOperate(description = "保存验证码") public Result save(@Validated @RequestBody VerificationCode verificationCode) { Result result = new Result(); try { verificationCodeService.save(verificationCode); } catch (Exception e) { log.error(e.getMessage()); return result.error(2001, "新增失败"); } return result.ok(); } /** * 更新 * * @param verificationCode 验证码 * @return 123 */ @PutMapping(value = "/{id}") @LogOperate(description = "重发验证码") public Result updateBanner(@Validated @RequestBody VerificationCode verificationCode, @PathVariable("id") Integer id) { Result result = new Result(); try { boolean exists = verificationCodeService.existsById(id); if (!exists) { return result.error(2002, "修改失败,未找到"); } verificationCodeService.save(verificationCode); } catch (Exception e) { log.error(e.getMessage()); return result.error(2002, "修改失败"); } return result.ok(); } /** * 通过id查找对象 * * @param id id * @return VerificationCode 对象 */ @GetMapping(value = "/{id}") public Result findById(@PathVariable("id") Integer id) { DataResult result = new DataResult(); try { result.setDatas(verificationCodeService.findById(id)); } catch (Exception e) { log.error(e.getMessage()); return result.error(2004, "不存在"); } return result.ok(); } /** * 分页查询 * * @return Page<VerificationCode> 对象 */ @PostMapping(value = "/pages") public Result findByPage(@RequestBody QueryVerificationCode queryVerificationCode) { DataResult result = new DataResult(); try { int page = queryVerificationCode.getPage(); int pageSize = queryVerificationCode.getPageSize(); Page<VerificationCode> all = verificationCodeService.findAll(page - 1, pageSize, queryVerificationCode); PageBean<VerificationCode> pageBean = new PageBean<>(); if (all == null) { pageBean.setList(new ArrayList<>()); result.setDatas(pageBean); return result.ok(); } pageBean.setCurPage(page); pageBean.setItemCounts(all.getTotalElements()); pageBean.setPageSize(pageSize); pageBean.setList(all.getContent()); result.setDatas(pageBean); } catch (Exception e) { e.printStackTrace(); log.error(e.getMessage()); return result.error(2005, "查询出错"); } return result.ok(); } }
/* * Copyright 2013-2014 ReConf Team * * 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 reconf.server.services.property; import java.util.*; import org.apache.commons.lang3.*; import org.slf4j.*; import org.springframework.beans.factory.annotation.*; import org.springframework.http.*; import org.springframework.transaction.annotation.*; import org.springframework.web.bind.annotation.*; import reconf.server.*; import reconf.server.domain.*; import reconf.server.domain.result.*; import reconf.server.repository.*; import reconf.server.services.*; import com.fasterxml.jackson.databind.*; @RestController @RequestMapping(value="/", produces = ReConfConstants.MT_PROTOCOL_V1, consumes={ReConfConstants.MT_PROTOCOL_V1, ReConfConstants.MT_TEXT_PLAIN, ReConfConstants.MT_ALL}) public class ClientReadPropertyService { private static final String JS = "var patt = eval(regexp); var result = patt.test(instance);"; private static ObjectMapper mapper = new ObjectMapper(); private static final Logger log = LoggerFactory.getLogger(ClientReadPropertyService.class); @Autowired PropertyRepository properties; @Autowired JavaScriptEngine engine; @RequestMapping(value="/{prod}/{comp}/{prop}", method=RequestMethod.GET) @Transactional(readOnly=true) public ResponseEntity<String> doIt( @PathVariable("prod") String product, @PathVariable("comp") String component, @PathVariable("prop") String property, @RequestParam(value="instance", required=false, defaultValue="unknown") String instance) { PropertyKey key = new PropertyKey(product, component, property); List<String> errors = DomainValidator.checkForErrors(key); Property reqProperty = new Property(key); HttpHeaders headers = new HttpHeaders(); if (!errors.isEmpty()) { addErrorHeader(headers, errors, reqProperty); return new ResponseEntity<String>(headers, HttpStatus.BAD_REQUEST); } List<Property> dbProperties = properties.findByKeyProductAndKeyComponentAndKeyNameOrderByRulePriorityDescKeyRuleNameAsc(key.getProduct(), key.getComponent(), key.getName()); for (Property dbProperty : dbProperties) { try { if (isMatch(instance, dbProperty)) { addRuleHeader(headers, dbProperty); return new ResponseEntity<String>(dbProperty.getValue(), headers, HttpStatus.OK); } } catch (Exception e) { log.error("error applying rule", e); addRuleHeader(headers, dbProperty); addErrorHeader(headers, Collections.singletonList("rule error"), reqProperty); return new ResponseEntity<String>(headers, HttpStatus.INTERNAL_SERVER_ERROR); } } return new ResponseEntity<String>(HttpStatus.NOT_FOUND); } private boolean isMatch(String instance, Property each) { Map<String, Object> params = new HashMap<>(); params.put("regexp", StringUtils.defaultString(each.getRuleRegexp())); params.put("instance", StringUtils.lowerCase(instance)); return (boolean) engine.eval(JS, params, "result"); } private void addErrorHeader(HttpHeaders headers, List<String> errors, Property fromRequest) { addHeader(headers, ReConfConstants.H_RESPONSE_RESULT, new PropertyResult(fromRequest, errors)); } private void addRuleHeader(HttpHeaders headers, Property property) { addHeader(headers, ReConfConstants.H_RESPONSE_RULE, new Rule(property)); } private HttpHeaders addHeader(HttpHeaders headers, String name, Object value) { try { headers.add(name, mapper.writeValueAsString(value)); } catch (Exception ignored) { } return headers; } }
package unidad4; public class Ccuenta { /**@author jesgo * */ protected String nombre; private String cuenta; private double saldo; private double tipoInterés; public Ccuenta() { } public Ccuenta(String nom, String cue, double sal, double tipo) { nombre = nom; cuenta = cue; saldo = sal; tipoInterés = tipo; } public void asignarNombre(String nom) { nombre = nom; } public String obtenerNombre() { return nombre; } public double estado() { return saldo; } /** * Metodo para controlar la cantidad ingresada por el usuario * @param cantidad lo que el usuario tiene que retirar, sera un importe economico * @throws Lanza excepcion para que no sea posible ingresar una cantidad menor a 0 */ public void ingresar(double cantidad) throws Exception { if (cantidad < 0) { throw new Exception("No se puede ingresar una cantidad negativa"); } setSaldo(saldo + cantidad); } /** * Método que sirve para controlar el importe que el usuario retira * @param cantidad lo que el usuario tiene que retirar, sera un importe economico * @throws Lanza excepción en caso de que se retire una cantidad negativa o no haya suficiente saldo */ public void retirar(double cantidad) throws Exception { if (cantidad < 0) { throw new Exception("No se puede retirar una cantidad negativa"); } if (estado() < cantidad) { throw new Exception("No se hay suficiente saldo"); } setSaldo(saldo - cantidad); } public String obtenerCuenta() { return cuenta; } public void setCuenta(String cuenta) { this.cuenta = cuenta; } public void setSaldo(double saldo) { this.saldo = saldo; } /** * * @return sin retorno */ public double getTipoInterés() { return tipoInterés; } /** * * @param tipoInterés */ public void setTipoInterés(double tipoInterés) { this.tipoInterés = tipoInterés; } }
package send.money.transfer.send; import send.money.transfer.Operation; /** * A simple action to deposit or withdraw money */ public interface MoneySendAction { Long getAccountId(Operation operation); /** * Call an action upon the operation * @param operation which status will be changed */ void call(Operation operation); }
package littleservantmod.plugin.jei; import mezz.jei.api.IModPlugin; import mezz.jei.api.IModRegistry; import mezz.jei.api.JEIPlugin; @JEIPlugin public class JEILSMLPlugin implements IModPlugin { @Override public void register(IModRegistry registry) { //何故か加速するので //SideTabBase.tabExpandSpeed = 4; registry.addAdvancedGuiHandlers(new LSMAdvancedGuiHandler()); } }
package com.jegsoftware.payperiodbudgeting.data; import java.util.UUID; /** * Created by jonathon on 2/24/18. */ public class FakeItemDataSource implements IBudgetItemData { BudgetItem savedItem; @Override public void save(BudgetItem item) { savedItem = item; } @Override public BudgetItem retrieve(UUID id) { return savedItem; } }
/** * Provides the exception that can be thrown during the execution o the code.<br> * The package contains the following exceptions: * <ul> * <li>{@code MappingException} : thrown when an error occurs during the mapping operation</li> * <li>{@code MappingNotFoundException} : thrown when an error occurs when a mapping does not exist</li> * </ul> * @author eschoysman * @see es.utils.mapper.exception.MappingException * @see es.utils.mapper.exception.MappingNotFoundException */ package es.utils.mapper.exception;
package com.tatteam.popthecamera; import com.badlogic.gdx.ApplicationAdapter; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.InputProcessor; import com.badlogic.gdx.Preferences; import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.graphics.GL20; import com.badlogic.gdx.graphics.g2d.TextureAtlas; import com.badlogic.gdx.math.Vector3; import com.badlogic.gdx.scenes.scene2d.Stage; import com.badlogic.gdx.utils.viewport.FitViewport; import com.badlogic.gdx.utils.viewport.ScreenViewport; import com.badlogic.gdx.utils.viewport.Viewport; import com.tatteam.popthecamera.actors.Background; import com.tatteam.popthecamera.actors.Camera; import com.tatteam.popthecamera.actors.CameraButton; import com.tatteam.popthecamera.actors.Dot; import com.tatteam.popthecamera.actors.Flash; import com.tatteam.popthecamera.actors.Indicator; import com.tatteam.popthecamera.actors.Lens; import com.tatteam.popthecamera.actors.TextView; public class GDXGameLauncher extends ApplicationAdapter implements InputProcessor, ActorGroup.OnShakeCompleteListener, CameraButton.OnPressFinishListener, Flash.OnDisappearListener, Dot.OnFadeCompleteListener { private Constants.GameMode gameMode = Constants.GameMode.CLASSIC_SLOW; private final int CLASSIC_COLOR_STEP = 3; private final int UNLIMITED_COLOR_STEP = 5; private Viewport backgroundViewport; private Viewport fitViewport; private Viewport screenViewport; private Indicator indicator; private Dot dot; private Camera camera; private Stage stage; private Stage splashStage; private Stage backgroundStage; private TextureAtlas atlas; private ActorGroup cameraGroup; private ActorGroup lensGroup; private Lens lens1; private Lens lens2; private Lens lens3; private Lens lens4; private CameraButton cameraButton; private int classicLevel; private int classicScore; private double indicatorBeta; private double dotBeta; private boolean playAgain = false; private TextView level; private TextView index; private TextView classicType; private Flash flash; private double e; private Color currentBackgroundColor; private Button soundButton; private Button vibrationButton; private Button backButton; private Vector3 touchPoint; private Preferences preferences; private boolean currentOrientation = true; public static boolean touchable = true; private static boolean checkable = true; private OnGameListener onGameListener; private int unlimitedScore = 0; private int unlimitedBestScore = 0; private int unlimitedColorIndex = 0; private Background background; private int classicColorIndex = 0; private float touchOffset; @Override public void create() { Thread.currentThread().setPriority(Thread.MAX_PRIORITY); touchable = true; loadData(); AssetsLoader.getInstance().init(); SoundHelper.getInstance().initSound(); stage = new Stage(); splashStage = new Stage(); backgroundStage = new Stage(); fitViewport = new FitViewport(AssetsLoader.getInstance().getViewPortSize().getWidth(), AssetsLoader.getInstance().getViewPortSize().getHeight()); fitViewport.update(AssetsLoader.getInstance().getViewPortSize().getWidth(), AssetsLoader.getInstance().getViewPortSize().getHeight(), true); stage.setViewport(fitViewport); screenViewport = new ScreenViewport(); screenViewport.update(Gdx.graphics.getWidth(), Gdx.graphics.getHeight(), true); splashStage.setViewport(screenViewport); backgroundViewport = new ScreenViewport(); backgroundViewport.update(AssetsLoader.getInstance().getViewPortSize().getWidth(), AssetsLoader.getInstance().getViewPortSize().getHeight(), true); backgroundStage.setViewport(backgroundViewport); flash = new Flash(Gdx.graphics.getWidth(), Gdx.graphics.getHeight()); flash.setOnDisappearListener(this); atlas = new TextureAtlas(Gdx.files.internal(AssetsLoader.getInstance().getImagePath() + "pop_the_camera.pack")); background = new Background(Gdx.graphics.getWidth(), Gdx.graphics.getHeight()); backgroundStage.addActor(background); init(); stage.addActor(cameraGroup.getActors()); dot.initPosition(); if (dot.getRotation() >= 0 && dot.getRotation() <= 180) { indicator.clockwise = false; } else if (dot.getRotation() > 180 && dot.getRotation() < 360) { indicator.clockwise = true; } touchPoint = new Vector3(); Gdx.input.setInputProcessor(this); } @Override public void render() { Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); checkOver(); backgroundViewport.apply(); background.setColor(currentBackgroundColor); backgroundStage.act(); backgroundStage.draw(); fitViewport.apply(); stage.act(); stage.draw(); screenViewport.apply(); splashStage.act(); splashStage.draw(); } @Override public void dispose() { saveData(); stage.dispose(); ColorHelper.getInstance().dispose(); SoundHelper.getInstance().dispose(); soundButton.dispose(); atlas.dispose(); super.dispose(); } @Override public void resize(int width, int height) { fitViewport.update(width, height, true); screenViewport.update(width, height, true); backgroundViewport.update(width, height, true); } private void init() { // Set up camera group. Camera group includes camera_button, background, lensGroup. cameraGroup = new ActorGroup(); camera = new Camera(atlas.findRegion("camera")); cameraButton = new CameraButton(atlas.findRegion("camera_button")); cameraButton.setOnPressFinishListener(this); cameraGroup.setSize(camera.getWidth(), camera.getHeight()); cameraGroup.setPosition(fitViewport.getWorldWidth() / 2 - cameraGroup.getWidth() / 2, fitViewport.getWorldHeight() / 2 - cameraGroup.getHeight() / 2); cameraGroup.setOrigin(cameraGroup.getWidth() / 2, cameraGroup.getHeight() / 2); cameraButton.setPosition(cameraButton.getWidth(), cameraGroup.getHeight() - cameraButton.getHeight() * 4f); initLens(); lensGroup.setPosition(cameraGroup.getWidth() / 2 - lensGroup.getWidth() / 2, cameraGroup.getHeight() / 2 - lensGroup.getHeight() / 2 - (lens1.getHeight() / 2 - lens2.getHeight() / 2) / 3); cameraGroup.addActor(cameraButton); cameraGroup.addActor(camera); cameraGroup.addActor(lensGroup.getActors()); cameraGroup.setOnShakeCompleteListener(this); indicator.setSpeed(gameMode.getSpeed()); initButton(); initTextView(); } // Set up lens group // Lens group includes indicator, dot, lens1, lens2, lens 3, lens4. private void initLens() { lensGroup = new ActorGroup(); lens1 = new Lens(atlas.findRegion("lens1")); lens2 = new Lens(atlas.findRegion("lens2")); lens3 = new Lens(atlas.findRegion("lens3")); lens4 = new Lens(atlas.findRegion("lens4")); lensGroup.setSize(lens1.getWidth(), lens1.getHeight()); lens1.setPosition(0, 0); lens2.setCenterPosition(lensGroup.getWidth(), lensGroup.getHeight()); lens3.setCenterPosition(lensGroup.getWidth(), lensGroup.getHeight()); lens4.setCenterPosition(lensGroup.getWidth(), lensGroup.getHeight()); indicator = new Indicator(atlas.findRegion("indicator")); float indicatorOffset = (lens2.getHeight() - lens3.getHeight()) / 2 - indicator.getHeight(); indicator.setPosition(lens1.getWidth() / 2 - indicator.getWidth() / 2, (lens1.getHeight() - lens2.getHeight()) / 2 + lens2.getHeight() - indicator.getHeight() - indicatorOffset / 2); indicator.setOrigin(indicator.getWidth() / 2f, -(lens3.getHeight() / 2f) - indicatorOffset / 2f); dot = new Dot(atlas.findRegion("dot")); float dotOffset = (lens2.getHeight() - lens3.getHeight()) / 2 - dot.getHeight(); dot.setPosition(lens1.getWidth() / 2 - dot.getWidth() / 2, (lens1.getHeight() - lens2.getHeight()) / 2 + lens2.getHeight() - dot.getHeight() - dotOffset / 2); dot.setOrigin(dot.getWidth() / 2, -(lens3.getHeight() / 2) - dotOffset / 2); dot.setOnFadeCompleteListener(this); float dotRadius = lens3.getHeight() / 2 + dotOffset / 2 + dot.getHeight() / 2; float indicatorRadius = lens3.getHeight() / 2 + indicatorOffset / 2 + indicator.getHeight() / 3; indicatorBeta = Math.toDegrees(Math.acos((2 * indicatorRadius * indicatorRadius - indicator.getWidth() * indicator.getWidth()) / (2 * indicatorRadius * indicatorRadius))); dotBeta = Math.toDegrees(Math.acos((2 * dotRadius * dotRadius - dot.getWidth() * dot.getWidth()) / (2 * dotRadius * dotRadius))); // set color if (gameMode == Constants.GameMode.UNLIMITED) { ColorHelper.getInstance().setColorUnlimitedMode(unlimitedColorIndex, lens2, lens3, lens4); } else { ColorHelper.getInstance().setColor(classicColorIndex, lens2, lens3, lens4); } lensGroup.addActor(lens1); lensGroup.addActor(lens2); lensGroup.addActor(lens3); lensGroup.addActor(lens4); lensGroup.addActor(dot); lensGroup.addActor(indicator); e = indicatorBeta / 2; } @Override public boolean keyDown(int keycode) { return false; } @Override public boolean keyUp(int keycode) { return false; } @Override public boolean keyTyped(char character) { return false; } @Override public boolean touchDown(int screenX, int screenY, int pointer, int button) { if (touchable) { touchPoint.set(screenX, screenY, 0); screenViewport.unproject(touchPoint); Log.writeLog("Check touch point", "" + touchPoint.x + " " + touchPoint.y); Log.writeLog("Sound button coordinate", "" + soundButton.getX() + " " + soundButton.getY()); if (touchPoint.x >= soundButton.getX() - touchOffset && touchPoint.x <= soundButton.getX() + touchOffset + soundButton.getWidth() && touchPoint.y >= soundButton.getY() - touchOffset && touchPoint.y <= soundButton.getY() + soundButton.getHeight() + touchOffset) { soundButton.touched = true; soundButton.setImage("off_sound"); } else if (touchPoint.x >= vibrationButton.getX() - touchOffset && touchPoint.x <= vibrationButton.getX() + vibrationButton.getWidth() + touchOffset && touchPoint.y >= vibrationButton.getY() - touchOffset && touchPoint.y <= vibrationButton.getY() + vibrationButton.getHeight() + touchOffset) { vibrationButton.touched = true; vibrationButton.setImage("off_vibrate"); } else if (touchPoint.x >= backButton.getX() - touchOffset && touchPoint.x <= backButton.getX() + backButton.getWidth() + touchOffset && touchPoint.y >= backButton.getY() - touchOffset && touchPoint.y <= backButton.getY() + backButton.getHeight() + touchOffset) { backButton.touched = true; backButton.setImage("btn_back_pressed"); } else if (playAgain) { dot.fadeOut(1); indicator.fadeOut(); updateTextView(2); checkable = false; backButton.setVisible(false); } else { if (!indicator.isMoving) { indicator.isMoving = true; } else { double indicationRotation = recalculateAngleIfNeed(indicator.getRotation()); double delta; if (indicator.clockwise) { if (indicationRotation == 0) { indicationRotation = 360; } } if (isSameSide(indicationRotation, dot.getRotation())) { if (indicationRotation >= dot.getRotation()) { delta = indicationRotation - dot.getRotation(); } else { delta = -indicationRotation + dot.getRotation(); } } else { if (indicationRotation <= 90 || indicationRotation >= 270) { if (indicationRotation >= dot.getRotation()) { delta = 360 - indicationRotation + dot.getRotation(); } else { delta = 360 - dot.getRotation() + indicationRotation; } } else { if (indicationRotation >= dot.getRotation()) { delta = indicationRotation - dot.getRotation(); } else { delta = -indicationRotation + dot.getRotation(); } } } delta -= e; if (delta <= dotBeta / 2) { classicScore--; updateTextView(2); Log.writeLog("Check touch"); Log.writeLog("Indicator Rotation", "" + indicationRotation); Log.writeLog("Dot Rotation", "" + dot.getRotation()); Log.writeLog("Delta 2", "" + delta); Log.writeLog("Dot beta", "" + dotBeta / 2); Log.writeLog("Indicator beta", "" + indicatorBeta / 8); Log.writeLog("Ting ting."); SoundHelper.getInstance().playSuccessSound(); if (classicScore != 0 || gameMode == Constants.GameMode.UNLIMITED) { increaseUnlimitedSeedIfNeeded(); currentOrientation = indicator.clockwise; dot.fadeOut(2); if (indicator.clockwise) { indicator.clockwise = false; } else { indicator.clockwise = true; } checkable = false; if (gameMode == Constants.GameMode.UNLIMITED && unlimitedScore % UNLIMITED_COLOR_STEP == 0) { unlimitedColorIndex++; ColorHelper.getInstance().setColorUnlimitedMode(unlimitedColorIndex, lens2, lens3, lens4); currentBackgroundColor = ColorHelper.getInstance().getBackGroundColorUnlimitedMode(unlimitedColorIndex); } } else { stopGame(1); } } else { stopGame(2); } } } } return false; } @Override public boolean touchUp(int screenX, int screenY, int pointer, int button) { touchPoint.set(screenX, screenY, 0); screenViewport.unproject(touchPoint); if (soundButton.touched) { if (SoundHelper.enableSound) { soundButton.setImage("press_sound"); SoundHelper.enableSound = false; } else { SoundHelper.enableSound = true; soundButton.setImage("on_sound"); SoundHelper.getInstance().playSuccessSound(); } saveData(); soundButton.reset(); } else if (vibrationButton.touched) { if (VibrationHelper.enableVibration) { vibrationButton.setImage("press_vibrate"); VibrationHelper.enableVibration = false; } else { vibrationButton.setImage("on_vibrate"); VibrationHelper.enableVibration = true; VibrationHelper.vibrate(1); } saveData(); vibrationButton.reset(); } else if (backButton.touched) { backButton.reset(); backButton.setImage("btn_back"); if (onGameListener != null) { onGameListener.onGameBackPressed(); } } return false; } @Override public boolean touchDragged(int screenX, int screenY, int pointer) { return false; } @Override public boolean mouseMoved(int screenX, int screenY) { return false; } @Override public boolean scrolled(int amount) { return false; } @Override public void onShakeComplete() { touchable = true; } // situation: 1-win; 2-lose private void stopGame(int situation) { switch (situation) { case 1: classicLevel++; saveData(); cameraButton.press(); break; case 2: playAgain = true; cameraGroup.shake(); backButton.setVisible(true); SoundHelper.getInstance().playFailSound(); touchable = false; VibrationHelper.vibrate(1); currentBackgroundColor = ColorHelper.FAIL_COLOR; if (this.onGameListener != null) { onGameListener.onLossGame(this, gameMode, classicLevel, classicScore); } resetScoreAtUnlimitedModeIfNeeded(); break; } classicScore = classicLevel; indicator.isMoving = false; } private void checkOver() { if (checkable) { if (indicator.isMoving) { double indicationRotation = recalculateAngleIfNeed(indicator.getRotation()); double delta; if (indicator.clockwise) { if (indicationRotation == 0) { indicationRotation = 360; } } if (isSameSide(indicationRotation, dot.getRotation())) { if (indicationRotation >= dot.getRotation()) { delta = indicationRotation - dot.getRotation(); } else { delta = -indicationRotation + dot.getRotation(); } } else { if (indicationRotation <= 90 || indicationRotation >= 270) { if (indicationRotation >= dot.getRotation()) { delta = 360 - indicationRotation + dot.getRotation(); } else { delta = 360 - dot.getRotation() + indicationRotation; } } else { if (indicationRotation >= dot.getRotation()) { delta = indicationRotation - dot.getRotation(); } else { delta = -indicationRotation + dot.getRotation(); } } } delta -= e; if (indicator.clockwise) { if (isSameSide(indicationRotation, dot.getRotation())) { Log.writeLog("Aloha1"); if (indicationRotation < dot.getRotation()) { if (delta > dotBeta / 2) { Log.writeLog("Check over 1"); Log.writeLog("Indicator Rotation", "" + indicationRotation); Log.writeLog("Dot Rotation", "" + dot.getRotation()); Log.writeLog("Delta 2", "" + delta); Log.writeLog("Dot beta", "" + dotBeta / 2); Log.writeLog("Indicator beta", "" + indicatorBeta / 8); Log.writeLog("Tach."); stopGame(2); } } } else { Log.writeLog("Aloha2"); if (dot.getRotation() >= 180 && dot.getRotation() <= 270) { if (indicationRotation <= dot.getRotation()) { if (delta > dotBeta / 2) { Log.writeLog("Check over 2"); Log.writeLog("Indicator Rotation", "" + indicationRotation); Log.writeLog("Dot Rotation", "" + dot.getRotation()); Log.writeLog("Delta 2", "" + delta); Log.writeLog("Dot beta", "" + dotBeta / 2); Log.writeLog("Indicator beta", "" + indicatorBeta / 8); Log.writeLog("Tach."); stopGame(2); } } } else if (dot.getRotation() >= 0 && dot.getRotation() <= 90) { if (indicationRotation >= dot.getRotation()) { if (delta > dotBeta / 2) { Log.writeLog("Check over 4"); Log.writeLog("Indicator Rotation", "" + indicationRotation); Log.writeLog("Dot Rotation", "" + dot.getRotation()); Log.writeLog("Delta 2", "" + delta); Log.writeLog("Dot beta", "" + dotBeta / 2); Log.writeLog("Indicator beta", "" + indicatorBeta / 8); Log.writeLog("Tach."); stopGame(2); } } } } } else { if (isSameSide(indicationRotation, dot.getRotation())) { Log.writeLog("Aloha3"); if (indicationRotation > dot.getRotation()) { if (delta > dotBeta / 2) { Log.writeLog("Check over 3"); Log.writeLog("Indicator Rotation", "" + indicationRotation); Log.writeLog("Dot Rotation", "" + dot.getRotation()); Log.writeLog("Delta 2", "" + delta); Log.writeLog("Dot beta", "" + dotBeta / 2); Log.writeLog("Indicator beta", "" + indicatorBeta / 8); Log.writeLog("Tach."); stopGame(2); } } } else { Log.writeLog("Aloha4"); if (dot.getRotation() >= 270 && dot.getRotation() <= 360) { if (indicationRotation <= dot.getRotation()) { if (delta > dotBeta / 2) { Log.writeLog("Check over 4"); Log.writeLog("Indicator Rotation", "" + indicationRotation); Log.writeLog("Dot Rotation", "" + dot.getRotation()); Log.writeLog("Delta 2", "" + delta); Log.writeLog("Dot beta", "" + dotBeta / 2); Log.writeLog("Indicator beta", "" + indicatorBeta / 8); Log.writeLog("Tach."); stopGame(2); } } } else if (dot.getRotation() >= 90 && dot.getRotation() < 180) { if (indicationRotation >= dot.getRotation()) { if (delta > dotBeta / 2) { Log.writeLog("Check over 4"); Log.writeLog("Indicator Rotation", "" + indicationRotation); Log.writeLog("Dot Rotation", "" + dot.getRotation()); Log.writeLog("Delta 2", "" + delta); Log.writeLog("Dot beta", "" + dotBeta / 2); Log.writeLog("Indicator beta", "" + indicatorBeta / 8); Log.writeLog("Tach."); stopGame(2); } } } } } } } } private boolean isSameSide(double angle1, double angle2) { return ((angle1 >= 0 && angle2 >= 0 && angle1 <= 180 && angle2 <= 180) || (angle1 >= 180 && angle2 >= 180 && angle1 <= 360 && angle2 <= 360)); } private double recalculateAngleIfNeed(double angle) { double tmp = angle; if (angle < 0) { tmp = 360 + angle; } if (angle >= 360) { tmp = angle - 360; } return tmp; } @Override public void onPressFinish() { SoundHelper.getInstance().playFinishLevelSound(); if (gameMode != Constants.GameMode.UNLIMITED) { flash.appear(splashStage); indicator.fadeOut(); dot.fadeOut(1); } } @Override public void onDisappear(Flash flash) { touchable = true; flash.isAppear = false; flash.getParent().removeActor(flash); updateTextView(1); updateTextView(2); playAgain = false; if (gameMode != Constants.GameMode.UNLIMITED) { if (classicLevel % CLASSIC_COLOR_STEP == 0) { classicColorIndex++; currentBackgroundColor = ColorHelper.getInstance().getBackgroundColor(classicColorIndex); ColorHelper.getInstance().setColor(classicColorIndex, lens2, lens3, lens4); } } } private void initTextView() { level = new TextView(Gdx.files.internal(AssetsLoader.getInstance().getFontPath() + "merlo_level.fnt"), Gdx.files.internal(AssetsLoader.getInstance().getFontPath() + "merlo_level.png")); index = new TextView(Gdx.files.internal(AssetsLoader.getInstance().getFontPath() + "merlo_index.fnt"), Gdx.files.internal(AssetsLoader.getInstance().getFontPath() + "merlo_index.png")); classicType = new TextView(Gdx.files.internal(AssetsLoader.getInstance().getFontPath() + "merlo_mode.fnt"), Gdx.files.internal(AssetsLoader.getInstance().getFontPath() + "merlo_mode.png")); updateTextView(1); updateTextView(2); updateTextView(3); stage.addActor(level); stage.addActor(index); splashStage.addActor(classicType); } private void initButton() { float widthAspectRatio = fitViewport.getWorldWidth() / screenViewport.getWorldWidth(); float heightAspectRatio = fitViewport.getWorldHeight() / screenViewport.getWorldHeight(); float aspectRatio = (widthAspectRatio > heightAspectRatio) ? widthAspectRatio : heightAspectRatio; if (SoundHelper.enableSound) { soundButton = new Button(atlas, "on_sound"); } else { soundButton = new Button(atlas, "press_sound"); } soundButton.setSize(soundButton.getWidth() / aspectRatio, soundButton.getHeight() / aspectRatio); soundButton.setPosition(screenViewport.getWorldWidth() - soundButton.getWidth() * 1.25f, screenViewport.getWorldHeight() - soundButton.getHeight() * 1.25f); soundButton.addTo(splashStage); if (VibrationHelper.enableVibration) { vibrationButton = new Button(atlas, "on_vibrate"); } else { vibrationButton = new Button(atlas, "press_vibrate"); } vibrationButton.setSize(vibrationButton.getWidth() / aspectRatio, vibrationButton.getHeight() / aspectRatio); vibrationButton.setPosition(soundButton.getX() - 5 * vibrationButton.getWidth() / 4, soundButton.getY()); vibrationButton.addTo(splashStage); backButton = new Button(atlas, "btn_back"); backButton.setSize(backButton.getWidth() / aspectRatio, backButton.getHeight() / aspectRatio); backButton.setPosition(backButton.getWidth() / 4, backButton.getHeight() / 4); backButton.addTo(splashStage); backButton.setVisible(false); touchOffset = soundButton.getWidth() / 4f; } private void loadData() { preferences = Gdx.app.getPreferences(Constants.APP_TITLE); SoundHelper.enableSound = preferences.getBoolean("sound", true); VibrationHelper.enableVibration = preferences.getBoolean("vibration", true); ColorHelper.getInstance().initColor(); if (gameMode == Constants.GameMode.UNLIMITED) { unlimitedBestScore = preferences.getInteger("unlimited_best_score", 0); currentBackgroundColor = ColorHelper.getInstance().getBackGroundColorUnlimitedMode(unlimitedScore); } else { if (gameMode == Constants.GameMode.CLASSIC_SLOW) { classicLevel = preferences.getInteger("classic_slow", 1); } else if (gameMode == Constants.GameMode.CLASSIC_MEDIUM) { classicLevel = preferences.getInteger("classic_medium", 1); } else if (gameMode == Constants.GameMode.CLASSIC_FAST) { classicLevel = preferences.getInteger("classic_fast", 1); } else if (gameMode == Constants.GameMode.CLASSIC_CRAZY) { classicLevel = preferences.getInteger("classic_crazy", 1); } classicScore = classicLevel; classicColorIndex = classicLevel / CLASSIC_COLOR_STEP; currentBackgroundColor = ColorHelper.getInstance().getBackgroundColor(classicColorIndex); } } private void saveData() { preferences = Gdx.app.getPreferences(Constants.APP_TITLE); preferences.putBoolean("sound", SoundHelper.enableSound); preferences.putBoolean("vibration", VibrationHelper.enableVibration); if (gameMode == Constants.GameMode.UNLIMITED) { preferences.putInteger("unlimited_best_score", unlimitedBestScore); } else { if (gameMode == Constants.GameMode.CLASSIC_SLOW) { preferences.putInteger("classic_slow", classicLevel); } else if (gameMode == Constants.GameMode.CLASSIC_MEDIUM) { preferences.putInteger("classic_medium", classicLevel); } else if (gameMode == Constants.GameMode.CLASSIC_FAST) { preferences.putInteger("classic_fast", classicLevel); } else if (gameMode == Constants.GameMode.CLASSIC_CRAZY) { preferences.putInteger("classic_crazy", classicLevel); } } preferences.flush(); } @Override public void onFadeOutComplete(int type) { switch (type) { case 1: dot.initPosition(); playAgain = false; break; case 2: dot.randomPosition(currentOrientation); break; } if (!flash.isAppear) { touchable = true; } dot.fadeIn(type); } @Override public void onFadeInComplete(int type) { if (type == 1) { indicator.resetAngle(); if (gameMode == Constants.GameMode.UNLIMITED) { ColorHelper.getInstance().setColorUnlimitedMode(unlimitedScore, lens2, lens3, lens4); currentBackgroundColor = ColorHelper.getInstance().getBackGroundColorUnlimitedMode(0); } else { currentBackgroundColor = ColorHelper.getInstance().getBackgroundColor(classicColorIndex); } if (dot.getRotation() >= 0 && dot.getRotation() <= 180) { indicator.clockwise = false; } else if (dot.getRotation() > 180 && dot.getRotation() < 360) { indicator.clockwise = true; } } checkable = true; } public void updateTextView(int type) { switch (type) { case 1://update Level if (gameMode == Constants.GameMode.UNLIMITED) { if (unlimitedBestScore <= 999) { level.setText("My Best: " + unlimitedBestScore); } else { level.setText("My Best: 999+"); } } else { if (classicLevel <= 999) { level.setText("Level: " + classicLevel); } else { level.setText("Level: 999+"); } } level.setPosition(stage.getViewport().getWorldWidth() / 2 - level.getWidth() / 2, stage.getViewport().getWorldHeight() / 3.5f - level.getHeight()); break; case 2://update Index if (gameMode == Constants.GameMode.UNLIMITED) { index.setText("" + unlimitedScore); index.setX(stage.getViewport().getWorldWidth() / 2 - index.getWidth() / 2); if (unlimitedScore >= unlimitedBestScore) { unlimitedBestScore = unlimitedScore; updateTextView(1); } } else { index.setText("" + classicScore); } index.setPosition(stage.getViewport().getWorldWidth() / 2 - index.getWidth() / 2, 3 * stage.getViewport().getWorldHeight() / 4 + 1.5f * index.getHeight()); break; case 3: if (gameMode == Constants.GameMode.UNLIMITED) { classicType.setText("No limit"); } else { if (gameMode == Constants.GameMode.CLASSIC_SLOW) { classicType.setText("Slow"); } else if (gameMode == Constants.GameMode.CLASSIC_MEDIUM) { classicType.setText("Medium"); } else if (gameMode == Constants.GameMode.CLASSIC_FAST) { classicType.setText("Fast"); } else { classicType.setText("Crazy"); } } float aspectRatio = screenViewport.getWorldHeight() / fitViewport.getWorldHeight(); classicType.setScale(aspectRatio, aspectRatio); classicType.setPosition(screenViewport.getWorldWidth() - (soundButton.getX() + soundButton.getWidth()), soundButton.getY() + soundButton.getHeight() / 2); break; } } public void setOnGameListener(OnGameListener onGameListener) { this.onGameListener = onGameListener; } public void setGameMode(Constants.GameMode gameMode) { this.gameMode = gameMode; } public Constants.GameMode getGameMode() { return gameMode; } private void resetScoreAtUnlimitedModeIfNeeded() { if (gameMode == Constants.GameMode.UNLIMITED) { saveData(); unlimitedScore = 0; unlimitedColorIndex = 0; gameMode.resetUnlimitedSpeed(); indicator.setSpeed(gameMode.getSpeed()); } } private void increaseUnlimitedSeedIfNeeded() { if (gameMode == Constants.GameMode.UNLIMITED) { unlimitedScore++; updateTextView(2); if (unlimitedScore % Constants.GameMode.UNLIMITED_INCREASING_POINT == 0) { indicator.setSpeed(gameMode.getUnlimitedNewSpeed()); } } } public void reset() { touchable = true; playAgain = false; checkable = true; loadData(); dot.initPosition(); if (dot.getRotation() >= 0 && dot.getRotation() <= 180) { indicator.clockwise = false; } else if (dot.getRotation() > 180 && dot.getRotation() < 360) { indicator.clockwise = true; } indicator.resetAngle(); backButton.setVisible(false); updateTextView(1); updateTextView(2); updateTextView(3); } public static interface OnGameListener { public void onLossGame(GDXGameLauncher gameLauncher, Constants.GameMode gameMode, int currentLevel, int score); void onGameBackPressed(); } }
package com.linkan.githubtrendingrepos.data.local.db; import com.linkan.githubtrendingrepos.data.local.dao.AppDatabase; import com.linkan.githubtrendingrepos.data.model.api.TrendingResponse; import com.linkan.githubtrendingrepos.data.model.db.TrendingRepo; import java.util.List; import java.util.concurrent.Callable; import javax.inject.Inject; import io.reactivex.Observable; public class AppDbHelper implements DbHelper { private AppDatabase appDatabase; @Inject public AppDbHelper(AppDatabase appDatabase) { this.appDatabase = appDatabase; } @Override public Observable<Boolean> insertRepo(TrendingRepo trendingRepo) { return Observable.fromCallable(() -> { appDatabase.repoDao().insertRepo(trendingRepo); return true; }); } @Override public Observable<Boolean> insertMultipleListRepo(List<TrendingRepo> repoList) { return Observable.fromCallable(() -> { appDatabase.repoDao().insertMultipleListRepo(repoList); return true; }); } @Override public Observable<List<TrendingRepo>> loadAllRepo() { return Observable.fromCallable(() -> appDatabase.repoDao().loadAllRepo()); } @Override public Observable<Boolean> deleteRepo(TrendingRepo trendingRepo) { return Observable.fromCallable(() -> { appDatabase.repoDao().deleteRepo(trendingRepo); return true; }); } @Override public Observable<Boolean> deleteRepoRecord() { return Observable.fromCallable(() -> { appDatabase.repoDao().deleteRepoRecord(); return true; }); } }
package pe.gob.sunarp.incidenciasapp.service.implementacion; import java.util.ArrayList; import java.util.List; import pe.gob.sunarp.incidenciasapp.dto.IncidenteDto; public class DataIncidencia { public DataIncidencia() { } static String[] arregloTipos; // = {"JAVA", "ORACLE", "SPRING"}; static List<IncidenteDto> incidencias; static{ arregloTipos = new String[] {"NORMAL", "COTIDIANO", "IMPORTANTE","URGENTE","ALARMA"}; incidencias = new ArrayList<>(); } }
package com.orca.app; import static org.junit.Assert.assertTrue; import org.junit.*; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import com.orca.domain.Evaluation; import com.orca.domain.Functionality; import com.orca.domain.Survey; import com.orca.factory.EvaluationFactory; @ContextConfiguration( locations = { "/root-context.xml" , "/controllers.xml" }) @RunWith(SpringJUnit4ClassRunner.class) public class SurveyTests { @Autowired EvaluationFactory factory; @Test public void surveyScoreTest(){ Evaluation evaluation = factory.createEvalution(); Survey survey = evaluation.getSurveyList().get(0); evaluation.setCodeWeight(50); // sets weight for CodeDesign, CodeRuntime, and CodeStatic assertTrue(survey.getScore()==61.0); } }
package com.freejavaman; import android.app.Activity; import android.os.Bundle; import android.view.Menu; import android.view.MenuItem; import android.view.SubMenu; public class UI_Menu extends Activity { public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); } //設定每一個選項獨一無二的ID private static final int Item_file = Menu.FIRST; private static final int Item_save = Menu.FIRST + 1; private static final int Item_saveAs = Menu.FIRST + 2; private static final int Item_edit = Menu.FIRST + 3; private static final int Item_copy = Menu.FIRST + 4; private static final int Item_delete = Menu.FIRST + 5; //建立選單物件的選項 public boolean onCreateOptionsMenu(Menu menu) { //建立第一個Menu SubMenu sub1 = menu.addSubMenu(Menu.NONE, Item_file, 0, "檔案"); sub1.add(Menu.NONE, Item_save, 0, "儲存"); sub1.add(Menu.NONE, Item_saveAs, 1, "另存新檔"); //建立第二個Menu SubMenu sub2 = menu.addSubMenu(Menu.NONE, Item_edit, 1, "編輯"); sub2.add(Menu.NONE, Item_copy, 0, "複製"); sub2.add(Menu.NONE, Item_delete, 1, "刪除"); return super.onCreateOptionsMenu(menu); } //根據選項的ID, 進行對映的動作 public boolean onOptionsItemSelected(MenuItem item) { switch(item.getItemId()) { case Item_file: break; case Item_save: break; case Item_saveAs: break; case Item_edit: break; case Item_copy: break; case Item_delete: break; default:break; } return super.onOptionsItemSelected(item); } }
package com.hyty.tree.treejiegou.entity; import com.alibaba.fastjson.annotation.JSONField; import org.hibernate.annotations.GenericGenerator; import javax.persistence.*; import javax.validation.constraints.NotNull; import java.io.Serializable; import java.util.HashSet; import java.util.Set; /** * Created by Whk on 2019/3/28. * 角色权限表 * 本表头信息(多)与体信息:系统角色表(多)关联 * 本表头信息(一)与体信息:业务模块表(多)关联 */ @Entity public class RoleJurisdiction implements Serializable { /** * 主键 */ @Id @GenericGenerator(name = "system-uuid", strategy = "uuid") @GeneratedValue(generator = "system-uuid") @Column(length = 32, unique = true) private String id; /** * 1.角色标识 */ @Column(name = "ROLELOGO", length = 200) private String roleLogo; /** * 2.多对一---角色编号 */ @NotNull(message = "角色编号不能为空") @Column(name = "ROLENUMBER", length = 200) private String roleNumber; /** * 3.权限标识 */ @Column(name = "JURISDICTIONLOGO", length = 200) private String JurisdictionLogo; /** * 4.权限编号+++一对多 */ @Column(name = "JURISDICTIONNUMBER", length = 200) private String JurisdictionNumber; /** * 角色权限(多)与企业员工(多)_关联 */ @JSONField(serialize = false) @ManyToMany(cascade = {CascadeType.DETACH, CascadeType.REFRESH}, fetch = FetchType.EAGER) private Set<Personnel> personnels = new HashSet<>(); /** * 本表(角色权限表):头信息(一) * 头信息:业务系统表(一)与体信息:业务模块表(多)关联 */ @JoinColumn(name = "businessModule_id") @ManyToOne(cascade = CascadeType.DETACH, fetch = FetchType.EAGER) private BusinessModule businessModule; @Transient private String businessModuleId; public String getId() { return id; } public void setId(String id) { this.id = id; } public String getRoleLogo() { return roleLogo; } public void setRoleLogo(String roleLogo) { this.roleLogo = roleLogo; } public String getRoleNumber() { return roleNumber; } public void setRoleNumber(String roleNumber) { this.roleNumber = roleNumber; } public String getJurisdictionLogo() { return JurisdictionLogo; } public void setJurisdictionLogo(String jurisdictionLogo) { JurisdictionLogo = jurisdictionLogo; } public String getJurisdictionNumber() { return JurisdictionNumber; } public void setJurisdictionNumber(String jurisdictionNumber) { JurisdictionNumber = jurisdictionNumber; } public BusinessModule getBusinessModule() { return businessModule; } public void setBusinessModule(BusinessModule businessModule) { this.businessModule = businessModule; } public String getBusinessModuleId() { return businessModuleId; } public void setBusinessModuleId(String businessModuleId) { this.businessModuleId = businessModuleId; } public Set<Personnel> getPersonnels() { return personnels; } public void setPersonnels(Set<Personnel> personnels) { this.personnels = personnels; } }
package com.pointburst.jsmusic.parser; import com.pointburst.jsmusic.network.ServiceResponse; /** * Created by FARHAN on 12/27/2014. */ public interface IParser { public ServiceResponse parseData(int eventType, String data); }
/* * Copyright 1999-2011 Alibaba Group. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.pajk.pt.examples.dubbo.demo; import java.io.IOException; import java.util.List; import java.util.Map; public interface DemoService { void helloWorld(); String sayHello(String name); String sayHello1(String name) throws IOException; String sayHello2(String name); void simpleBeanCall1(SimpleBean simpleBean); Map simpleBeanCall2(Map map); List<ComplexBean.Entity> complexBeanCall1(List<ComplexBean.Entity> complexBeans); ComplexBean.Entity[] complexBeanCall2(ComplexBean.Entity[] complexBeans, ComplexBean.Entity complexBean); }
package com.smxknfie.springcloud.netflix.eureka.feign.hystrix; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker; import org.springframework.cloud.client.discovery.EnableDiscoveryClient; import org.springframework.cloud.openfeign.EnableFeignClients; /** * @author smxknife * 2018/9/8 */ @SpringBootApplication @EnableDiscoveryClient @EnableCircuitBreaker @EnableFeignClients public class EurekaFeignHystrixApp { public static void main(String[] args) { SpringApplication.run(EurekaFeignHystrixApp.class, args); } }
package tc.selenium.container; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; /** * Finds web elements by id from the summary view * * @author sian.webster */ public class SummaryContainer { @FindBy(id="name") public WebElement name; @FindBy(id="age") public WebElement age; @FindBy(id="gender") public WebElement gender; @FindBy(id="height") public WebElement height; @FindBy(id="confirmed") public WebElement confirmed; }
package zxn.dao; import zxn.domain.User; public interface UserDao { public void addUser(User user); public User findUser(String username, String password); }
package com.CodingSheep.test.framework; /** * @author Jarrod Raine */ public enum ObjectId { Player(), Block(), Bullet(), Flag(); }
package three; public class TernaryIfElse { static int ternary(int i){ return i<10?i*100:i*10; } static int standardIfElse(int i) { if(i<10) { return i*10; }else { return i*100; } } public static void main(String[] args) { System.out.println(ternary(9)); System.out.println(ternary(10)); System.out.println(standardIfElse(9)); System.out.println(standardIfElse(10)); } }
package com.learnJava.ngnix; import java.util.Arrays; import java.util.List; import java.util.stream.IntStream; public class BatchProcessing { public static void main(String[] args) { List<Integer> intList = Arrays.asList(1,2,3,4,5); int BATCH = 3; IntStream.range(0, (intList.size()+BATCH-1)/BATCH) .mapToObj(i -> intList.subList(i*BATCH, Math.min(intList.size(), (i+1)*BATCH))) .forEach(batch -> process(batch)); } private static void process(List<Integer> batch) { System.out.println("============" + batch); } }
public class TicketTester { public static void main(String[] args) { Advance ticket1 = new Advance(4); Advance ticket2 = new Advance(15); StudentAdvance ticket3 = new StudentAdvance(5); StudentAdvance ticket4 = new StudentAdvance(20); Ticket[] tickets = new Ticket[] {ticket1, ticket2, ticket3, ticket4}; System.out.println("\n-------\n"); for (Ticket t: tickets) { System.out.println(t.toString()); System.out.println("\n-------\n"); } } }
package com.kerbii.undersiege; import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.FloatBuffer; import javax.microedition.khronos.opengles.GL10; public abstract class GameObject { /** * Location data * * Different location dependent on type (mobs top left, arrows right center, etc) */ public float x, y, angle; public float width, height; /** * Texture data */ public int textureIndex; public long millisPerFrame = 150; public long millisSinceLastFrame = 0; /** Buffer holding vertices */ public FloatBuffer vertexBuffer; /** Buffer holding textures */ public FloatBuffer textureBuffer; /** Buffer holding indices */ public ByteBuffer indexBuffer; /** Texture definition */ public float texture[] = { 0.0f, 1.0f, 1.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f }; /** The order to connect vertices */ public byte[] indices = { 0, 1, 3, 0, 3, 2 }; public float alpha; public boolean draw; public QuadTreeNode node; /** * Initialize all global variables * @param x * @param y * @param width * @param height * @param vertices */ public GameObject(float x, float y, float width, float height, float[] vertices) { this.x = x; this.y = y; this.width = width; this.height = height; ByteBuffer byteBuf = ByteBuffer.allocateDirect(vertices.length * 4); byteBuf.order(ByteOrder.nativeOrder()); vertexBuffer = byteBuf.asFloatBuffer(); vertexBuffer.put(vertices); vertexBuffer.position(0); byteBuf = ByteBuffer.allocateDirect(texture.length * 4); byteBuf.order(ByteOrder.nativeOrder()); textureBuffer = byteBuf.asFloatBuffer(); textureBuffer.put(texture); textureBuffer.position(0); indexBuffer = ByteBuffer.allocateDirect(indices.length * 2); indexBuffer.put(indices); indexBuffer.position(0); alpha = 1; draw = true; } public abstract void update(long deltaTime); public void draw(GL10 gl, int textures[]) { //Bind previous generated texture gl.glBindTexture(GL10.GL_TEXTURE_2D, textures[textureIndex]); //Point to vertex and texture buffer gl.glVertexPointer(3, GL10.GL_FLOAT, 0, vertexBuffer); gl.glTexCoordPointer(2, GL10.GL_FLOAT, 0, textureBuffer); gl.glColor4f(1, 1, 1, alpha); //Draw gl.glDrawElements(GL10.GL_TRIANGLES, indices.length, GL10.GL_UNSIGNED_BYTE, indexBuffer); } public void setNode(QuadTreeNode node) { this.node = node; } public void changeVertices(float[] vertices) { ByteBuffer byteBuf = ByteBuffer.allocateDirect(vertices.length * 4); byteBuf.order(ByteOrder.nativeOrder()); vertexBuffer = byteBuf.asFloatBuffer(); vertexBuffer.put(vertices); vertexBuffer.position(0); } public float distance(float xTarget, float yTarget) { float distanceX = Math.abs(xTarget - (x + width / 2)); float distanceY = Math.abs(yTarget - (y + height / 2)); return (float) Math.sqrt(distanceX * distanceX + distanceY * distanceY); } public float distance(GameObject object) { return distance(object.x + (object.width / 2), object.y + (object.height / 2)); } }
package LinkedList; import java.lang.Math; public class Practice3 { public static void main(String[] args) { /*String s="abcd efgh"; int i=9; int j=90; int k=Math.min(i,j); System.out.println(k); String str[]=s.split(""); System.out.println(str.length); char[] chr= {'a','b','c'}; int l=chr.length;*/ String ss="5*5"; System.out.println(Integer.valueOf(ss)); } }
package com.mz.API.repository; import java.util.Optional; import org.springframework.data.jpa.repository.JpaRepository; import com.mz.API.model.Rol; import com.mz.API.model.RoleName; public interface RolRepository extends JpaRepository<Rol, Long> { Optional<Rol> findByName(RoleName roleName); }
package pe.gob.trabajo.repository.search; import pe.gob.trabajo.domain.Dirpernat; import org.springframework.data.elasticsearch.repository.ElasticsearchRepository; /** * Spring Data Elasticsearch repository for the Dirpernat entity. */ public interface DirpernatSearchRepository extends ElasticsearchRepository<Dirpernat, Long> { }
/** * */ package com.goodhealth.algorithm.Test; /** * @author 24663 * @date 2018年12月19日 * @Description */ public class SpecialChar { public static void main(String[] args) { System.out.println("测试语句"); System.out.println("测试语句'"); System.out.println("测试语句\n");// \n换行 System.out.println("测试语句\r");// \r回车 System.out.println("测试语句\t春日融融");// \t 空格 System.out.println("测试语句\b春日迟迟");// \b退格 } }
package net.plazmix.core.api.common.orm.mysql; import net.plazmix.core.api.common.orm.*; import org.apache.commons.lang.StringUtils; import javax.sql.DataSource; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.util.*; import java.util.concurrent.atomic.AtomicInteger; import java.util.function.Function; import java.util.stream.Collectors; import java.util.stream.StreamSupport; public class MySqlDataContainer<T, ID> extends AbstractDataContainer<T, ID> { private static String getDatabaseType(Class<?> clazz, boolean unique, int length) { if (clazz.isAssignableFrom(Long.class)) return "BIGINT"; else if (clazz.isAssignableFrom(Integer.class)) return "MEDIUMINT"; else if (clazz.isAssignableFrom(Short.class)) return "SMALLINT"; else if (clazz.isAssignableFrom(Byte.class) || clazz.isAssignableFrom(Boolean.class)) return "TINYINT"; else if (clazz.isAssignableFrom(Double.class)) return "DOUBLE"; else if (clazz.isAssignableFrom(Float.class)) return "FLOAT"; else if (clazz.isAssignableFrom(String.class)) { if (unique) return String.format("VARCHAR(%s)", length); else return "MEDIUMTEXT"; } else return null; } private final DataSource dataSource; public MySqlDataContainer(String name, DataSource dataSource, Map<String, Column> columnMap, Function<Data, T> objectMapper, Function<T, Data> dataMapper) { super(name, columnMap, objectMapper, dataMapper); this.dataSource = dataSource; } @Override public void create() { String values = StringUtils.join(StreamSupport.stream(getColumns().spliterator(), false) .map(column -> { String type = getDatabaseType(column.getType(), column.isUnique() || column.isPrimary(), column.length()); if (type == null) throw new IllegalArgumentException("Unsupported column type: " + column.getType().getSimpleName()); StringBuilder valueBuilder = new StringBuilder( "`" + column.getName() + "` " + type); if (column.isPrimary()) valueBuilder.append(" PRIMARY KEY"); else if (column.isUnique()) valueBuilder.append(" UNIQUE"); else if (!column.isNullable()) valueBuilder.append(" NOT NULL"); return valueBuilder.toString(); }).collect(Collectors.toList()), ", "); String sql = String.format( "CREATE TABLE IF NOT EXISTS `%s` (%s);", getName(), values); try (Connection connection = dataSource.getConnection()) { connection.createStatement().execute(sql); } catch (SQLException e) { e.printStackTrace(); } } @Override public void delete() { try (Connection connection = dataSource.getConnection()) { connection.createStatement().execute(String.format("DROP TABLE %s;", getName())); } catch (SQLException e) { e.printStackTrace(); } } private QueryInfo getSaveSql() { AtomicInteger index = new AtomicInteger(1); Map<Integer, Column> preparedColumns = new HashMap<>(); String columns = StringUtils.join(StreamSupport.stream(getColumns().spliterator(), false) .map(column -> String.format("`%s`", column.getName())) .collect(Collectors.toList()), ", "), insertChars = StringUtils.join(StreamSupport.stream(getColumns().spliterator(), false) .map(column -> { preparedColumns.put(index.getAndIncrement(), column); return "?"; }) .collect(Collectors.toList()), ", "), updateColumns = StringUtils.join(StreamSupport.stream(getColumns().spliterator(), false) .filter(Column::isUpdatable) .map(column -> String.format("`%s` = VALUES(`%s`)", column.getName(), column.getName())) .collect(Collectors.toList()), ", "); return new QueryInfo(String.format("INSERT INTO `%s` (%s) VALUES (%s) ON DUPLICATE KEY UPDATE %s;", getName(), columns, insertChars, updateColumns), preparedColumns); } private QueryInfo getUpdateSql() { AtomicInteger index = new AtomicInteger(1); Map<Integer, Column> preparedColumns = new HashMap<>(); String set = StringUtils.join(StreamSupport.stream(getColumns().spliterator(), false) .filter(Column::isUpdatable) .map(column -> { preparedColumns.put(index.getAndIncrement(), column); return column.getName() + "=?"; }) .collect(Collectors.toList()), ", "); preparedColumns.put(index.incrementAndGet(), getPrimaryColumn()); return new QueryInfo(String.format("UPDATE `%s` SET %s WHERE `%s`=?", getName(), set, getPrimaryColumn().getName()), preparedColumns); } @Override public T save(T entity) { Data data = getDataMapper().apply(entity); try (Connection connection = dataSource.getConnection()) { QueryInfo queryInfo = getSaveSql(); PreparedStatement statement = connection.prepareStatement(queryInfo.getQuery()); if (queryInfo.isPrepared()) { for (int i = 1; i <= queryInfo.getMaxIndex(); i++) { Column column = queryInfo.getColumn(i); setValue(column, data.getObjectValue(column.getName(), null), statement, i); } } statement.execute(); } catch (SQLException e) { e.printStackTrace(); } return entity; } @Override public Iterable<T> saveAll(Iterable<T> entities) { for (T entity : entities) save(entity); return entities; } @Override public T update(T entity) { Data data = getDataMapper().apply(entity); try (Connection connection = dataSource.getConnection()) { QueryInfo queryInfo = getUpdateSql(); PreparedStatement statement = connection.prepareStatement(queryInfo.getQuery()); if (queryInfo.isPrepared()) { for (int i = 1; i <= queryInfo.getMaxIndex(); i++) { Column column = queryInfo.getColumn(i); setValue(column, data.getObjectValue(column.getName(), null), statement, i); } } statement.execute(); } catch (SQLException e) { e.printStackTrace(); } return entity; } @Override public Iterable<T> updateAll(Iterable<T> entities) { for (T entity : entities) update(entity); return entities; } @Override public Optional<T> findById(ID id) { String values = StringUtils.join(getColumnNames().stream().map(name -> "`" + name + "`").collect(Collectors.toList()), ", "); String sql = String.format("SELECT %s FROM `%s` WHERE `%s`=? LIMIT 1;", values, getName(), getPrimaryColumn().getName()); boolean found = false; Data data = new HashMapData(); data.writeObjectValue(getPrimaryColumn().getName(), id); try (Connection connection = dataSource.getConnection()) { PreparedStatement statement = connection.prepareStatement(sql); statement.setObject(1, id); ResultSet resultSet = statement.executeQuery(); if (resultSet.next()) { found = true; for (Column column : getColumns()) { if (column.isPrimary()) continue; data.writeObjectValue(column.getName(), resultSet.getObject(column.getName())); } } statement.execute(); } catch (SQLException e) { e.printStackTrace(); } return Optional.ofNullable(found ? getObjectMapper().apply(data) : null); } @Override public Iterable<T> findAll() { String sql = String.format("SELECT * FROM `%s`;", getName()); List<T> list = new ArrayList<>(); try (Connection connection = dataSource.getConnection()) { PreparedStatement statement = connection.prepareStatement(sql); ResultSet resultSet = statement.executeQuery(); if (resultSet.next()) { Data data = new HashMapData(); for (Column column : getColumns()) data.writeObjectValue(column.getName(), resultSet.getObject(column.getName())); T result = getObjectMapper().apply(data); if (result != null) list.add(result); } statement.execute(); } catch (SQLException e) { e.printStackTrace(); } return list; } @Override public Iterable<T> findAllById(Iterable<ID> ids) { List<T> list = new ArrayList<>(); for (ID id : ids) findById(id).ifPresent(list::add); return list; } @Override public void deleteById(ID id) { try (Connection connection = dataSource.getConnection()) { PreparedStatement statement = connection.prepareStatement(String.format("DELETE FROM `%s` WHERE `%s`=?;", getName(), getPrimaryColumn().getName())); statement.setObject(1, id); statement.execute(); } catch (SQLException e) { e.printStackTrace(); } } @SuppressWarnings("unchecked") @Override public void delete(T entity) { Data data = getDataMapper().apply(entity); deleteById((ID) data.getObjectValue(getPrimaryColumn().getName())); } @Override public void deleteAll(Iterable<T> entities) { for (T entity : entities) delete(entity); } @Override public void deleteAll() { try (Connection connection = dataSource.getConnection()) { connection.createStatement().execute(String.format("DELETE FROM %s;", getName())); } catch (SQLException e) { e.printStackTrace(); } } private void setValue(Column column, Object value, PreparedStatement statement, int index) throws SQLException { if (getDatabaseType(column.getType(), false, 0) == null) throw new IllegalArgumentException("Unsupported class type: " + column.getType().getSimpleName()); statement.setObject(index, value); } }
package testcase; import es.utils.mapper.Mapper; import es.utils.mapper.exception.MappingException; import es.utils.mapper.exception.MappingNotFoundException; import from.FromPrimitivesWrap; import org.junit.jupiter.api.Test; import to.ToPrimitivesWrap; import static org.assertj.core.api.Assertions.assertThat; public class PrimitiveWrapTest { @Test public void shouldCreateMapper() throws MappingException, MappingNotFoundException { Mapper mapper = new Mapper(); mapper.add(FromPrimitivesWrap.class,ToPrimitivesWrap.class); FromPrimitivesWrap from = new FromPrimitivesWrap(); from.setN1(1); from.setN2(2); from.setN3(3); from.setN4(4); ToPrimitivesWrap to = mapper.map(from,ToPrimitivesWrap.class); assertThat(to.getN1()).isEqualTo(1); assertThat(to.getN2()).isEqualTo(2); assertThat(to.getN3()).isEqualTo(3); assertThat(to.getN4()).isEqualTo(4); } }
package com.example.ahmed.octopusmart.Activity.Base; import android.content.ComponentName; import android.content.Intent; import android.support.design.widget.Snackbar; import android.support.v4.app.Fragment; import android.support.v7.app.AppCompatActivity; import android.view.View; import com.example.ahmed.octopusmart.R; /** * Created by Ahmed on 10/27/2017. */ public abstract class FragmentSwitchActivity extends AppCompatActivity { public void showFragment(Fragment fragment , boolean back){ if(fragment != null){ if (back){ getSupportFragmentManager() .beginTransaction() //.setCustomAnimations(ENTER_ANIM , LEAVE_ANIM , ENTER_ANIM , LEAVE_ANIM) .replace(R.id.fragment_container, fragment) .addToBackStack(null) .commit(); }else { getSupportFragmentManager() .beginTransaction() //.setCustomAnimations(ENTER_ANIM , LEAVE_ANIM , ENTER_ANIM , LEAVE_ANIM) .replace(R.id.fragment_container, fragment) .commit(); } } } public void showFragment(Fragment fragment , boolean back , int anim_enter , int exit_anim ){ if(fragment != null){ if (back){ getSupportFragmentManager() .beginTransaction() //.setCustomAnimations(anim_enter , exit_anim) .replace(R.id.fragment_container, fragment) .addToBackStack(null) .commit(); }else { getSupportFragmentManager() .beginTransaction() //.setCustomAnimations(ENTER_ANIM , LEAVE_ANIM) .replace(R.id.fragment_container, fragment) .commit(); } } } public void showFragment(Fragment fragment , String tag ){ if(fragment != null){ getSupportFragmentManager() .beginTransaction() //.setCustomAnimations(ENTER_ANIM , LEAVE_ANIM) .replace(R.id.fragment_container, fragment) .addToBackStack(tag) .commit(); } } public void showFragmentNoAnim(Fragment fragment, String tag, boolean back){ if(fragment != null){ if (back){ getSupportFragmentManager() .beginTransaction() .setCustomAnimations(0 , 0) .replace(R.id.fragment_container, fragment) .addToBackStack(tag) .commit(); }else { getSupportFragmentManager() .beginTransaction() .setCustomAnimations(0 , 0) .replace(R.id.fragment_container, fragment) .commit(); } } } public void showLongToast(View view, String stringId) { Snackbar.make(view, stringId, Snackbar.LENGTH_LONG).show(); } public void showLongToast(View view, int stringId) { Snackbar.make(view, stringId, Snackbar.LENGTH_LONG).show(); } public void showLongToast(View view, int stringId, int action, View.OnClickListener listener) { Snackbar snack = Snackbar.make(view, stringId, Snackbar.LENGTH_LONG) .setAction(action, listener) .setActionTextColor(getResources().getColor(R.color.colorPrimary)); snack.show(); } public void startFadeFinishAc(Intent intent ,boolean finish ){ startActivity(intent); overridePendingTransition(R.anim.fade_in , R.anim.fade_out); if (finish) finish(); } public void startRestartAc(Intent intent ){ ComponentName cn = intent.getComponent(); Intent mainIntent = Intent.makeRestartActivityTask(cn); overridePendingTransition(R.anim.fade_in , R.anim.fade_out); startActivity(mainIntent); } }
package com.tencent.mm.plugin.luckymoney.f2f.ui; import android.animation.ValueAnimator; import android.animation.ValueAnimator.AnimatorUpdateListener; class ShuffleView$7 implements AnimatorUpdateListener { final /* synthetic */ ShuffleView kPn; ShuffleView$7(ShuffleView shuffleView) { this.kPn = shuffleView; } public final void onAnimationUpdate(ValueAnimator valueAnimator) { if (ShuffleView.A(this.kPn) != null) { ShuffleView.A(this.kPn).a(valueAnimator, ShuffleView.u(this.kPn)); } } }
class Node { Node next; int data; Node(int data) { this.data = data; } } public class DeletePointerNode { public boolean deleteNode(Node curr) { if (curr == null || curr.next == null) return false; Node q = curr.next; curr.data = q.data; // copy data(simulate previous) curr.next = q.next; // delete node return true; } public static Node createLinkedList(int[] arr) { Node head = new Node(0); Node p = head; for (int i = 0; i < arr.length; i++) { p.next = new Node(arr[i]); p = p.next; } return head.next; } public static void printLinkedList(Node n) { Node p = n; while (p != null) { System.out.print(p.data + "->"); p = p.next; } System.out.println("null"); } public static void main(String[] args) { DeletePointerNode sol = new DeletePointerNode(); int[] nums = {1, 2, 3, 4, 5}; boolean[] results = {true, true, true, true, false}; int count = nums.length; int failed = 0; boolean result; for (int i = 0; i < count; i++) { Node head = createLinkedList(nums); Node curr = head; int j = 0; // move curr to differnt position(from head to tail) while (j < i) { curr = curr.next; j++; } result = sol.deleteNode(curr); System.out.println("==== Delete at " + i + "th Node: " + result + " ===="); printLinkedList(head); if (result != results[i]) { failed++; } } System.out.println("Test " + count + " cases: " + (count-failed) + " success, " + failed + " failed."); } }
package com.tencent.mm.g.a; import android.os.Bundle; public final class qw$a { public Bundle bundle; }
/** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.hadoop.mapred.join; import java.io.IOException; import java.util.ArrayList; import java.util.PriorityQueue; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; import org.apache.hadoop.io.Writable; import org.apache.hadoop.io.WritableComparable; import org.apache.hadoop.io.WritableComparator; import org.apache.hadoop.mapred.JobConf; /** * Prefer the &quot;rightmost&quot; data source for this key. * For example, <tt>override(S1,S2,S3)</tt> will prefer values * from S3 over S2, and values from S2 over S1 for all keys * emitted from all sources. * @deprecated Use * {@link org.apache.hadoop.mapreduce.lib.join.OverrideRecordReader} instead */ @Deprecated @InterfaceAudience.Public @InterfaceStability.Stable public class OverrideRecordReader<K extends WritableComparable, V extends Writable> extends MultiFilterRecordReader<K,V> { OverrideRecordReader(int id, JobConf conf, int capacity, Class<? extends WritableComparator> cmpcl) throws IOException { super(id, conf, capacity, cmpcl); } /** * Emit the value with the highest position in the tuple. */ @SuppressWarnings("unchecked") // No static typeinfo on Tuples protected V emit(TupleWritable dst) { return (V) dst.iterator().next(); } /** * Instead of filling the JoinCollector with iterators from all * data sources, fill only the rightmost for this key. * This not only saves space by discarding the other sources, but * it also emits the number of key-value pairs in the preferred * RecordReader instead of repeating that stream n times, where * n is the cardinality of the cross product of the discarded * streams for the given key. */ protected void fillJoinCollector(K iterkey) throws IOException { final PriorityQueue<ComposableRecordReader<K,?>> q = getRecordReaderQueue(); if (!q.isEmpty()) { int highpos = -1; ArrayList<ComposableRecordReader<K,?>> list = new ArrayList<ComposableRecordReader<K,?>>(kids.length); q.peek().key(iterkey); final WritableComparator cmp = getComparator(); while (0 == cmp.compare(q.peek().key(), iterkey)) { ComposableRecordReader<K,?> t = q.poll(); if (-1 == highpos || list.get(highpos).id() < t.id()) { highpos = list.size(); } list.add(t); if (q.isEmpty()) break; } ComposableRecordReader<K,?> t = list.remove(highpos); t.accept(jc, iterkey); for (ComposableRecordReader<K,?> rr : list) { rr.skip(iterkey); } list.add(t); for (ComposableRecordReader<K,?> rr : list) { if (rr.hasNext()) { q.add(rr); } } } } }
package enum_test; /** * Description: * * @author Baltan * @date 2017/12/28 14:58 */ public class Test1 { public static void main(String[] args) { System.out.println(Size.EXTRA_LARGE.toString()); Size[] sizes = Size.values(); for (Size s : sizes) { System.out.print(s + "\t"); } System.out.println(); System.out.println(Size.MEDIUM.ordinal()); //和toString()类似 System.out.println(Size.EXTRA_SMALL.name()); System.out.println(Size.EXTRA_SMALL.compareTo(Size.EXTRA_LARGE)); Size size1 = Size.MEDIUM; switch (size1) { case EXTRA_SMALL: System.out.println("xs"); break; case MEDIUM: System.out.println("m"); break; case EXTRA_LARGE: System.out.println("xl"); break; } } }
package com.github.arsentiy67.usereditor.config; import java.util.Properties; import org.hibernate.SessionFactory; import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.core.io.ClassPathResource; import org.springframework.jdbc.datasource.DataSourceTransactionManager; import org.springframework.jdbc.datasource.DriverManagerDataSource; import org.springframework.orm.hibernate4.LocalSessionFactoryBuilder; import org.springframework.transaction.PlatformTransactionManager; @Configuration public class DatabaseConfig { @Bean public static PropertyPlaceholderConfigurer properties() { PropertyPlaceholderConfigurer ppc = new PropertyPlaceholderConfigurer(); ClassPathResource[] resources = new ClassPathResource[ ] { new ClassPathResource( "/com/github/arsentiy67/usereditor/config/db.properties" ) }; ppc.setLocations( resources ); ppc.setIgnoreUnresolvablePlaceholders( true ); return ppc; } @Value( "${jdbc.url}" ) private String jdbcUrl; @Value( "${jdbc.driverClassName}" ) private String driverClassName; @Value( "${jdbc.username}" ) private String username; @Value( "${jdbc.password}" ) private String password; @Bean public DriverManagerDataSource dataSource() { DriverManagerDataSource dataSource = new DriverManagerDataSource(); dataSource.setDriverClassName(driverClassName); dataSource.setUrl(jdbcUrl); dataSource.setUsername(username); dataSource.setPassword(password); return dataSource; } @Bean public PlatformTransactionManager transactionManager() { return new DataSourceTransactionManager(dataSource()); } @Bean public SessionFactory sessionFactory() { LocalSessionFactoryBuilder builder = new LocalSessionFactoryBuilder(dataSource()); builder.scanPackages("com.github.arsentiy67.usereditor.model") .addProperties(getHibernateProperties()); return builder.buildSessionFactory(); } private Properties getHibernateProperties() { Properties prop = new Properties(); prop.put("hibernate.format_sql", "true"); prop.put("hibernate.show_sql", "true"); prop.put("hibernate.dialect", "org.hibernate.dialect.PostgreSQLDialect"); return prop; } }
/* * 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 herramientas; import org.apache.log4j.Logger; import org.apache.log4j.PropertyConfigurator; /** * * @author abfd * leemos de un excel los id de expediente y registramos en operclientes un nuevo envío para cada una * de las tasaciones pertenecientes a ese expediente. */ public class enviaExpedientesSareb { private java.sql.Connection conexion = null; private Logger logger = Logger.getLogger(enviaExpedientesSareb.class); public static String sUrlExcel = null; public static Utilidades.Excel oExcel = null; public static org.apache.poi.hssf.usermodel.HSSFCell celda = null; public static String HojaActual = null; public static void main(String[] args) { //FICHERO LOG4J enviaExpedientesSareb nwEnvio = new enviaExpedientesSareb(); nwEnvio = null; System.gc(); } public enviaExpedientesSareb() { String idExpediente = "" ; String sConsulta = ""; java.sql.ResultSet rs = null; int numexptes = 0; Objetos.v2.Operclientes oOperclientes = new Objetos.v2.Operclientes(); int inumInsertadas = 0; try { PropertyConfigurator.configure("/data/informes/sareb/envioExcel/" + "Log4j.properties"); conexion = Utilidades.Conexion.getConnection("jdbc:oracle:thin:valtecnic2/valtecnic2@oraserver02:1521:rvtnprod"); conexion.setAutoCommit(false); sUrlExcel = "/data/informes/sareb/envioExcel/envioExcel.xls"; oExcel = new Utilidades.Excel(sUrlExcel); celda = null; HojaActual = "Hoja1"; int filaInicial = 90; int totalFilas = 104; for (int fila = filaInicial; fila < totalFilas; fila ++) { numexptes = 0; inumInsertadas = 0; celda = oExcel.getCeldaFilaHoja(HojaActual,fila,0); idExpediente = Utilidades.Excel.getStringCellValue(celda); logger.info("Procesamos envío id: "+idExpediente); sConsulta = "SELECT r.numexp,r.referencia FROM refer r JOIN solicitudes s ON (r.numexp = s.numexp) JOIN operclientes o ON (s.numexp = o.numexp) WHERE r.idexpediente = '"+idExpediente+"' AND s.codest = 10 AND s.codcli = 250 AND s.tipoinm != 'XXI' AND o.tipoperacion = 'REC' AND o.tipomensaje = 'STA'"; rs = Utilidades.Conexion.select(sConsulta, conexion); while (rs.next()) { numexptes ++; oOperclientes.clear(); oOperclientes.numexp = rs.getString("numexp"); oOperclientes.cliente = 250; oOperclientes.refcliente = rs.getString("referencia"); oOperclientes.tipoperacion = "ENV"; oOperclientes.tipomensaje = "ENT"; oOperclientes.control = 0; oOperclientes.postventa = 0; oOperclientes.setFchenvioNow(); oOperclientes.setHoraenvioNow(); //oOperclientes.estado = "X"; estado para generar el CD oOperclientes.estado = "E"; //estado para envios normales por sistema. if (oOperclientes.insert(conexion) == 1) inumInsertadas ++; } if (numexptes == inumInsertadas) { conexion.commit(); logger.info("Id Expediente: "+idExpediente+". Insertados: "+inumInsertadas+" expedientes de Valtecnic."); } else { conexion.rollback(); logger.info("Id Expediente: "+idExpediente+". NO Insertado. Totales en VT: "+numexptes+". Insertados: "+inumInsertadas); } }//for excel conexion.close(); }//try catch (Exception e) { try { conexion.rollback(); } catch (Exception ex){} logger.error("Excepcion: "+e.toString()); } finally { try { if (conexion != null && !conexion.isClosed()) { conexion.rollback(); conexion.close(); } } catch (Exception e) { } } } }
package com.progoth.synchrochat.client.events; import com.google.web.bindery.event.shared.Event; import com.progoth.synchrochat.shared.model.ChatRoom; public class RoomJoinedEvent extends Event<RoomJoinedEvent.Handler> { public static interface Handler { void onRoomJoined(ChatRoom aRoom); } public static final Type<Handler> TYPE = new Type<RoomJoinedEvent.Handler>(); private final ChatRoom m_room; public RoomJoinedEvent(final ChatRoom aRoom) { m_room = aRoom; } @Override protected void dispatch(final Handler aHandler) { aHandler.onRoomJoined(m_room); } @Override public Type<Handler> getAssociatedType() { return TYPE; } }
package com.excilys.formation.cdb.service.DTO.Mappers; import java.time.LocalDate; import com.excilys.formation.cdb.service.DTO.ComputerDto; import com.excilys.formation.cdb.core.model.Computer; import com.excilys.formation.cdb.core.model.Computer.ComputerBuilder; import com.excilys.formation.cdb.service.Utility; public class ComputerDtoMapper { private ComputerDtoMapper() { } public static Computer computerDTOToComputer(ComputerDto computerDto) { Computer computer = null; if (computerDto == null) { return computer; } ComputerBuilder builderComputer = null; if (Utility.stringIsSomething(computerDto.getName())) { builderComputer = new ComputerBuilder(computerDto.getName()); } else { return null; } if(Utility.stringIsSomething(computerDto.getId())) { builderComputer.withId((long) Integer.parseInt(computerDto.getId())); } if (Utility.stringIsSomething(computerDto.getIntroduced())) { builderComputer.introducedThe(LocalDate.parse(computerDto.getIntroduced())); } if (Utility.stringIsSomething(computerDto.getDiscontinued())) { builderComputer.discontinuedThe(LocalDate.parse(computerDto.getDiscontinued())); } if (computerDto.getCompany() != null) { builderComputer.byCompany(CompanyDtoMapper.companyDtoToCompany(computerDto.getCompany())); } computer = builderComputer.build(); return computer; } public static ComputerDto computerToComputerDto(Computer computer) { ComputerDto computerDto = new ComputerDto(); if (computer == null) { return null; } computerDto.setId("" + computer.getId()); if (computer.getName() != null) { computerDto.setName(computer.getName()); } if (computer.getIntroduced() != null) { computerDto.setIntroduced("" + computer.getIntroduced()); } if (computer.getDiscontinued() != null) { computerDto.setDiscontinued("" + computer.getDiscontinued()); } if (computer.getCompany() != null) { computerDto.setCompany(CompanyDtoMapper.companyToCompanyDto(computer.getCompany())); } return computerDto; } }
package com.slort.struts.form.security; import java.util.Date; import javax.servlet.http.HttpServletRequest; import org.apache.struts.action.ActionError; import org.apache.struts.action.ActionErrors; import org.apache.struts.action.ActionMapping; import com.slort.model.Opcionmenu; import com.slort.struts.action.ActionForm; public class FlotaForm extends ActionForm { private Integer codUnidad; private boolean activo; private String userYahoo; private String passwYahoo; private String nombre; private String apellido; private String domicilio; private String codPostal; private String localidad; private String telefono; private String cargo; private String email; private String fechaAlta; private String fechaBaja; private String cuit; private String licencia; private String fechaModif; private Byte fleliminado; private String esEliminar="no"; private String consumerKeyYahoo; private String consumerSecretYahoo; public String getEsEliminar() { return esEliminar; } public void setEsEliminar(String esEliminar) { this.esEliminar = esEliminar; } public Integer getCodUnidad() { return codUnidad; } public void setCodUnidad(Integer codUnidad) { this.codUnidad = codUnidad; } public boolean isActivo() { return activo; } public void setActivo(boolean activo) { this.activo = activo; } public boolean getActivo() { return activo; } public String getUserYahoo() { return userYahoo; } public void setUserYahoo(String userYahoo) { this.userYahoo = userYahoo; } public String getPasswYahoo() { return passwYahoo; } public void setPasswYahoo(String passwYahoo) { this.passwYahoo = passwYahoo; } public String getNombre() { return nombre; } public void setNombre(String nombre) { this.nombre = nombre; } public String getApellido() { return apellido; } public void setApellido(String apellido) { this.apellido = apellido; } public String getDomicilio() { return domicilio; } public void setDomicilio(String domicilio) { this.domicilio = domicilio; } public String getCodPostal() { return codPostal; } public void setCodPostal(String codPostal) { this.codPostal = codPostal; } public String getLocalidad() { return localidad; } public void setLocalidad(String localidad) { this.localidad = localidad; } public String getTelefono() { return telefono; } public void setTelefono(String telefono) { this.telefono = telefono; } public String getCargo() { return cargo; } public void setCargo(String cargo) { this.cargo = cargo; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public String getFechaAlta() { return fechaAlta; } public void setFechaAlta(String fechaAlta) { this.fechaAlta = fechaAlta; } public String getFechaBaja() { return fechaBaja; } public void setFechaBaja(String fechaBaja) { this.fechaBaja = fechaBaja; } public String getFechaModif() { return fechaModif; } public void setFechaModif(String fechaModif) { this.fechaModif = fechaModif; } public String getCuit() { return cuit; } public void setCuit(String cuit) { this.cuit = cuit; } public String getLicencia() { return licencia; } public void setLicencia(String licencia) { this.licencia = licencia; } public Byte getFleliminado() { return fleliminado; } public void setFleliminado(Byte fleliminado) { this.fleliminado = fleliminado; } public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) { ActionErrors errors = new ActionErrors(); validateRequired(errors, "nombre", this.nombre); validateRequired(errors, "licencia", this.licencia); validateRequired(errors, "apellido", this.apellido); return errors; } public void reset(ActionMapping mapping, HttpServletRequest request) { this.nombre=null; this.licencia =""; this.apellido = ""; super.reset(mapping, request); } public String getConsumerKeyYahoo() { return consumerKeyYahoo; } public void setConsumerKeyYahoo(String consumerKeyYahoo) { this.consumerKeyYahoo = consumerKeyYahoo; } public String getConsumerSecretYahoo() { return consumerSecretYahoo; } public void setConsumerSecretYahoo(String consumerSecretYahoo) { this.consumerSecretYahoo = consumerSecretYahoo; } }
class Parent { void value() { System.out.println("enter in parent class"); } } class child extends Parent { void value() { super.value(); System.out.println("Enter in child class"); } } class Inv { public static void main(String[] args) { child c=new child(); c.value(); System.out.println("without object"); } }
package com.shiro.controller; import com.shiro.service.UserService; import com.mysql.jdbc.StringUtils; import org.apache.shiro.SecurityUtils; import org.apache.shiro.authc.UsernamePasswordToken; import org.apache.shiro.subject.Subject; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import javax.servlet.http.HttpSession; @Controller public class LoginController { @Autowired private UserService userService; @RequestMapping("/validate/doLogin") public String doLogin(String username, String password, HttpSession session) { // 1.用户的非空校验 if (StringUtils.isEmptyOrWhitespaceOnly(username) || StringUtils.isEmptyOrWhitespaceOnly(password)) { session.setAttribute("loginFailed", 2); return "redirect:/login.jsp"; } // 2.创建一个登录令牌 UsernamePasswordToken token = new UsernamePasswordToken(username, password); // 3.创建一个Subject对象,代表当前的登录用户,subject含义更广泛,因为登录系统可能不是一个真实 // 的用户,还可能是一个线程。注意导包不要导错 Subject subject = SecurityUtils.getSubject(); // 4.进行登录验证,这个方法会抛异常,如果登录验证失败的话,会抛异常 try { subject.login(token); // 走到这,证明登录验证成功了,登录成功之后,把用户名存在shiro的session里 subject.getSession().setAttribute("username", username); return "forward:/index"; } catch (Exception e) { // 如果抛异常,说明登录验证失败,重新进行访问 session.setAttribute("loginFailed", 1); return "redirect:/login.jsp"; } } }
package com.example.mapper; import com.example.pojo.Recipe; import java.util.List; import org.apache.ibatis.annotations.Mapper; import org.springframework.stereotype.Repository; @Mapper @Repository public interface RecipeMapper { List<Recipe> selectAll(); Recipe selectById(int id); Recipe selectLast(); Integer selectMaxId(); int insert(Recipe recipe); int deleteAll(); int deleteById(int id); }
package com.tencent.mm.plugin.sns.storage.AdLandingPagesStorage.AdLandingPageComponent.component.widget; import com.tencent.mm.plugin.sns.storage.AdLandingPagesStorage.AdLandingPageComponent.component.widget.a.e; class AdlandingVideoSightView$1 implements e { final /* synthetic */ AdlandingVideoSightView nGO; AdlandingVideoSightView$1(AdlandingVideoSightView adlandingVideoSightView) { this.nGO = adlandingVideoSightView; } public final void wS(int i) { if (-1 == i) { if (this.nGO.ndD != null) { this.nGO.ndD.onError(0, 0); } } else if (i == 0 && this.nGO.ndD != null) { this.nGO.ndD.wd(); } } }
package com.sunbing.demo.service.Impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.sunbing.demo.entity.ResponseResult; import com.sunbing.demo.entity.User; import com.sunbing.demo.mapper.UserMapper; import com.sunbing.demo.param.UserQueryParam; import com.sunbing.demo.param.UserSaveParam; import com.sunbing.demo.service.UserService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.sunbing.demo.vo.UserPageVo; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; /** * <p> * 用户表 服务实现类 * </p> * * @author sunbing * @since 2020-11-12 */ @Service public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService { public IPage<UserPageVo> selectPageVo(Page page, UserQueryParam queryParam){ return this.baseMapper.selectPageVo(page,queryParam); } //适用性不好:1.返回的是User对象而非自定义vo 2.不能关联表 public IPage<UserPageVo> selectPageVo1(Page page, UserQueryParam queryParam){ QueryWrapper wrapper = new QueryWrapper(); if(queryParam.getId() != null){ wrapper.eq("id",queryParam.getId()); } if(StringUtils.isNotBlank(queryParam.getUserName())){ wrapper.like("user_name",queryParam.getUserName()); } if(StringUtils.isNotBlank(queryParam.getEmail())){ wrapper.like("email",queryParam.getEmail()); } IPage<UserPageVo> pageInfo = page(page,wrapper); return pageInfo; } @Override public ResponseResult saveEntity(UserSaveParam param) { User entity = new User(); entity.setUserName(param.getUserName()).setPassword(param.getPassword()).setEmail(param.getEmail()); boolean isSuccess = save(entity); if(isSuccess){ return ResponseResult.Success("保存成功"); } return ResponseResult.Fail("保存失败"); } }
package com.dais.mapper; import com.dais.model.PrivatechatMsg; import com.dais.model.PrivatechatMsgExample; import java.util.List; import org.apache.ibatis.annotations.Param; public interface PrivatechatMsgMapper { int countByExample(PrivatechatMsgExample example); int deleteByExample(PrivatechatMsgExample example); int deleteByPrimaryKey(String id); int insert(PrivatechatMsg record); int insertSelective(PrivatechatMsg record); List<PrivatechatMsg> selectByExampleWithBLOBs(PrivatechatMsgExample example); List<PrivatechatMsg> selectByExample(PrivatechatMsgExample example); PrivatechatMsg selectByPrimaryKey(String id); int updateByExampleSelective(@Param("record") PrivatechatMsg record, @Param("example") PrivatechatMsgExample example); int updateByExampleWithBLOBs(@Param("record") PrivatechatMsg record, @Param("example") PrivatechatMsgExample example); int updateByExample(@Param("record") PrivatechatMsg record, @Param("example") PrivatechatMsgExample example); int updateByPrimaryKeySelective(PrivatechatMsg record); int updateByPrimaryKeyWithBLOBs(PrivatechatMsg record); int updateByPrimaryKey(PrivatechatMsg record); }
package ccs.education.login.dto; import org.springframework.security.core.authority.AuthorityUtils; import org.springframework.security.core.userdetails.User; import ccs.education.login.entity.Account; import lombok.Getter; @Getter public class LoginUser extends User { private Account account; // アカウント情報 // Account情報をDTOクラスに設定する、今回のデモではすべてユーザ権限とする public LoginUser(Account account) { super(account.getId(), account.getPassword(), AuthorityUtils.createAuthorityList("USER")); this.account = account; } }
package bot.behavior; import lejos.hardware.Sound; import lejos.hardware.sensor.EV3ColorSensor; import lejos.robotics.Color; import lejos.robotics.subsumption.Behavior; import bot.BrickConfig; public class ColorObjectDetector implements Behavior { @Override public boolean takeControl() { // TODO Auto-generated method stub return false; } @Override public void action() { System.out.println("Detecting color of object"); EV3ColorSensor colorSensor = new EV3ColorSensor(BrickConfig.COLOR_SENSOR_PORT); int colorId = colorSensor.getColorID(); System.out.println("Found color ID: " + colorId); switch (colorId) { case Color.BLUE: System.out.println("Found blue color"); case Color.RED: System.out.println("Found red color"); case Color.GREEN: System.out.println("Found green color"); default: System.out.println("Unknown colorId: " + colorId); } colorSensor.close(); Sound.beep(); } @Override public void suppress() { } }
package rhtn_homework; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.*; public class BOJ_17103_골드바흐파티션 { private static StringBuilder sb = new StringBuilder(); public static void main(String[] args) throws IOException{ // TODO Auto-generated method stub BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); ArrayList<Integer> primes = new ArrayList<>(); boolean[] check = new boolean[1000001]; for (int i = 2; i < check.length; i++) { if(!check[i]) { primes.add(i); for (int j = i+i; j < check.length; j+=i) { check[j] = true; } } } int T = Integer.parseInt(br.readLine()); for (int i = 0; i < T; i++) { int n = Integer.parseInt(br.readLine()); int ans = 0; for (int x : primes){ int y = n - x; if(x <= y && !check[y]){ ans++; } } sb.append(ans +"\n"); } System.out.println(sb); } }
package ws.customer.service; import java.util.ArrayList; import java.util.LinkedHashMap; import ws.customer.data.Customer; public class CustomerSpringService { LinkedHashMap<String, Customer> customers; public void setCustomers(LinkedHashMap<String, Customer> customers) { this.customers = customers; } public LinkedHashMap<String, Customer> getCustomers() { return customers; } public Object[] getCustomerIds() { ArrayList<Integer> customerIds = new ArrayList<Integer>(); for (Customer customer : customers.values()) { customerIds.add(customer.getCustomerID()); } return customerIds.toArray(); } public Customer getCustomerByID(int id) { return customers.get(String.valueOf(id)); } public Customer getCustomerWithLargestAmount() { Customer result = new Customer(); for (Customer customer : customers.values()) { if (customer.getShoppingAmount() > result.getShoppingAmount()) { result = customer; } } return result; } public Object[] getCustomersByType(Boolean privileged) { ArrayList<Integer> result = new ArrayList<Integer>(); for (Customer customer : customers.values()) { if (customer.getPrivileged() == privileged) { result.add(customer.getCustomerID()); } } return result.toArray(); } }
package com.squareup.rack.servlet; import java.io.BufferedReader; import java.io.IOException; import java.io.UnsupportedEncodingException; import java.security.Principal; import java.util.Enumeration; import java.util.Locale; import java.util.Map; import javax.servlet.RequestDispatcher; import javax.servlet.ServletInputStream; import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; class NullHttpServletRequest implements HttpServletRequest { @Override public String getAuthType() { return null; } @Override public Cookie[] getCookies() { return new Cookie[0]; } @Override public long getDateHeader(String name) { return 0; } @Override public String getHeader(String name) { return null; } @Override public Enumeration<String> getHeaders(String name) { return null; } @Override public Enumeration<String> getHeaderNames() { return null; } @Override public int getIntHeader(String name) { return 0; } @Override public String getMethod() { return null; } @Override public String getPathInfo() { return null; } @Override public String getPathTranslated() { return null; } @Override public String getContextPath() { return null; } @Override public String getQueryString() { return null; } @Override public String getRemoteUser() { return null; } @Override public boolean isUserInRole(String role) { return false; } @Override public Principal getUserPrincipal() { return null; } @Override public String getRequestedSessionId() { return null; } @Override public String getRequestURI() { return null; } @Override public StringBuffer getRequestURL() { return null; } @Override public String getServletPath() { return null; } @Override public HttpSession getSession(boolean create) { return null; } @Override public HttpSession getSession() { return null; } @Override public boolean isRequestedSessionIdValid() { return false; } @Override public boolean isRequestedSessionIdFromCookie() { return false; } @Override public boolean isRequestedSessionIdFromURL() { return false; } @Override public boolean isRequestedSessionIdFromUrl() { return false; } @Override public Object getAttribute(String name) { return null; } @Override public Enumeration<String> getAttributeNames() { return null; } @Override public String getCharacterEncoding() { return null; } @Override public void setCharacterEncoding(String env) throws UnsupportedEncodingException { } @Override public int getContentLength() { return 0; } @Override public String getContentType() { return null; } @Override public ServletInputStream getInputStream() throws IOException { return null; } @Override public String getParameter(String name) { return null; } @Override public Enumeration<String> getParameterNames() { return null; } @Override public String[] getParameterValues(String name) { return new String[0]; } @Override public Map<String, String[]> getParameterMap() { return null; } @Override public String getProtocol() { return null; } @Override public String getScheme() { return null; } @Override public String getServerName() { return null; } @Override public int getServerPort() { return 0; } @Override public BufferedReader getReader() throws IOException { return null; } @Override public String getRemoteAddr() { return null; } @Override public String getRemoteHost() { return null; } @Override public void setAttribute(String name, Object o) { } @Override public void removeAttribute(String name) { } @Override public Locale getLocale() { return null; } @Override public Enumeration<Locale> getLocales() { return null; } @Override public boolean isSecure() { return false; } @Override public RequestDispatcher getRequestDispatcher(String path) { return null; } @Override public String getRealPath(String path) { return null; } @Override public int getRemotePort() { return 0; } @Override public String getLocalName() { return null; } @Override public String getLocalAddr() { return null; } @Override public int getLocalPort() { return 0; } }
package com.learn_basic.reflection; import java.lang.reflect.Method; import java.lang.reflect.ParameterizedType; import java.lang.reflect.Type; import java.util.List; import java.util.Map; // 通过反射 获取泛型 public class GetTypeByReflection { public void test01(Map<String, User> map, List<User> list){ System.out.println("test01"); } public Map<String, User> test02(){ System.out.println("test02"); return null; } public static void main(String[] args) throws NoSuchMethodException { Method method = GetTypeByReflection.class.getMethod("test01", Map.class, List.class); // 获取泛型参数化类型 Type[] genericParameterTypes = method.getGenericParameterTypes(); for (Type genericParameterType : genericParameterTypes) { System.out.println("# genericParameterType: " + genericParameterType); // 对每一个参数,如果是参数化类型,就获取真实的类型 if(genericParameterType instanceof ParameterizedType){ Type[] actualTypeArguments = ((ParameterizedType) genericParameterType).getActualTypeArguments(); for (Type actualTypeArgument : actualTypeArguments) { System.out.println("# actualTypeArgument: " +actualTypeArgument); } } } System.out.println(" =============================== "); method = GetTypeByReflection.class.getMethod("test02", null); Type genericReturnType = method.getGenericReturnType(); if(genericReturnType instanceof ParameterizedType){ Type[] actualTypeArguments = ((ParameterizedType) genericReturnType).getActualTypeArguments(); for (Type actualTypeArgument : actualTypeArguments) { System.out.println("# actualTypeArgument: " +actualTypeArgument); } } } } // # genericParameterType: java.util.Map<java.lang.String, com.reflection.User> // # actualTypeArgument: class java.lang.String // # actualTypeArgument: class com.reflection.User // # genericParameterType: java.util.List<com.reflection.User> // # actualTypeArgument: class com.reflection.User // =============================== // # actualTypeArgument: class java.lang.String // # actualTypeArgument: class com.reflection.User
/* * 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 test; import java.util.regex.Matcher; import java.util.regex.Pattern; /** * * @author elshan.abdullayev */ public class PinCode { //private static final String REGEX = "[A-Z0-9]{7}"; //private static final String INPUT = "21RQХDK"; public static String aa="483АDZE"; public static String bb="483ADZE"; //public static String bd=" "; public static String bd="12.10.1986"; public static void main( String args[] ) { System.out.println(Pattern.matches("[a-zA-Z0-9]{6}", "arun32"));//true System.out.println(Pattern.matches("[a-zA-Z0-9]{6}", "kkvarun32"));//false (more than 6 char) System.out.println("Output : "+Pattern.matches("[a-zA-Z0-9]{6}", "JA2Uk2"));//true System.out.println("Output : "+Pattern.matches("[a-zA-Z0-9]{6}", "arun$2"));//false ($ is not matched) System.out.println("[0-9A-Z]{7} --- 2YMW1ТN Output "+Pattern.matches("[A-Z0-9]{7}","2YMW1ТN"));//false ($ is not matched) System.out.println("[A-Z0-9]{7} --- 221KСF0 Output "+Pattern.matches("[A-Z0-9]{7}","2YMW1TN"));//false ($ is not matched) System.out.println("[A-Z0-9]{7} --- 21RQХDK Output "+Pattern.matches("[A-Z0-9]{7}","221KCF0"));//false ($ is not matched) System.out.println("[A-Z0-9]{7} --- 483АDZE Output Royal "+Pattern.matches("[A-Z0-9]{7}","483АDZE"));//from RB System.out.println("[A-Z0-9]{7} --- 483ADZE Output İAMAS "+Pattern.matches("[A-Z0-9]{7}","483ADZE"));//from İAMAS System.out.println("[A-Z0-9]{7} --- 58XXVPJ Output Kapital "+Pattern.matches("[A-Z0-9]{7}","58XXVPJ"));//from Kpt System.out.println(aa.toString()); //String pattern ="[0-9Xx]{2}/[0-9Xx]{2}/[0-9Xx]{4}"; //if (bd.isEmpty()){ // System.out.println(" Birth Date is null"); // } else if (!bd.isEmpty()&&!bd.toUpperCase().matches(pattern)) { // System.out.println("Birth Date is not usable: ["+bd+"] format is date must be [dd/mm/yyy]"); // } } }
package com.example.plasticcabinets.model; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import org.springframework.data.annotation.CreatedDate; import org.springframework.data.annotation.LastModifiedBy; import org.springframework.data.annotation.LastModifiedDate; import org.springframework.data.jpa.domain.support.AuditingEntityListener; import javax.persistence.*; import java.io.Serializable; import java.util.Date; @Table(name = "comments") @EntityListeners(AuditingEntityListener.class) @JsonIgnoreProperties(value = {"created_date", "modifieddate"}, allowGetters = true) @Entity public class Comments implements Serializable { @Id @GeneratedValue(strategy = GenerationType.AUTO) private Integer id; @Column(name = "title") private String title; @Column(name = "comment") private String comment; @Column(name = "user_id") private Integer userId; @Column(name = "status") private Long status; @Column(nullable = false, updatable = false) @Temporal(TemporalType.TIMESTAMP) @CreatedDate private Date created_date; @Column(nullable = false) @Temporal(TemporalType.TIMESTAMP) @LastModifiedDate private Date modifieddate; @Column(name = "create_by") private Integer createBy; public Comments(String title, String comment, Integer userId, Long status, Date created_date, Date modifieddate, Integer createBy) { this.title = title; this.comment = comment; this.userId = userId; this.status = status; this.created_date = created_date; this.modifieddate = modifieddate; this.createBy = createBy; } public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getComment() { return comment; } public void setComment(String comment) { this.comment = comment; } public Integer getUserId() { return userId; } public void setUserId(Integer userId) { this.userId = userId; } public Long getStatus() { return status; } public void setStatus(Long status) { this.status = status; } public Date getCreated_date() { return created_date; } public void setCreated_date(Date created_date) { this.created_date = created_date; } public Date getModifieddate() { return modifieddate; } public void setModifieddate(Date modifieddate) { this.modifieddate = modifieddate; } public Integer getCreateBy() { return createBy; } public void setCreateBy(Integer createBy) { this.createBy = createBy; } }