Tag:character

  • String of algorithm — longest palindrome substring

    Time:2020-11-28

    Longest Palindromic Substring difficultysecondaryGiven a strings, foundsThe longest palindrome string in. You can assume thatsThe maximum length of is 1000. as everyone knows,Palindrome substring is a certain axis as the center, left and right mirror symmetryHow to find the longest palindrome substring in S? 1. Violent cracking Brute force cracking is the most easy way […]

  • JS regular expression syntax

    Time:2020-11-28

    regular expression syntax Regular expression is a text pattern composed of ordinary characters (such as numbers, letters, punctuation and metacharacters used to represent a specific character or character set) and special characters (characters used as qualifications or special functions). Common characters All numbers, lowercase letters, uppercase letters, punctuation are common characters. Metacharacters are required to […]

  • Bash technique: a simple and fast shell script for CD to multi-level parent directory

    Time:2020-11-27

    In Linux, when you need to CD to a multi-level parent directory, you need to entercd ../../../And so on. When the input speed is relatively fast, there will be an extra dot or less input in the middle, which needs to be deleted and re entered. In the actual development work, especially in the Android […]

  • Summary of JavaScript regular expression

    Time:2020-11-25

    This paper summarizes the content of JavaScript regular expressions. Table form, clear at a glance. With the help of example graphic explanation. 1、 Metacharacter 2、 Antonym character 3、 Escape character 4、 Repeated matching 5、 Group / capture 6、 Greed and inertia 7、 Modifier example Matches phone numbers that start with 11n, 12n or 1nnn, followed […]

  • Python OCT function

    Time:2020-11-25

      OCT function is also a python built-in function. It mainly converts an integer into octal, which is similar to ord function / Chr function; 1、 Introduction to OCT function The oct() function converts an integer into an octet string. The syntax is as follows: oct(x)   Parameters: X – integer; Return value: return octal […]

  • Basic knowledge of C + +

    Time:2020-11-21

    C + + basic syntax C + + programs can be defined as a collection of objects that interact by calling each other’s methods. Now let’s take a brief look at what classes, objects, methods, and instant variables are. Object-Objects have state and behavior. For example: the state of a dog – color, name, breed, […]

  • Django Chinese character interception

    Time:2020-11-21

    It’s in DjangotruncatewordsandsliceTwo template filters can be used for character interception.truncatewordsChinese is not supported, so in general, Chinese characters are intercepted withsliceThat’s fine. But there are still differences between the two. For example, some developers mentioned the followingA little bit。 Then, there is the following solution. Put it here for backup. (The source of the […]

  • Top 40 common operations of Python string

    Time:2020-11-20

    The first official account is CoderMrWu. We share high-quality technology articles and experiences every week. Welcome everyone to pay attention to and share with you. Today, I read an article and summarized the common syntax of 40 Python string types. I feel it is very interesting. I’d like to share it with you. Although you […]

  • Truncate utf8 encoded string, specify width (not length) from first byte

    Time:2020-11-18

    Intercepts utf8 encoded string, and specifies the width (non length) from the first byte, It is suitable for the same width interception of limited string length such as news headlines The results show that the width difference between Chinese and English is the biggest, and the larger the intercepting width is, the more obvious it […]

  • Force buckle 1519 — the number of nodes with the same label in the subtree

    Time:2020-11-18

    This topic mainly lies in the investigation of the data structure of tree, and the use of depth first traversal.<!– more –> Original title I give you a tree (i.e., a connected acyclic undirected graph), which consists of N nodes numbered from 0 to N – 1, and exactly n – 1 edges. The root […]

  • Regular expressions as I understand them

    Time:2020-11-16

    After studying regular expression for half a year, we can’t say that we have been learning it all the time. We have to deal with it all the time. How to use regular expression to solve our own problems, and how to optimize it when matching a large number of texts. Slowly feel that regular […]

  • Introduction and common commands of PowerShell

    Time:2020-11-16

    Introduction to PowerShell In different operating systems, there are different command prompts. In MAC, Bash is used by default, and many people use Zsh through oh my Zsh. In windows, the command line prompt has CMD.exe And PowerShell. PowerShell is a superset of CMD. In other words, shell can do all the things that can […]