String operation to delete the character at the specified position

Using iterator and erase

Here, we use a function erase (iterator) of string to delete the characters at the specified position. The iterator iterator can string.begin () get the first iterator of the string, and then add different values to delete it.

	string s = "abcdefg";
	int i = 3;
	string::iterator itr = s.begin();
	itr+=i;
	s.erase(itr);
	s.erase(itr);
	cout<<s;

Here we want to delete “de”. Because we get the first iterator and add the value, we delete “d”. If we want to delete “e”, we don’t need to add any value, because the position of “e” is just “d”, so we just need to erase () again.

main.cpp : (. Text + 0xd06): undefined reference to XX method | simple record

This blog post is just a record of C + + compilation and installation problems – it doesn’t give the correct solution

main.cpp:(.text+0xd06): undefined reference to `uni_text::UniText::UniText(std::string const&, int)'
main.cpp:(.text+0xe73): undefined reference to `uni_text::UniText::PutText(cv::Mat&, std::string const&, cv::Point_<int> const&, cv::Scalar_<double> const&, bool)'

Analysis:
encounter this problem: run some C + + projects that contain special so dynamic library or static library;
the compiled versions of GCC and G + + used by the native environment are not completely consistent with the libraries (dynamic library or static library) compiled by the author, resulting in these errors

1: There is no corresponding dependency (static library or dynamic library). 2: the compiled versions of some static libraries or dynamic libraries in the project are inconsistent

Solutions:

In the final analysis, it’s an environmental issue: GCC, G + + version matching or the supplement of third-party dependency


The node rimraf module recursively deletes the contents of the folder

When using the webpack build file project, a dist directory is generated every time. Sometimes, all the old files in the dist directory need to be deleted,

In addition to the RM – RF / dist / command, you can also use the rimraf / dist / command

The function of rimraf is to package the RM - RF command in the form of package to delete files and folders, regardless of whether the folder is empty or not

Local installation: NPM install rimraf — save dev

Global installation: NPM install rimraf – G

Use: rimraf & lt; path & gt; [& lt; path & gt;…]

api:rimraf(f, [opts], callback)

Nginx reverse proxy report 400 error solution!

upstream tomcat_ server { 
        server localhost:8090;
    }

server {
     listen 80;
     server_ name localhost;
    charset utf-8;
    access_ log logs/ host.access.log main;

location / {
    proxy_ pass http://tomcat_ server
    proxy_ set_ header Host $http_ Host; / / to add a host header here, return the header information to the server
}

Summary of solutions to open flash back problem after Python packaging

Recently, I wrote a python project, but I found no response after packing it today. I checked some information and said that adding a input input statement at the end of the program can stay here to see the cause of the error.

After I add the input statement, I execute the following command to package

pyinstaller -F --hidden-import babel.numbers start_trade.py

Pay attention not to add the - W parameter, so that the terminal window cannot be displayed and the saved information cannot be seen.
--hidden-import babel.numbers represents the hidden module of packaging

The error message displayed during operation is

No module named 'talib.stream' name 'UI' is not defined

Now the program can’t find the package.

resolvent

Introduce into the files using the module talib.stream

The same is true for the missing module. The missing module is introduced in the file that references the module

However, it should be noted that what it prompts should be introduced according to the name it prompts, such as

import talib.stream

MacBook M1 Big Sur logging into forticlient SSL VPN

It’s not sure whether it’s the system or the M1 chip. The PC version client can’t log in. After the IOS / iPad version logs in, it can’t access the VPN intranet. After a long tour, I saw the open source third-party solution on GitHub, https://github.com/adrienverge/openfortivpn , run after installation

Sudo openfortivpn IP: Port — user name = user name — PPPD use peerdns = 1, which can be run.

Conversion from hexadecimal to decimal

Problem Description:
write a program that accepts a hexadecimal value string and outputs the decimal string of the value (note that there may be multiple sets of data in a test case).

Input:
0xa

Output:
10

#include <cstdio>
#include <iostream>
#include <vector>
#include <string>
using namespace std;
vector<char> conclude;


int CharToInt(char x){
    if (x >= '0' && x <= '9'){
        return x - '0';
    }else{
        return x - 'A' + 10;
    }
}
void Convert(string str, int x){
    int number = 0;
    for(int i = 0; i < str.size(); ++i){
        number *= x;
        number += CharToInt(str[i]);
    }
    printf("%d\n", number);
}

int main(){
    string str;
    while (cin >> str){
        str = str.substr(2);
        Convert(str, 16);
    }
    return 0;
}

Mybatis idea environment integration jar package

    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
        </dependency>
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>5.1.47</version>
        </dependency>
        <dependency>
            <groupId>org.mybatis</groupId>
            <artifactId>mybatis</artifactId>
            <version>3.5.2</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
            <version>5.3.4</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-jdbc</artifactId>
            <version>5.3.4</version>
        </dependency>
        <dependency>
            <groupId>org.aspectj</groupId>
            <artifactId>aspectjweaver</artifactId>
            <version>1.8.13</version>
        </dependency>
        <dependency>
            <groupId>org.mybatis</groupId>
            <artifactId>mybatis-spring</artifactId>
            <version>2.0.2</version>
        </dependency>
    </dependencies>

Duplicate class com.xxx.xxx Find in modules problem solving (Aidl interdependence problem)

1. Usage scenarios:

A (with Aidl) AAR; B (with Aidl) AAR depends on a;

C (APP) relies on a and B AAR libraries

At this time, both a and B have the same Aidl interface class to report the above error!

2. Problem solving

B (Aidl) AAR depends on A. you can remove the Aidl interface class in class B.

Can read JBIG2 image: JBIG2 imageio is not installed

1、 Problem description

Error information: org.apache.pdfbox . contentstream.PDFStreamEngine.operatorException ( PDFStreamEngine.java:917 ) – Cannot read JBIG2 image: jbig2-imageio is not installed

Relevant environmental information:

An error occurred when calling the renderimagewithdpi (int PageIndex, float DPI) method of pdfrenderer

Pdfrenderer uses pdfbox, POM coordinates are:

<dependency>
	<groupId>org.apache.pdfbox</groupId>
	<artifactId>pdfbox</artifactId>
	<version>2.0.19</version>
</dependency>

2、 Solutions

Add the following POM dependencies

<dependency>
	<groupId>org.apache.pdfbox</groupId>
	<artifactId>jbig2-imageio</artifactId>
	<version>3.0.2</version>
</dependency>

 

Reference link:

https://blog.csdn.net/chengzuo875963/article/details/100913781 (this link has been used for reference, but it didn’t work after trying. Finally, we found the scheme of the following link through Google.)

https://github.com/levigo/jbig2-imageio/issues/54