[code fragment] and [Java] extract an E item in the List and return a new sublist

There is a requirement in the recent project. You need to extract one of the projects from a List to generate a new List. Here is the implementation code. 1 //From one List<T>Draw out T Project specified in( E Type), return a List<E> 2 //srtList Extraction source List 3 //tClass source List in Item Type ( T Custom class) 4 //eC ...

Posted on Thu, 02 Apr 2020 20:54:01 -0700 by corbin

Android end all Activity common methods

Problem description When we do Android projects, sometimes we can't exit all activities when we exit the program. At this time, we need to close all activities when we exit. Customize an Activity stack (generic method). Use a single instance Activity stack to store and manage all activities. And provides a way to exit all act ...

Posted on Thu, 02 Apr 2020 19:35:59 -0700 by madavies

Demonstration and comparison of JQuery filter selector and property modification

Text matching Enter the value in the form input item, click the judgment button according to the input value, and make the corresponding check box selected   <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Insert title here</title> <script type="text/javascript" src="js/ ...

Posted on Thu, 02 Apr 2020 16:17:08 -0700 by Seas.Comander

Java - this keyword summary

1, Use of this keyword 1. When the same type of objects a and b call the same method (), in order to distinguish whether the method is called by a or b In the following code: class Banana { void method(int i) { /* ... */ } } Banana a = new Banana(), b = new Banana(); a.method(1); b.method(2); Internal process during compilation: 1 Banana.met ...

Posted on Thu, 02 Apr 2020 15:40:49 -0700 by disenopop

crontab timing task does not execute in Linux

Recently, I encountered a case of crontab timing task not executing in linux. I'd like to share it with you to avoid stepping into the pit I encountered. Post the script first In order to facilitate the display, the script has been written into the parameter #!/usr/bin/env bash # 1 output file to log for example: bg # 2 the dest ...

Posted on Thu, 02 Apr 2020 15:24:01 -0700 by playa4real

LeetCode 337. House robbing III

My LeetCode: https://leetcode-cn.com/u/ituring/ My LeetCode source code [GitHub]: https://github.com/izhoujie/Algorithmcii LeetCode 337. House robbing III subject After robbing a street and a circle of houses last time, thieves found a new area where they could steal. This area has only one entrance, which we call "root". In additio ...

Posted on Thu, 02 Apr 2020 12:46:42 -0700 by chandan_tiwari

Simple use of JAVA enumeration class

Introduction to enumeration class Enumeration type is a new feature in Java 5. It is a special data type. It is special because it is both a class type and has more special constraints than a class type, but the existence of these constraints also creates the simplicity, security and convenience of enumeration types. Simple application of en ...

Posted on Thu, 02 Apr 2020 12:44:24 -0700 by fourlincoln10

java SpringWeb receives image collection and other information from android for storage

The company is an APP maker. Is it the first Android interface in a year Android uses OkGo.post("").addFileParams("key",File); In this way, image transmission is the same as html foreground transmission. It's better to receive the image directly with MultipartFile object. It should also be noted that the original type (int,S ...

Posted on Thu, 02 Apr 2020 10:47:15 -0700 by JasonL

From java to kotlin to develop APP (2)

1. Development tool android studio-2.3.3 2. Generic problems Today, I encountered a generic problem while replacing the code. The original JAVA code is as follows public void upRecycle(RecyclerView recyclerView, LinkedList<MallBean> linkedList) { try { if (recyclerView.getAdapter() != null && recyclerView.ge ...

Posted on Thu, 02 Apr 2020 05:22:39 -0700 by loukin

ajax cross domain problem and cross domain loss seesion problem

Cross domain issues encountered in the project. So record it. Project A (ajax mode) requests to project B. 1: You need to do some configuration in B to add a filter My is spring MVC package net.pt365.cms.api.spring.security; import org.springframework.stereotype.Component; import javax.servlet.*; import javax.servlet.htt ...

Posted on Thu, 02 Apr 2020 04:34:48 -0700 by wikstov