java accepts serial data and makes oscillogram

background 1. Receive serial port information 2. Make data into oscillogram difficulty 1. The retain () method must be added to the Jrame to call the paintComponent(Graphics g) method. 2. Note the value type. If the y value is too small, it needs to be set to double. If it is of int type, ...

Posted by Gregg on Sun, 20 Oct 2019 21:02:53 +0200

Java serialization 43 - other considerations for accessing static methods, static keywords

I. other precautions 1. For methods with static, we said that we need to use the method of "class name", but in fact, we can use the method of "reference" to access this method.   package com.bjpowernode.java_learning; ​ public class D43_ { public static void main(String[] args) { Test3.test3(); ...

Posted by hrichman on Sun, 20 Oct 2019 20:16:43 +0200

Introduction to Eureka's important objects

Before analyzing the source code of communication between EurekaClient and EurekaServer, we need to be familiar with several entity classes. InstanceInfo This class represents the EurekaClient instance, which will be carried by the client when it requests to register with the server. This instance contains some basic information of the current ...

Posted by mwaw on Sun, 20 Oct 2019 19:02:40 +0200

Encapsulating query, adding, deleting, modifying and connecting database

encapsulation BaseDao What if the parameter, quantity and type are not fixed? public class TestMethod { //First, method overload /*public int sum(int a) { return a; } public int sum(int a,int b) { return a+b; } public int sum(int a,int b,int c) { return a+b+c; }*/ //Method 2, put an arra ...

Posted by anand on Sun, 20 Oct 2019 16:43:04 +0200

[Java required course] easy to use Arrays.asList also has these three holes

Easy to use asList In the process of developing or writing test cases, the method of Arrays.asList() is often used, which can quickly and easily convert an array into a List. For example: List<String> list = Arrays.asList("Book", "Pen", "Desk", "Cup"); When we statically reference Arrays.asList(): import static java.util.Arrays.asList; Yo ...

Posted by Brendan Nolan on Sun, 20 Oct 2019 15:49:50 +0200

HttpTrace of spring boot admin shows input and output participation monitoring Redisson

Spring Boot admin (hereinafter referred to as SBA) integrates with Spring Boot and Spring cloud projects automatically in the way of starter, including Server side and Client side SBA monitoring includes application basic information, logfile (online real-time browsing or download), JVM information (thread information, heap information, non he ...

Posted by NargsBrood on Sun, 20 Oct 2019 11:12:51 +0200

Tymeleaf common syntax: template fragment

Many pages in the system have a lot of public content, such as menus, footers, etc., which can be extracted and placed in a public page called "template fragment", and other pages can refer to this. Template snippet content. I. definition of template fragment It can be an html tag or a fragment can be defined using the th:fragment a ...

Posted by flexxall on Sat, 19 Oct 2019 22:46:14 +0200

Currency maximization in Java

1 problem description Given a row of n coins, their denominations are all positive integers c1, c2,... cn, these integers are not necessarily two different. Please tell me how to select coins so that the total amount of coins selected is the largest when their original positions are not adjacent to each ...

Posted by dubrubru on Sat, 19 Oct 2019 20:41:43 +0200

Google,Guava local efficient cache

Guva is an open-source public java library of google, similar to Apache Commons. It provides a collection, reflection, caching, scientific computing, xml, io and other tool class libraries.Cache is just one of the modules. Using Guva cache can build local cache conveniently and quickly. [TOC] Building the first cache using Guava First, we need ...

Posted by wgh on Sat, 19 Oct 2019 08:11:04 +0200

Java serialization 42 this can not be omitted, construction method setting default value method

I. When can't this be omitted? Let's give an example to illustrate class User2{ private int id; public int getId() { return id; } public void setId(int id) { this.id = id;//If it's written here id=id,Then according to the principle of proximity, the first id It's the formal parameter. The second one. id Als ...

Posted by juliston on Fri, 18 Oct 2019 20:29:47 +0200