Query MySQL data
1. Prepare a data sheet called fruits
MariaDB [vincen]> CREATE TABLE fruits #Create a data table
-> (
-> f_id char(10) NOT NULL,
-> s_id INT NOT NULL,
-> f_name char(255) NOT NULL,
-> f_price decimal(8,2) NOT NULL,
-> PRIMARY KEY(f_id)
-> );
Query OK, 0 ...
Posted by esostigma on Wed, 01 Jan 2020 21:25:19 +0100
Distributed global serial number production, Twitter Snowflake algorithm, snowflake algorithm
The structure of snowflake is as follows (each part is separated with -):
0 - 0000000000 0000000000 0000000000 0000000000 0 - 00000 - 00000 - 000000000000
The first bit is unused, the next 41 bits are millisecond time (the length of 41 bits can be used for 69 years), then 5-bit datacenterId and 5-bit workerid (the length of 10 bits can suppor ...
Posted by Robert07 on Wed, 01 Jan 2020 14:56:44 +0100
Imitating bootstrap tagsinput autocomplete function
Demand analysis:
1. Independent function, that is, a page can have multiple input boxes with the same function
2. There are various functional requirements, and there are differences in the maximum number and data form
3. After completion of input, data interaction with the background (pass id)
4. Click delete or delete to ...
Posted by iacataca on Wed, 01 Jan 2020 06:33:49 +0100
Wechat applet - receiving address left slide delete
Effect:
Train of thought:
1, Use relative positioning and absolute positioning, place the list on the upper layer and the delete button on the lower layer (z-index should not be negative).
2, There are three touch events: bindtouchstart, bindtouchmove and bindtouchend.
1. bindtouchstart records the starting point of touch ...
Posted by davidb on Tue, 31 Dec 2019 07:28:06 +0100
POJ 2018 best cost fences (2 points)
Original address: http://poj.org/problem?id=2018
Question meaning: give you N numbers, let you find the maximum average value of a continuous number string, and the number of continuous number strings shall not be less than F.
Idea: bisection average value, and then for each average value, to judge whether there is a segment o ...
Posted by phpform08 on Tue, 31 Dec 2019 07:26:30 +0100
echarts of D3 v4.x (2-6) - area (region) diagram
Area map reference ecrats address: http://echarts.baidu.com/examples/editor.html?c=area-stack
Area map github address: https://github.com/dkr380205984/myComponent/blob/master/src/page/d3/area.vue
There are almost no difficulties in the implementation of area map. If you have known how to write my broken line map.
Function ...
Posted by kkeim on Mon, 30 Dec 2019 19:30:31 +0100
MySQL group summary takes the first N records
score table:
CREATE TABLE `score` (
`student_id` int(10) DEFAULT NULL,
`class_id` int(10) DEFAULT NULL,
`score` int(5) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
Field student ID student ID, class ID: class ID, score: Score
Data preparation:
insert into score values(1,1,100),(2,1,93 ...
Posted by ltd on Sun, 29 Dec 2019 20:12:42 +0100
bzoj P1104 [POI2007] flood pow (luogu P3457)
**Algorithm: parallel search set**
Difficulty: (NOIP -)
In fact, this problem can be directly bfs, but the search is skilled, can not be violent search!
First of all, it's easy to find out that it must be the optimal solution to build water pumps only in all of our own cities. Therefore, according to this property, we come to ...
Posted by sharmeen on Sat, 28 Dec 2019 17:13:47 +0100
[novice road to Daniel 12] port management of switch background management is optimized again
Project 12 re optimization of port management of switch background managementProject presentation
1. Why to use pointer
The function's value is passed, and the function's arguments cannot be modified by calling the function.
2. Pointer definition
What is the pointer
The pointer is essentially an address value:
#include <stdio.h>
int mai ...
Posted by PHPGuru_2700 on Fri, 27 Dec 2019 23:03:00 +0100
In the message sent by rabbitmq template, the Date type field is 8 hours later than the current time
Preface
The problem encountered in the previous development process is that the time in the message body is 8 hours less than the current time when the rabbitmq template is used to send messages. This is the time zone problem.
Let's talk about why it appears.
The previous configuration is as follows:
@Bean
public RabbitTemplate rabbitTempl ...
Posted by lanjoky on Fri, 27 Dec 2019 12:43:39 +0100