Java Note 6 object oriented programming (elementary)
6.1 class and object
A class is a data typeAn object is a concrete instanceIf the attribute (member variable) is not assigned a value, it has a default value, and the rules are consistent with the array
6.2 existence form of object in memory
6.3 memory allocation mechanism of classes and objects
6.4 method calling mechanism and princi ...
Posted by deived on Mon, 07 Mar 2022 15:56:33 +0100
pytorch learning notes 5: learning through examples
1. General ¶
The core of PyTorch is to provide two main functions:
n-dimensional tensor, similar to NumPy, but can run on GPU
Automatic differentiation for constructing and training neural networks
We will use the problem of fitting a third-order polynomial to y = sin(x) as a running example. The network will have four paramet ...
Posted by rnintulsa on Mon, 07 Mar 2022 15:53:41 +0100
Encapsulate exceptions with assert to make the code more elegant (with project source code)
You are no stranger to Assert assertions. When we do unit testing, we look at the composite expectations of business transactions. We can verify them through assertions. The common methods of assertions are as follows:
public class Assert {
/**
* Result = expected is correct
*/
static public void assertEquals(Object expected, ...
Posted by Zoxive on Mon, 07 Mar 2022 15:53:30 +0100
Python practical unpopular knowledge sorting
1.print print information with color
You know the print function in Python. Generally, we will use it to print something as a simple debugging.
But you know, the font color printed by Print can be set.
A small example
def esc(code=0):
return f'\033[{code}m'
print(esc('31;1;0') + 'Error:'+esc()+'important')
After running this code on the ...
Posted by GreenCore on Mon, 07 Mar 2022 15:51:02 +0100
Ant colony algorithm to solve TSP problem - python implementation
Ant colony algorithm for TSP problem
Introduction to TSP issues
Traveling businessmen need to visit n cities and finally return to the starting city. They are required to visit each city only once. The optimization goal is to minimize the sum of distances.
Example solution results
20 city coordinates: (88, 16), (42, 76), (5, 76), (69, 13), ...
Posted by daredevil88 on Mon, 07 Mar 2022 15:45:01 +0100
Detailed explanation of Bluetooth BLE
1, What is Bluetooth?
Bluetooth is a short-range wireless communication technology, which can realize the data exchange between fixed devices and mobile devices. Generally, BR/EDR Bluetooth before Bluetooth 3.0 is called traditional Bluetooth, while LE Bluetooth under Bluetooth 4.0 specification is called low-power Bluetooth.
Many people's un ...
Posted by infratl on Mon, 07 Mar 2022 15:40:02 +0100
Data mining job FCM algorithm
1.MATLAB program implementation
The code is as follows:
%% Clear environment variables
clear;
clc;
close all;
%% Initialization parameters
data = rand(400, 2);
figure;
plot(data(:, 1), data(:, 2), 'ro', 'MarkerSize', 8);
xlabel 'Abscissa X'; ylabel 'Ordinate';
title 'sample data ';
K = 4; % Number of classifications
maxg ...
Posted by Hamish on Mon, 07 Mar 2022 15:38:16 +0100
Spring MVC operation introduction
Chapter 1 Introduction to spring MVC
Spring Framework version 4.3.29 RELEASE
What is spring MVC
1. Spring Part of the family
2. yes JavaWeb Solution of controller layer in three-tier architecture
3. Is based on MVC Ideological framework
-- Model
-- View
-- Controller
Spring MVC knowledge point outline
Spring MVC ...
Posted by jiayanhuang on Mon, 07 Mar 2022 15:37:33 +0100
Memory overflow caused by setting maxHttpHeaderSize too large
1, Production crime scene and troubleshooting process
At 22:46:06 p.m. on March 23, the front service hung up and gave an alarm. Check the system log:
You can see the stack overflow.
I guess it's related to a new configuration in the afternoon:
server.maxHttpHeaderSize: 10240000
(roll back the image and resume production...)
Guess ...
Posted by mmitdnn on Mon, 07 Mar 2022 15:31:50 +0100
proxy in Vue3 is compared with vue2 Object in 0 Advantages of defineproperty
1, Object defineProperty
Definition: object The defineproperty () method will directly define a new property on an object, or modify an existing property of an object and return the object
Why can we achieve responsiveness
Define set property and define get property
get
Property. This function will be called when the property is accesse ...
Posted by netcoord99 on Mon, 07 Mar 2022 15:28:54 +0100