Big front end

big end


XZ: Big front end

One level higher than the front end stack
Designed for practical development experience 1 More than years of front end engineer design
Efficient and versatile architecture front end
Function operation
You can't index a conditional field by performing function operations .

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 are used with different types of operands , Type conversion will occur to make the operation compatible .

select user_name,tele_phone from user_info where tele_phone =11111111111; / tele_phone varchar /
Practice can do function operation :

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’;
Ambiguous query
The wildcard is at the front

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

select * from t1 where a like ‘1111%’;
Range query
Too much range query data , Demand returns , So don't index .

select * from t1 where b>=1 and b <=2000;
Optimization : Reduce the scope of a single query , It's time and again .( Practice may not be too fast , It is suggested that we take the index )

select from t1 where b>=1 and b <=1000;
show profiles;
±---------±-----------±-----------------------------------------+
| Query_ID | Duration | Query |
±---------±-----------±-----------------------------------------+
| 1 | 0.00534775 | select 
from t1 where b>=1 and b <=1000 |
| 2 | 0.00605625 | select * from t1 where b>=1 and b <=2000 |
±---------±-----------±-----------------------------------------+
2 rows in set, 1 warning (0.00 sec)
Computing operations
Even simple calculations

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;

I read a lot of questions , I can only understand this solution , It's intuitive, it's violent .

class Solution {
public:
vector<string> restoreIpAddresses(string s) {
vector<string> 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; d ++ ) //abcd They represent four paragraphs respectively ip Address length 
{
if (a + b + c + d == s.size()) // The length of the four segments is just 
{
string s1 = s.substr(0, a); // Four segments were intercepted respectively ip Address 
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) // Judge ip The first digit of each paragraph of the address is not 0, Or there is only one and that is 0
{
if (stoi(s) <= 255)
if (s[0] != '0' || (s[0] == '0' && s.size() == 1)) return true;
return false;
}

};
Next :【 Cutting problems can be solved by backtracking search 】 Detailed explanation !
The copyright belongs to the author
1
comments

Hottest

edit
preview

Comment on

Azkaban is on the run
L2
2021-03-13
Post one java Of

class Solution {
public List<String> restoreIpAddresses(String s) {
List<String> 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;
}
版权声明
本文为[osc_ thirty-five million eight hundred and ninety thousand one ]所创,转载请带上原文链接,感谢
https://qdmana.com/2021/04/20210407215851626p.html

  1. Element tree control: invalid to modify current node key
  2. linux下安装apache(httpd-2.4.3版本)各种坑
  3. How to install Apache (httpd-2.4.3) under Linux
  4. 程序员业余时间写的代码也算公司的?Nginx之父被捕引发争议
  5. Nacos serialize for class [com.alibaba.nacos.common.http.HttpRestResult] failed.
  6. Do programmers write code in their spare time? Controversy over the arrest of nginx's father
  7. Nacos serialize for class [ com.alibaba.nacos . common.http.HttpRestResult ] failed.
  8. Seamless management of API documents using eolink and gitlab
  9. vue 的基础应用(上)
  10. 28岁开始零基础学前端,这些血的教训你一定要避免
  11. Basic application of Vue
  12. Starting at the age of 28, you must avoid these bloody lessons
  13. Ubuntu 16.04 can not connect to the wireless solution and QQ installation
  14. Industry security experts talk about the rapid development of digital economy, how to guarantee the security of data elements?
  15. 利用Vue实现一个简单的购物车功能
  16. Behind the "tireless classroom" and teacher training, can byte education really "work wonders"?
  17. Using Vue to realize a simple shopping cart function
  18. 【css】伪类和伪类元素的区别
  19. 【css效果】实现简单的下拉菜单
  20. 【vue】父子组件传值
  21. The difference between pseudo class and pseudo class elements
  22. [CSS effect] simple drop-down menu
  23. [Vue] value transfer by parent-child component
  24. 【css】设置table表格边框样式
  25. 【css】修改input,textarea中的placeholder样式
  26. vue-router的两种模式(hash和history)及区别
  27. CSS3的滤镜filter属性
  28. [CSS] set table border style
  29. [CSS] modify the placeholder style in input and textarea
  30. Two modes of Vue router (hash and History) and their differences
  31. Filter property of CSS3
  32. 全局安装gulp 报错问题解决
  33. Solution of error report in global installation of gulp
  34. 18个好用的自定义react hook
  35. 你应该知道的常用服务器HTTP状态码?
  36. 18 user defined react hooks
  37. What HTTP status codes should you know about common servers?
  38. 手把手教你打造属于自己团队的前端小报系统
  39. Hand in hand to teach you to build your own front-end tabloid system
  40. In 2021, enterprise SEO actual operation, how to less update, batch ranking regional words?
  41. vue cli4.0 快速搭建项目详解
  42. Vue cli4.0 quick build project
  43. vue-cli脚手架安装
  44. Installation of Vue cli scaffold
  45. [JS knowledge] method of getting elements from DOM
  46. 【jQuery效果】文字滚动
  47. [jQuery effect] text scrolling
  48. [front end] live broadcast of user experience optimization series, real-life sharing of front-line celebrities
  49. React native introduces third party Android SDK
  50. Using html2canvas to generate shared images, CDN images do not show the problem
  51. Using hooks to write react components
  52. Explain the module hot replacement function of webpack in detail
  53. An incomplete guide to writing a simple native wechat applet
  54. How JavaScript calculates 1 + 1 - Part 1 creates a source string
  55. Jsonp method to solve cross domain problems
  56. Canvas animation demo (from zero to one)
  57. El dialog of elementui component encapsulation
  58. Transition group of Vue source code
  59. When encountering bracket validity, next larger element, specific minimum value, try stack
  60. Vue3 virtual DOM