• The implementation of Java concurrency FutureTask


    An overview of the When using Java multithreading to solve problems, in order to improve efficiency, we often process some computation tasks asynchronously and obtain the computation results asynchronously at the end. The implementation of this process cannot be achieved without the Future interface and its implementation class FutureTask. The FutureTask class implements Runnable, Future […]

  • SpringBootSecurity learning (09) web version login configuration Session sharing


    scenario When the background project is deployed on multiple machines instead of one, the most common way to solve the session sharing problem is to store the session in the cache such as redis. Without further discussion of the concept of session and cookie, storing session in redis is very, very easy to share in […]

  • Java dynamic tracing technology exploration from JSP to Arthas


    From the JSP For most Java programmers, a technology called JSP (Java Server Pages) was introduced early on. While this technique may be outdated today in terms of separation of front and back code, front and back logic, and front and back organization, there are some interesting things to mention. At that time, we were […]

  • Detailed HTTP message


    abstract As a web developer, he uses HTTP protocol every day, but he always knows nothing about it. In this paper, refer to the HTTP rfc7230 specification, and sort out the HTTP message part. HTTP message composition Start line: start line, which describes the basic information of the request or response*(header field CRLF): header CRLF[message […]

  • Detailed explanation of spring cloud ribbon load balancing Shenkeng that cannot be connected through the server name


    First, the problem. Take the Eureka cluster and the client calls the service through the ribbon. The ribbon side reports the following exceptions SERVICE-HI java.lang.IllegalStateException: No instances available for SERVICE-HI java.lang.IllegalStateException: Request URI does not contain a valid hostname: http://SERVICE-HI com.netfix.discovery.shared.taransport.TransportException: Cannot execute request on any known server The spring cloud version is messy, […]

  • Forest before tree: the core content of elasticsearch upgrade


    When learning elasticsearch, because of the problems of each version, I couldn’t make it clear, and I had a headache. The official also gave the update of each version. However, the English version has a lot of update information. Recently, I have read a lot of materials, but none of them have been sorted out […]

  • Scala sum example code


    Scala is a multi paradigm programming language, which is designed to integrate various features of object-oriented programming and functional programming. Scala runs on a Java virtual machine and is compatible with existing Java programs. Scala source code is compiled into Java bytecode, so it can run on top of the JVM and call existing Java […]

  • Servlet & HTTP & request notes


    #Today’s content:     1. Servlet HTTP protocol     3. Request ## Servlet: 1. Concept Step 2. 3. Execution principle 4. Life cycle 5. Servlet 3.0 annotation configuration 6. Servlet architecture Servlet — Interface             | Genericservlet — abstract class             | Httpservlet — abstract class Generic servlet: the default null implementation of other methods in the servlet interface, only the service […]

  • Example code of bubble sort, merge sort and fast sort in Scala


    1. Bubble sorting def sort(list: List[Int]): List[Int] = list match { case List() => List() case head :: tail => compute(head, sort(tail)) } def compute(data: Int, dataSet: List[Int]): List[Int] = dataSet match { case List() => List(data) case head :: tail => if (data <= head) data :: dataSet else head :: compute(data, tail) } […]

  • Return map in mybatis


    In mybatis, we usually use it as follows: Return a result User selectOne(User user); select id,username,telphone from user where telphone=#{telphone} and password = #{password} Return multiple results (in fact, this is the same as the above, just the control of query conditions) List selectList(User user); select id,username,telphone from user We just need toresultTypeChange tojava.util.HashMap, this […]

  • An example of how to generate random numbers using Scala


    Using Scala to generate random numbers 1. Simple version: /* can use scala.util.Random.nextInt(10) to produce a number between 1 and 10 the same time,you nextInt(100) to produce a number between 1 and 100 */ object Test { def main(args: Array[String]) { var i = 0 while(i < 10) var str = scala.util.Random.nextInt(100).toString println(str) […]

  • The growth path of rookie programmers: from technical Xiaobai to Alibaba Java Engineer


    The growth path of rookie programmers: from technical Xiaobai to Alibaba Java Engineer Happy National Day! The second longest annual holiday has finally arrived. It’s rare to have eleven long holidays. The author wants to have a few days off. Whether you choose to go out to play, or work overtime in the company, review […]