XZ:Flutter advanced practical imitation of Bilibili APP

In recent years, major companies have increasingly higher requirements for THE skills of Flutter, and even set up special positions. However, there are few talents who master the advanced skills of Flutter, and there are few dry courses on the market for Flutter, resulting in a large talent gap. Therefore, we specially designed this course for you to help you become a new generation of engineers in demand.

Dart, Flutter, and cross-platform developers are required

Environment parameters Flutter 2.x function operation Conditional field function operation cannot remove index.

Select * from t1 where date© = ‘2019-05-21’; Optimization: Change to range query

Select * from t1 where c>= ‘2019-05-21 00:00:00’ and c<= ‘2019-05-21 23:59:59’; Implicit conversion operators, when used with different types of operation objects, perform type conversions to make operations compatible.

select user_name,tele_phone from user_info where tele_phone =11111111111; / tele_phone varchar/practice will do function operations:

select user_name,tele_phone from user_info where cast(tele_phone as singed int) =11111111111; Optimization: Type unification

Select user_name,tele_phone from user_info where tele_phone = ‘11111111111’; The ambiguous query wildcard comes first

Select * from t1 where a like ‘%1111%’; Optimization: Vague queries must contain the value in front of the condition field

Select * from t1 where a like ‘1111%’; Scope query Scope query data volume is too large, need to return to the table, so do not go to the index.

select * from t1 where b>=1 and b <=2000; Optimization: reduce the range of a single query, divided into repeated queries. (Practice may not be too fast, take the index)

select from t1 where b>=1 and b <=1000; show profiles; + — — — — — — — — — – — — — — — — — — — — — – — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — + | Query_ID | Duration | Query | + — — — — — — — — — – — — — — — — — — — — — – — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — + | 1 | | 0.00534775 select the from t1 where b and b > = 1 < = 1000 | | 2 | | 0.00605625 select * from t1 where b > = 1 and b < = 2000 | + — — — — — — — — — – — — — — — — — — — — — – — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — – + 2 rows in the set, 1 warning (0.00 SEC) operation Even a simple calculation

explain select * from t1 where b-1 =1000; Optimization: Put the calculation operation after the equal sign

explain select * from t1 where b =1000 + 1;

Turned over a lot of problem solutions, can only understand this solution, intuitive enough enough violence.

class Solution {

public:

vector restoreIpAddresses(string s) {

vector res;

for (int a = 1; a < 4; a ++ ) for (int b = 1; b < 4; b ++ ) for (int c = 1; c < 4; c ++ ) for (int d = 1; d < 4; If (a + b + c + d == s.substr(0, a)) {string s1 = s.substr(0, a); String s2 = s.substr(a, b); string s3 = s.substr(a + b, c); string s4 = s.substr(a + b + c); if (check(s1) && check(s2) && check(s3) && check(s4)) { string ip = s1 + '.' + s2 + '.' + s3 + '.' + s4; res.push_back(ip); } } } return res; } bool check(string s) // Check whether the first digit of each IP address segment is not 0 or only one digit is 0 {if (stoi(s) <= 255) if (s[0]! = '0' || (s[0] == '0' && s.size() == 1)) return true; return false; }Copy the code

}; All cutting problems can be solved by backtracking search. © Copyright 1 comment by the author

The hottest

The editor preview

comments

Azkaban Fugitive L2 2021-03-13 Post a Java

class Solution {

public List restoreIpAddresses(String s) {

List list = new ArrayList();

for(int a=1; a<4; a++){

for(int b=1; b<4; b++){

for(int c=1; c<4; c++){

for(int d=1; d<4; d++){

if(a+b+c+d==s.length()){

String s1 = s.substring(0, a);

String s2 = s.substring(a, a+b);

String s3 = s.substring(a+b, a+b+c);

String s4 = s.substring(a+b+c, a+b+c+d);

if(check(s1)&&check(s2)&&check(s3)&&check(s4)){ String ip = s1+"."+s2+"."+s3+"."+s4; list.add(ip); } } } } } } return list; } public boolean check(String s){ if(Integer.valueOf(s)<=255){ if(s.charAt(0)! ='0' || s.charAt(0)=='0'&&s.length()==1) return true; } return false; }Copy the code

}