• Swoole coprocess reuse to improve performance


    When implementing an HTTP server, each request is processed in a collaborative process and destroyed after processing the request. Let’s optimize this logic. We can easily think of the improvement of fastcgi compared with CGI. It is nothing more than generating several worker processes in advance and not destroying them after processing. The same is […]

  • Vue constant definition and use


    How to define constants in different environments for Vue projects built with Vue cli 3. X? Click on the defined global base_ URL example Under config / dev.env.js ‘use strict’ const merge = require(‘webpack-merge’) const prodEnv = require(‘./prod.env’) module.exports = merge(prodEnv, { NODE_ENV: ‘”development”‘, BASE_ URL:'” http://localhost:8080 “‘// defined here }) Similarly, config / prod.env.js […]

  • A method to improve the time complexity of for loop


    Find the logarithm where the sum of two numbers in N numbers is 7 //(compared with the improved algorithm with two-layer for loop time complexity of only O (n)) #include<iostream> #include<algorithm> #include<string> #include<string.h> #include<cstdio> #include<queue> #include<stack> #include<set> #include<map> #include<vector> using namespace std; int main(){ int n;// To enter n numbers to find a number pair […]

  • [share] IOS development – realize the effect that uilabel displays different colors and some parts are underlined


    design sketch: @interface XSRecommendedPrivilegeViewController () @property (weak, nonatomic) IBOutlet UIButton *payButton; @property (weak, nonatomic) IBOutlet UILabel *termsLabel;// Terms of service @end @implementation XSRecommendedPrivilegeViewController -(void)viewDidLoad { [super viewDidLoad]; self.payButton.layer.masksToBounds = YES; self.payButton.layer.cornerRadius = 7; Nsstring * changestring = @ “listener package terms of service”; Nsstring * termsstring = [nsstring stringwithformat: @ “click next to agree% @, […]

  • Leetcode15. Python implementation of sum of three


    Title Requirements: thinking Define a res [] to save the result set First arrange the array in order, so that if you encounter duplicate numbers, you can directly go to the next one Traversing the array, only traversing the position of the array subscript from 0 to the position of the array length – 2 […]